1. Learn
  2. /
  3. Courses
  4. /
  5. Inference for Linear Regression in R

Connected

Exercise

Working with R-output (1)

The p-value given by the lm output is a two-sided p-value by default. In the twin study, it might seem more reasonable to follow along the one-sided scientific hypothesis that the IQ scores of the twins are positively associated. Because the p-value is the probability of the observed data or more extreme, the two-sided test p-value is twice as big as the one-sided result. That is, to get a one-sided p-value from the two-sided output in R, divide the p-value by two.

The linear regression model of Foster vs. Biological, model, is provided in the script.

Instructions

100 XP
  • Get the Biological coefficient from the model.
    • Tidy the model.
    • Filter for the term "Biological".
  • Add a column, one_sided_p_value, of the one-sided p-value.