Percentile Method with the infer Package

Learn about the percentile method with the infer method.

We'll cover the following

Recall the percentile method for constructing 95% confidence intervals we introduced in the Understanding Confidence Intervals lesson. This method sets the lower endpoint of the confidence interval at the 2.5th percentile of the bootstrap distribution and similarly sets the upper endpoint at the 97.5th percentile. The resulting interval captures the middle 95% of the values of the sample mean in the bootstrap distribution.

We can compute the 95% confidence interval by piping bootstrap_distribution into the get_confidence_interval() function from the infer package. Here, the confidence level will be set to 0.95 and the confidence interval type will be "percentile". Let’s save the results in percentile_ci.

Get hands-on with 1400+ tech skills courses.