Exercise

# Percentile method - bootstrap CI for slope

Alternatively, a CI for the slope can be created using the percentiles of the distribution of the bootstrapped slope statistics. Recall that a CI is created in such a way that, over a lifetime of analysis, the coverage rate of a CI is (1-alpha)*100%. If you always set alpha = 0.05, then the 95% confidence intervals will capture the parameter of interest (over your lifetime) 95% of the time. Typically, out of the 5% of the time when the interval misses the parameter, sometimes the interval is too high (2.5% of the time) and sometimes the interval is too low (2.5% of the time).

The bootstrapped estimates of `slope`

, `boot_slope`

, are loaded in your workspace.

Instructions

**100 XP**

- Set
`alpha`

to be 0.05 (although for your own work, feel free to use a different confidence level). - Calculate the relevant percentiles needed to create the confidence interval.
- The lower percentile cutoff is at half
`alpha`

. - The upper percentile cutoff is at one minus half
`alpha`

.

- The lower percentile cutoff is at half
- Create the confidence interval of
`stat`

using`quantile()`

and the percentile cutoffs. Your interval ends should be named`lower`

and`upper`

.