Exercise

# 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)`

.

Instructions 1/2

**undefined XP**

- Run a linear regression of
`Foster`

vs.`Biological`

on the`twins`

dataset. - Tidy the result.
- Filter for rows where
`term`

equals`"Biological"`

. - Use
`pull()`

to pull out the`estimate`

column. - Use
`abs()`

to calculate the absolute value of the slopes.