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

Connected

Exercise

Bootstrapping the data

Using the infer package with type = "bootstrap", you can repeatedly sample from the dataset to estimate the sampling distribution and standard error of the slope coefficient. Using the sampling distribution will allow you to directly find a confidence interval for the underlying population slope.

Instructions

100 XP

Use the infer steps to bootstrap the twins data 1000 times. You don't have to hypothesize() because now you're creating confidence intervals, not hypothesis testing!

  • Specify Foster versus Biological.
  • Generate 1000 replicates by bootstrapping.
  • Calculate the slope statistic.