Exercise

# Working with R-output (2)

In thinking about the scientific research question, if IQ is caused only by genetics, then we would expect the slope of the line between the two sets of twins to be 1. Testing the hypothesized slope value of 1 can be done by making a new test statistic which evaluates how far the observed slope is from the hypothesized value of 1.

$$new_t = \frac{slope - 1}{SE}$$

If the hypothesis that the slope equals one is true, then the new test statistic will have a t-distribution which we can use for calculating a p-value.

The biological term from the model is available as `biological_term`

.

Instructions

**100 XP**

- Calculate the degrees of freedom of the
`twins`

dataset. - Calculate the two-sided p-value for the alternative hypothesis that the true slope is different than 1. Build up the calculation in stages.
- Calculate the test statistic as the slope
`estimate`

minus`1`

, all divided by the standard error. - Calculate the one-sided p-value of the test statistic using the cumulative distribution function of the t-distribution,
`pt()`

, at the`test_statistic`

, with the degrees of freedom you just calculated. - Calculate the two-sided p-value as double the one-sided p-value.

- Calculate the test statistic as the slope