10. Inference for Two Proportions (Normal Model)
b. Confidence Interval
Math 115
From Testing to Estimation
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
Same general framework as for a single proportion
Different SE formula (more on that next)
In ten A the normal-model hypothesis test reached the same conclusions as the permutation test from nine A — failing to reject for the CPR data and rejecting for the stents data. That answers whether there is a difference. The confidence interval answers the second question — how big is the difference — using the normal model instead of bootstrap.
Recap: CPR Study
Do blood thinners affect survival during CPR? 90 patients randomly assigned to treatment (blood thinner) or control.
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?
Treatment: \(\hat{p}_T = 0.35\) (14 of 40)
Control: \(\hat{p}_C = 0.22\) (11 of 50)
Observed difference: \(\hat{p}_T - \hat{p}_C = 0.13\)
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.
Before computing the confidence interval, let us pull the CPR data back up. From nine A: ninety cardiac-arrest patients randomly assigned to a blood thinner or to standard care. Today’s question is the second half of the inference picture. In ten A we tested whether there’s a difference between the survival rates and failed to reject. Now we estimate how big the true difference actually is — even though we couldn’t rule out zero. From the data, the sample treatment survival rate, p hat T, is fourteen out of forty, about zero point three five. The sample control survival rate, p hat C, is eleven out of fifty, about zero point two two. The observed difference, treatment minus control, is about zero point one three — treatment survival is about thirteen percentage points higher than control. The normal-model hypothesis test in ten A gave a Z of about one point three seven and a p-value of about zero point one seven, so we failed to reject. The bootstrap confidence interval from nine B ran from about negative zero point zero six four up to zero point three two five — comfortably including zero. Today we build a normal-model confidence interval around the observed difference and see how it compares to that bootstrap interval.
Checking Conditions for the CI
Independence: Randomized experiment ✓
Success-Failure: Using observed counts (not pooled)
Treatment: 14 survived, 26 died (both ≥ 10) ✓
Control: 11 survived, 39 died (both ≥ 10) ✓
Conditions are met for using the normal model.
Conditions for the confidence interval are similar to the hypothesis test, with one key change. Success-failure uses observed counts — not expected from a pooled proportion. We just check whether each group has at least ten observed successes and at least ten observed failures. For CPR — fourteen treatment survivors, twenty-six died; eleven control survivors, thirty-nine died. All four counts are at least ten, condition met.
Computing 95% CI
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)\)
SE for the confidence interval uses separate proportions — works out to about zero point zero nine five five for CPR. The margin of error is z-star times the SE — one point nine six times zero point zero nine five five, about zero point one eight seven. The confidence interval is the observed difference plus or minus the margin of error — zero point one three plus or minus zero point one eight seven, giving roughly negative zero point zero six up to zero point three two.
Interpreting the CI
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.
We’re ninety-five percent confident the true difference in CPR survival rates — treatment minus control — lies between roughly negative zero point zero six and zero point three two. The interval straddles zero, so “no blood-thinner effect on survival” remains a plausible explanation — consistent with the hypothesis test failing to reject. And it lands very close to the bootstrap confidence interval from nine B, which ran from negative zero point zero six four up to zero point three two five — the two methods agree.
Pooled or Separate?
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.
Now that we’ve seen both halves of the normal model — pooled SE for the hypothesis test in ten A, separate SE for the confidence interval today — this your-turn tests the load-bearing distinction. When do you pool, and when do you use separate proportions in the SE formula? Three scenarios — advance when you are ready to see the answers. The first scenario is a hypothesis test comparing two teaching methods, so we pool. Under the null, the two true rates are equal, so we estimate that common rate by pooling across both groups. The second is a confidence interval for the difference in side-effect rates between two drugs, so we use separate proportions. A confidence interval doesn’t assume the rates are equal — it estimates the gap — so each group keeps its own p hat in the SE. The third is a hypothesis test of whether vaccination is associated with infection rate, so we pool again. “Associated?” is just the hypothesis test framing — the null says no association, which means equal rates.
Stents — Conditions Check
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.
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.
Now for your turn — we’re computing a normal confidence interval for the stents-and-stroke data. Patients were randomly assigned to stent or control, but they were not a random sample. In ten A the normal hypothesis test gave a Z of about three point one six and a p-value of about zero point zero zero one six — rejected the null. And the bootstrap confidence interval from nine B excluded zero. Today: does the normal confidence interval agree? Two quick steps — advance when you are ready to see the answers. The treatment stroke rate is thirty-three over two hundred twenty-four, about zero point one four seven. For control it’s thirteen over two hundred twenty-seven, about zero point zero five seven. The observed difference is about zero point zero nine — a roughly nine-percentage-point higher stroke rate in the stent group. The confidence interval version of the success-failure check uses observed counts, not pooled expected counts. Treatment has thirty-three observed strokes and one hundred ninety-one no-events; control has thirteen strokes and two hundred fourteen no-events. All four values sit well above ten, so the condition is met.
Stents — CI & Conclusion
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.
With conditions met, we can build the confidence interval. Three steps to wrap up — advance when you are ready to see the answers. SE uses separate proportions. Zero point one four seven times zero point eight five three over two hundred twenty-four, plus zero point zero five seven times zero point nine four three over two hundred twenty-seven, all under a square root — works out to about zero point zero two eight three. Margin of error is one point nine six times zero point zero two eight three, about zero point zero five five. The confidence interval is the observed difference of zero point zero nine plus or minus zero point zero five five, giving an interval from zero point zero three five to zero point one four five. We’re ninety-five percent confident the true increase in stroke rate from stents is between three and a half and fourteen and a half percentage points. The interval excludes zero, consistent with rejecting the null. On scope: random assignment means stents caused the difference, but the patients were not a random sample, so the conclusion applies only to similar patient populations. And the normal confidence interval is very close to the bootstrap interval from nine B — the methods agree.
Looking Ahead
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.
We’ve now built both halves of the normal-model machinery — hypothesis tests in ten A and confidence intervals in ten B. Next time we step back to compare all four methods side by side — permutation, bootstrap, normal hypothesis test, and normal confidence interval — and run a full inference workflow on a new study, including the scope-of-inference questions from topics eight A and eight B.