Session Ready
Exercise

Linear regressions

Perform a linear regression for both the 1975 and 2012 data. Then, perform pairs bootstrap estimates for the regression parameters. Report 95% confidence intervals on the slope and intercept of the regression line.

You will use the draw_bs_pairs_linreg() function you wrote back in chapter 2.

As a reminder, its call signature is draw_bs_pairs_linreg(x, y, size=1), and it returns bs_slope_reps and bs_intercept_reps. The beak length data are stored as bl_1975 and bl_2012, and the beak depth data is stored in bd_1975 and bd_2012.

Instructions
100 XP
  • Compute the slope and intercept for both the 1975 and 2012 data sets.
  • Obtain 1000 pairs bootstrap samples for the linear regressions using your draw_bs_pairs_linreg() function.
  • Compute 95% confidence intervals for the slopes and the intercepts.