Aan de slagGa gratis aan de slag

p-value

Now that you have created the null sampling distribution, you can use it to find the p-value associated with the original slope statistic from the twins data. Although you might first consider this to be a one-sided research question, instead, use the absolute value function for practice performing two-sided tests on a slope coefficient.

You can calculate the proportion of TRUE values in a logical vector using mean(). For example, given a numeric vector x, the proportion of cases where x is greater than or equal to 10 can be calculated using mean(x >= 10).

Deze oefening maakt deel uit van de cursus

Inference for Linear Regression in R

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Run a lin. reg. of Foster vs. Biological on twins
abs_obs_slope <- ___ %>%
  # Tidy the result
  ___ %>%   
  # Filter for rows where term equals Biological
  ___ %>%
  # Pull out the estimate
  ___ %>%
  # Take the absolute value
  ___
Code bewerken en uitvoeren