Session Ready
Exercise

How does the current effect depend on lane position?

To quantify the effect of lane number on performance, perform a linear regression on the f_13 versus lanes data. Do a pairs bootstrap calculation to get a 95% confidence interval. Finally, make a plot of the regression. The arrays lanes and f_13 are in your namespace.

Note that we could compute error bars on the mean fractional differences and use them in the regression, but that is beyond the scope of this course.

Instructions
100 XP
  • Compute the slope and intercept of the f_13 versus lanes line using np.polyfit().
  • Use dcst.draw_bs_pairs_linreg() to get 10,000 bootstrap replicates of the slope and intercept, storing them respectively in bs_reps_slope and bs_reps_int.
  • Use the bootstrap replicates to compute a 95% confidence interval for the slope.
  • Print the slope and 95% confidence interval to the screen. This has been done for you.
  • Using np.array(), generate x-values to use for the plot of the bootstrap lines. x should go from 1 to 8.
  • The plot is already populated with the data. Write a for loop to add 100 bootstrap lines to the plot using the keyword arguments color='red', alpha=0.2, and linewidth=0.5.