| Group | Died | Survived | Total |
|---|---|---|---|
| Control | 39 | 11 | 50 |
| Treatment | 26 | 14 | 40 |
| Total | 65 | 25 | 90 |
b. Confidence Interval
Math 115
The H-test answers: “Is there a difference?”
But we also want to know: “How big is the difference?”
Solution: Confidence interval for p_1 - p_2 using the normal model
Do blood thinners affect survival during CPR? 90 patients randomly assigned to treatment (blood thinner) or control.
| Group | Died | Survived | Total |
|---|---|---|---|
| Control | 39 | 11 | 50 |
| Treatment | 26 | 14 | 40 |
| Total | 65 | 25 | 90 |
Today’s question
How big is the true difference p_T - p_C — even though we couldn’t rule out zero?
From 10a: normal H-test Z = 1.37, p-value \approx 0.17 → failed to reject H_0. From 9b: bootstrap CI \approx (-0.064, 0.325) → includes 0.
When conditions are met:
\text{CI} = (\hat{p}_1 - \hat{p}_2) \pm z^* \times SE
Where SE uses separate sample proportions:
SE = \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}
For CPR: plug in \hat{p}_T = 0.35 and \hat{p}_C = 0.22 separately — each in its own term.
Multipliers: 90% → 1.645, 95% → 1.96, 99% → 2.576
Independence: Randomized experiment ✓
Success-Failure: Using observed counts (not pooled)
Conditions are met for using the normal model.
SE (using separate proportions):
SE = \sqrt{\frac{0.35 \times 0.65}{40} + \frac{0.22 \times 0.78}{50}} = 0.0955
Margin of error: ME = z^* \times SE = 1.96 \times 0.0955 \approx 0.187
95% CI: (\hat{p}_T - \hat{p}_C) \pm ME = 0.13 \pm 0.187 = (-0.057, 0.317)
95% Confidence Interval: (-0.057, 0.317)
Interpretation: We are 95% confident that the true difference in survival rates (treatment − control) is between -0.057 and 0.317.
Does CI include 0? Yes → Consistent with failing to reject H_0
Compare to 9b: bootstrap CI \approx (-0.064, 0.325) — methods agree.
For each scenario, decide whether the SE formula uses pooled \hat{p}_{pool} or separate \hat{p}_1, \hat{p}_2.
Hypothesis test: do two new teaching methods give different exam pass rates? Pooled. Under H_0 the two true rates are equal, so we estimate that common rate by pooling across both groups.
95% confidence interval for the difference in side-effect rates between two drugs. Separate. A CI doesn’t assume the rates are equal — it estimates the gap — so each group keeps its own \hat{p} in the SE.
Hypothesis test of whether vaccination and infection rate are associated. Pooled. “Associated?” is just the H-test framing — null says no association (equal rates), so we pool.
How big is the effect of stents on stroke rate? Same study from 9a — patients were randomly assigned to stent (224) vs. control (227); not a random sample. From 10a: normal H-test Z \approx 3.16, p-value \approx 0.0016 → rejected H_0. From 9b: bootstrap CI (0.040, 0.150) → excludes 0.
| Group | No event | Stroke | Total |
|---|---|---|---|
| Control | 214 | 13 | 227 |
| Treatment | 191 | 33 | 224 |
| Total | 405 | 46 | 451 |
Compute \hat{p}_T, \hat{p}_C, and the observed difference \hat{p}_T - \hat{p}_C. \hat{p}_T = 33/224 \approx 0.147; \hat{p}_C = 13/227 \approx 0.057; difference \approx 0.090
Check success-failure for the CI (observed counts). Treatment: 33 stroke, 191 no event (both ≥ 10) ✓ Control: 13 stroke, 214 no event (both ≥ 10) ✓. Uses observed counts, not pooled.
Compute the SE (using separate proportions). SE = \sqrt{\dfrac{0.147 \times 0.853}{224} + \dfrac{0.057 \times 0.943}{227}} \approx 0.0283
Compute the 95% margin of error and the CI. ME = 1.96 \times 0.0283 \approx 0.055; 0.090 \pm 0.055 = (0.035, 0.145)
Interpret the interval and state the scope of inference. We’re 95% confident the true difference in stroke rates (treatment − control) is between 0.035 and 0.145 — stents are associated with a 3.5 to 14.5 percentage-point higher stroke rate. CI excludes 0, consistent with rejecting H_0. Scope: random assignment → causal; not a random sample → applies to similar patient populations. Very close to the bootstrap CI (0.040, 0.150) from 9b.
We’ve built H-tests and CIs with the normal model.
Next time: how do the four methods (permutation, bootstrap, normal H-test, normal CI) compare in practice — and a full inference workflow on a new study, with scope of inference baked in.