Session Ready
Exercise

Bootstrap t-confidence interval

The previous exercises told you two things:

  1. You can measure the variability associated with \(\hat{p}\) by resampling from the original sample.
  2. Once you know the variability of \(\hat{p}\), you can use it as a way to measure how far away the true proportion is.

Note that the rate of closeness (here 95%) refers to how often a sample is chosen so that it is close to the population parameter. You won't ever know if a particular dataset is close to the parameter or far from it, but you do know that over your lifetime, 95% of the samples you collect should give you estimates that are within \(2SE\) of the true population parameter.

The votes from a single poll, one_poll, and the data from 1000 bootstrap resamples, one_poll_boot are available in your workspace. These are based on Experiment 2 from earlier in the chapter.

As in the previous exercise, when discussing the variability of a statistic, the number is referred to as the standard error.

Instructions
100 XP
  • Calculate \(\hat{p}\) and assign the result to p_hat. In the call to summarize(), calculate stat as the mean of vote equalling "yes".
  • Find an interval of values that are plausible for the true parameter by calculating \(\hat{p} \pm 2SE\).
    • The lower bound of the confidence interval is p_hat minus twice the standard error of stat. Use sd() to calculate the standard error.
    • The upper bound is p_hat plus twice the standard error of stat.