| 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 |
One Proportion
Math 115
Hypothesis Testing: Is a specific value plausible?
Today (Confidence Intervals): What values are plausible?
From hypothesis testing, we know:
Solution: Use an interval estimate instead of just a point estimate
Context: Candidate X is running for mayor. Her campaign wants to estimate the proportion of all voters who support her.
Data: Campaign polls a random sample of 30 voters
Point estimate: About 70% of all voters support her
Question: How confident should we be in this estimate?
We want to know how much \(\hat{p}\) varies from sample to sample.
In hypothesis testing:
Now we have a problem:
Key insight: Our sample is the best approximation we have of the population
The bootstrap idea: Use our sample as a stand-in for the population
Bootstrap sample: Sample WITH replacement from the original sample
Example bootstrap sample:
The bootstrapped proportion is estimated for each bootstrap sample. The resulting bootstrap distribution (dotplot) provides a measure for how the proportions vary from sample to sample. From IMS2 Figure 12.3.
The logic:
Compare to hypothesis testing:
Hypothesis Testing
Confidence Intervals
Same concept (simulation for variability), different purpose
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 |
|---|---|
| 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 |
Summary: 21 voters said “yes”, 9 voters said “no”
Activity: Let’s build the bootstrap distribution together!
Instructions: Draw a dot above your bootstrap proportion
Question: Where is this distribution centered? Compare to hypothesis testing (centered at 0.10).
Try the interactive simulation:
Histogram of 1000 bootstrap proportions. Distribution centered near 0.7 (our observed \(\hat{p}\)).
Standard Error (SE): Standard deviation of a statistic (in this case \(\hat{p}\))
Interpretation: \(\hat{p}\) typically varies by about \(\pm 0.082\) from sample to sample
To create a 95% confidence interval:
Why these percentiles?
95% Confidence Interval: (0.533, 0.834)
Our 95% CI for Candidate X: (0.533, 0.834)
Correct interpretation:
“We are 95% confident that the true proportion of voters who support Candidate X is between 0.533 and 0.834.”
What this means:
Common Misinterpretation
❌ WRONG: “There is a 95% probability that \(p\) is in this interval”
✅ CORRECT: “We are 95% confident that this interval contains \(p\)”
Why the distinction?
Three key properties:
For Candidate X bootstrap distribution:
| Confidence Level | Percentiles | Interval |
|---|---|---|
| 90% | 5th to 95th | (0.567, 0.833) |
| 95% | 2.5th to 97.5th | (0.533, 0.834) |
| 99% | 0.5th to 99.5th | (0.5, 0.9) |
Notice: Higher confidence → wider interval
Trade-off: Confidence vs. Precision
Let’s revisit the medical consultant from hypothesis testing:
Data: 3 complications in 62 surgeries, \(\hat{p} = 0.048\)
Bootstrap 95% CI: (0, 0.113)
Key observation: The national rate of 0.10 IS in this interval
Connection to hypothesis testing: We failed to reject \(H_0: p = 0.10\) (p-value = 0.11)
Insight: Values in the CI are exactly those we would NOT reject in a (two-sided) hypothesis test!
The national rate (0.10) falls within the 95% CI—consistent with our hypothesis test result.
Summary of steps:
Collect sample and calculate \(\hat{p}\)
Generate bootstrap samples: Resample with replacement (at least 1000 times)
Calculate \(\hat{p}_{boot}\) for each bootstrap sample
Build bootstrap distribution from all bootstrap proportions
Find percentiles: 2.5th and 97.5th for 95% CI
Interpret in context: “We are 95% confident that \(p\) is between…”
| Feature | Hypothesis Testing | Confidence Intervals |
|---|---|---|
| Question | Is \(p_0\) plausible? | What values of \(p\) are plausible? |
| Method | Simulate \(H_0\) | Bootstrap resampling from original data with replacement |
| Assumes | \(H_0\) is true (\(p = p_0\)) | Nothing about \(p\) |
| Distribution centered at | \(p_0\) (null value) | \(\hat{p}\) (observed value) |
| Output | P-value | Confidence interval |
| Decision | Reject / Fail to reject \(H_0\) | Values in / out of CI |
Both methods: Use simulation to understand sampling variability, but for different purposes