| Group | Died | Survived | Total |
|---|---|---|---|
| Control | 39 | 11 | 50 |
| Treatment | 26 | 14 | 40 |
| Total | 65 | 25 | 90 |
b. Bootstrap CI
Math 115
Randomized trial: 90 cardiac-arrest patients receiving CPR, assigned to blood thinner (treatment, n = 40) or standard care (control, n = 50). Response: survived at 24 hours?
| Group | Died | Survived | Total |
|---|---|---|---|
| Control | 39 | 11 | 50 |
| Treatment | 26 | 14 | 40 |
| Total | 65 | 25 | 90 |
The permutation test answers: “Is there a difference?”
But we also want to know: “How big is the difference?”
Solution: Bootstrap confidence interval for p_1 - p_2
Same idea as the single-proportion bootstrap from topic 4:
Unlike permutation: each case keeps its group and its outcome. No shuffling to break the association.
Goal: Know how \hat{p}_T - \hat{p}_C would vary across repeated samples from the population.
Problem: We only have one sample — the population is out of reach.
Bootstrap idea: The sample is our best stand-in for the population. Resampling from the sample mimics drawing repeated samples from the population.
→ Spread of bootstrap statistics ≈ spread of \hat{p}_T - \hat{p}_C across real repeated samples → use that spread to build a CI.
| id | group | outcome |
|---|---|---|
| 1 | Tx | SD |
| 2 | Tx | DD |
| 3 | Tx | DD |
| 4 | Tx | SD |
| 5 | Tx | SD |
| 6 | Tx | DS |
| 7 | Ctl | DS |
| 8 | Ctl | DS |
| 9 | Ctl | SD |
| 10 | Ctl | DS |
| 11 | Ctl | DS |
| 12 | Ctl | SD |
| id | group | outcome | drawn |
|---|---|---|---|
| 1 | Tx | S | — |
| 2 | Tx | D | — |
| 3 | Tx | D | — |
| 4 | Tx | S | — |
| 5 | Tx | S | — |
| 6 | Tx | D | — |
| 7 | Ctl | D | — |
| 8 | Ctl | D | — |
| 9 | Ctl | S | — |
| 10 | Ctl | D | — |
| 11 | Ctl | D | — |
| 12 | Ctl | S | — |
shuffle outcomes
draw rows with replacement
View interactive bootstrap demo
The demo shows:
1000 bootstraps. Centered near observed difference (0.13), NOT at 0
95% Bootstrap Percentile CI:
Find the 2.5th and 97.5th percentiles of the bootstrap distribution:
(-0.064, 0.325)
Interpretation: We are 95% confident that the true difference in survival rates (treatment − control) is between -0.064 and 0.325.
The confidence interval and hypothesis test give consistent results:
For CPR study:
ci
p
both
The next slide shows the bootstrap distribution for the active-learning study from 9a (1000 resamples; observed difference \approx 0.20).
Estimate the 95% CI bounds by counting bars from each tail.
Hint: a 95% CI excludes about 25 resamples from each tail (2.5\% \times 1000 = 25). Advance for the walkthrough.
Left tail counts placeholder
Left tail counts: 1 + 2 + 4 + 3 + 2 + 13 = 25
Left 95% bound \approx -0.015
Right tail counts (from right): 1 + 5 + 7 + 10 = 23
95% CI: (-0.015,\ 0.411) — includes 0; fail to reject (matches 9a).
For the stents-and-stroke study from 9a (treatment vs. control, stroke within 30 days), a bootstrap procedure gives a 95% confidence interval for p_T - p_C (stroke rate):
(0.040, \; 0.150)
Does the CI include 0? No. Both endpoints are positive.
Interpret the CI in context. We are 95% confident that the true difference in stroke rates (treatment − control) is between 0.040 and 0.150 — stents are associated with a 4 to 15 percentage-point higher stroke rate.
Is this consistent with the H-test result (p-value \approx 0.004)? Yes. Both reject H_0: the CI excludes 0, and the p-value is below \alpha = 0.05. They agree that 0 is not a plausible value for the true difference.
| Permutation Test | Bootstrap CI | |
|---|---|---|
| Purpose | Hypothesis testing | Estimation |
| Question | Is there a difference? | How big is the difference? |
| Assumes | Null is true | Nothing about null |
| Method | Shuffle response values | Resample with replacement |
| Distribution center | 0 | Observed difference |
| Result | P-value | Confidence interval |