Bootstrap percentile interval
The main idea in the previous exercise was that the distance between the original sample \(\hat{p}\) and the resampled (or bootstrapped) \(\hat{p}^*\) values gives a measure for how far the original \(\hat{p}\) is from the true population proportion.
The same variability can be measured through a different mechanism. As before, if \(\hat{p}\) is sufficiently close to the true parameter, then the resampled (bootstrapped) \(\hat{p}^*\) values will vary in such a way that they overlap with the true parameter.
Instead of using \(\pm 2 SE\) as a way to measure the middle 95% of the sampled \(\hat{p}\) values, you can find the middle of the resampled \(\hat{p}^*\) values by removing the upper and lower 2.5%. Note that this second method of constructing bootstrap intervals also gives an intuitive way for making 90% or 99% confidence intervals as well as 95% intervals.
The bootstrapped resamples, one_poll_boot
, and the proportion of yes votes, p_hat
are available in your workspace.
This exercise is part of the course
Foundations of Inference in R
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# From previous exercise: bootstrap t-confidence interval
one_poll_boot %>%
summarize(
lower = p_hat - 2 * sd(stat),
upper = p_hat + 2 * sd(stat)
)
# Manually calculate a 95% percentile interval
one_poll_boot %>%
summarize(
lower = ___(stat, p = ___),
upper = ___
)