10. Inference for Two Proportions (Normal Model)

b. Confidence Interval
Math 115

Yurk

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)

Recap: CPR Study

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?

  • 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.

CI Formula for Difference in Proportions

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

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.

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)\)

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.

Pooled or Separate?

For each scenario, decide whether the SE formula uses pooled \(\hat{p}_{pool}\) or separate \(\hat{p}_1, \hat{p}_2\).

  1. 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.

  2. 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.

  3. 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.

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.

Group No event Stroke Total
Control 214 13 227
Treatment 191 33 224
Total 405 46 451
  1. 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\)

  2. 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.

Stents — CI & Conclusion

  1. 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\)

  2. 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)\)

  3. 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.

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.

References