| ID | Vote |
|---|---|
| 1 | yes |
| 2 | yes |
| 3 | yes |
| 4 | no |
| 5 | yes |
| 6 | yes |
| 7 | yes |
| 8 | yes |
| 9 | no |
| 10 | yes |
| 11 | yes |
| 12 | yes |
| 13 | no |
| 14 | yes |
| 15 | yes |
a. The Bootstrap Distribution
Hypothesis Testing: Is a specific value plausible?
Today (Confidence Intervals): Given the data, what are all the plausible values for p?
Context: Candidate X is running for mayor. Her campaign wants to estimate p, the proportion of all voters who support her.
Data: Campaign polls a random sample of 30 voters
This single number is our point estimate for p — our best guess from the data, but not the whole story.
Question: Given the data, what are other plausible values for p?
A value is plausible for p if it could reasonably produce a \hat{p} like ours.
How close to \hat{p} does it have to be?
The key quantity: how much \hat{p} varies from sample to sample.
How can we measure \hat{p}’s variability — from the data we already have?
To simulate \hat{p}’s variability, we’d want to repeatedly draw new samples from the population. We don’t have the population — but our sample is the best approximation of it we’ll ever get.
Idea: Treat the sample as a stand-in for the population, and draw new samples from it.
Picture it physically. Write each person’s vote on its own slip of paper — 30 slips total — and drop them all in a hat.
To build one bootstrap sample:
The result is a new pretend-sample of 30 votes: the same voter can appear multiple times, others not at all.
This is sampling with replacement. Applied to our own sample, it’s called bootstrap sampling (or bootstrapping).
The logic:
Activity: Create your own bootstrap sample
Original sample data: 30 voters (next slide shows the data)
Instructions:
| ID | Vote |
|---|---|
| 1 | yes |
| 2 | yes |
| 3 | yes |
| 4 | no |
| 5 | yes |
| 6 | yes |
| 7 | yes |
| 8 | yes |
| 9 | no |
| 10 | yes |
| 11 | yes |
| 12 | yes |
| 13 | no |
| 14 | yes |
| 15 | yes |
| ID | Vote |
|---|---|
| 1 | yes |
| 2 | yes |
| 3 | yes |
| 4 | no |
| 5 | yes |
| 6 | yes |
| 7 | yes |
| 8 | yes |
| 9 | no |
| 10 | yes |
| 11 | yes |
| 12 | yes |
| 13 | no |
| 14 | yes |
| 15 | yes |
| ID | Vote |
|---|---|
| 16 | yes |
| 17 | yes |
| 18 | no |
| 19 | yes |
| 20 | yes |
| 21 | yes |
| 22 | no |
| 23 | no |
| 24 | no |
| 25 | yes |
| 26 | yes |
| 27 | yes |
| 28 | no |
| 29 | yes |
| 30 | no |
| ID | Vote |
|---|---|
| 16 | yes |
| 17 | yes |
| 18 | no |
| 19 | yes |
| 20 | yes |
| 21 | yes |
| 22 | no |
| 23 | no |
| 24 | no |
| 25 | yes |
| 26 | yes |
| 27 | yes |
| 28 | no |
| 29 | yes |
| 30 | no |
Your random integers/IDs:
25, 4, 7, 1, 2, 29, 23, 11, 14, 18, 27, 19, 1, 21, 21, 10, 22, 14, 10, 7, 9, 15, 21, 5, 9, 25, 14, 5, 5, 2
Votes for your bootstrap sample (Y/N):
Y, N, Y, Y, Y, Y, N, Y, Y, N, Y, Y, Y, Y, Y, Y, N, Y, Y, Y, N, Y, Y, Y, N, Y, Y, Y, Y, Y
Your x: 24
Your \hat{p}_{boot}: 24/30 = 0.8
What does your \hat{p}_{boot} represent?
One example of what \hat{p} might have been from another sample like ours — drawn (with replacement) from our 30 voters.
What does the second \hat{p}_{boot} (the one we computed together) represent?
The same kind of thing — another example of \hat{p}, from a different resample.
If we repeat this process many times, we create a bootstrap distribution — a picture of how \hat{p} varies from sample to sample.
Where does your \hat{p}_{boot} appear on this plot?
Let’s add the one we calculated together.
Advance to add more…
Optional — try the interactive simulation to see the bootstrap distribution build up live:
Histogram of 1000 bootstrap proportions. Distribution centered near 0.7 (our observed \hat{p}).
Same simulation tool — but the anchor is different, so the two distributions sit in different places relative to our observed \hat{p}.
The dashed line marks our observed \hat{p} \approx 0.7. It lands in the tail of the null distribution, but at the center of the bootstrap distribution.
To create a 95% confidence interval:
Why these percentiles?
95% Confidence Interval: (0.533, 0.834)
Each \hat{p} is a dart; the truth p is the bullseye. 95% of darts land within some distance of the bullseye — the bootstrap tells us roughly what that distance is. So we draw a circle of that radius around our dart, and the bullseye is plausibly inside.
That’s our 95% CI.