Skip to content

Inference for Two Sample Proportions (CI and Test)

Two-sample z-interval and z-test for the difference in two population proportions p1 - p2, including conditions and pooled vs unpooled SE.

Written and reviewed by the Study Mondo Education TeamLast updated
🎯⭐ INTERACTIVE LESSON

Try the Interactive Version!

Learn step-by-step with practice exercises built right in.

Start Interactive Lesson →

🔍 Inference for Two Sample Proportions (CI and Test)

Comparing proportions between two populations—such as treatment vs. control groups, or two demographic groups—is a common inferential task. We use two-sample z-procedures to estimate and test the difference p1−p2p_1 - p_2.

Setting Up the Problem

Let p1p_1 and p2p_2 be the true proportions in two independent populations. We draw independent samples of sizes n1n_1 and n2n_2, obtaining sample proportions p^1\hat{p}_1 and p^2\hat{p}_2.

We focus on the difference p^1−p^2\hat{p}_1 - \hat{p}_2.

Sampling Distribution of p^1−p^2\hat{p}_1 - \hat{p}_2

When conditions are met, p^1−p^2\hat{p}_1 - \hat{p}_2 is approximately Normal with:

  • Mean: μp^1−p^2=p1−p2\mu_{\hat{p}_1 - \hat{p}_2} = p_1 - p_2
  • Standard deviation: Depends on context (see below)

Two-Sample z-Interval for p1−p2p_1 - p_2 (Unpooled SE)

For a confidence interval, we use the unpooled standard error:

SEunpooled=p^1(1−p^1)n1+p^2(1−p^2)n2SE_{\text{unpooled}} = \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}

Confidence Interval: (p^1−p^2)±z∗⋅SEunpooled(\hat{p}_1 - \hat{p}_2) \pm z^* \cdot SE_{\text{unpooled}}

Where z∗z^* is the critical value (e.g., z∗=1.96z^* = 1.96 for 95% confidence).

Two-Sample z-Test for p1=p2p_1 = p_2 (Pooled SE)

For a hypothesis test (usually testing H0:p1=p2H_0: p_1 = p_2), we use a pooled standard error that assumes the null hypothesis:

p^pool=successes1+successes2n1+n2\hat{p}_{\text{pool}} = \frac{\text{successes}_1 + \text{successes}_2}{n_1 + n_2}

SEpooled=p^pool(1−p^pool)(1n1+1n2)SE_{\text{pooled}} = \sqrt{\hat{p}_{\text{pool}}(1 - \hat{p}_{\text{pool}}) \left( \frac{1}{n_1} + \frac{1}{n_2} \right)}

Test Statistic: z=(p^1−p^2)−0SEpooledz = \frac{(\hat{p}_1 - \hat{p}_2) - 0}{SE_{\text{pooled}}}

Compare to the standard Normal distribution to find the p-value.

Conditions for Two-Sample z-Procedures

Both methods require:

ConditionRequirement
Random samplesBoth samples randomly selected.
IndependenceSamples independent; within samples, n1<0.1N1n_1 < 0.1N_1 and n2<0.1N2n_2 < 0.1N_2.
Large Counts (CI)n1p^1≥10n_1\hat{p}_1 \geq 10, n1(1−p^1)≥10n_1(1-\hat{p}_1) \geq 10, n2p^2≥10n_2\hat{p}_2 \geq 10, n2(1−p^2)≥10n_2(1-\hat{p}_2) \geq 10.
Large Counts (Test)n1p^pool≥10n_1\hat{p}_{pool} \geq 10, n1(1−p^pool)≥10n_1(1-\hat{p}_{pool}) \geq 10, n2p^pool≥10n_2\hat{p}_{pool} \geq 10, n2(1−p^pool)≥10n_2(1-\hat{p}_{pool}) \geq 10.

Worked Example 1: Two-Sample z-Interval

In a clinical trial:

  • Treatment group: 35 successes out of 100 patients → p^1=0.35\hat{p}_1 = 0.35
  • Control group: 20 successes out of 100 patients → p^2=0.20\hat{p}_2 = 0.20

Construct a 95% confidence interval for p1−p2p_1 - p_2.

Check conditions:

  • n1p^1=100(0.35)=35≥10n_1 \hat{p}_1 = 100(0.35) = 35 \geq 10 ✓
  • n1(1−p^1)=100(0.65)=65≥10n_1(1-\hat{p}_1) = 100(0.65) = 65 \geq 10 ✓
  • n2p^2=100(0.20)=20≥10n_2 \hat{p}_2 = 100(0.20) = 20 \geq 10 ✓
  • n2(1−p^2)=100(0.80)=80≥10n_2(1-\hat{p}_2) = 100(0.80) = 80 \geq 10 ✓

Calculate unpooled SE: SE=0.35(0.65)100+0.20(0.80)100=0.2275100+0.16100=0.003875≈0.0622SE = \sqrt{\frac{0.35(0.65)}{100} + \frac{0.20(0.80)}{100}} = \sqrt{\frac{0.2275}{100} + \frac{0.16}{100}} = \sqrt{0.003875} \approx 0.0622

95% CI (z = 1.96):* (0.35−0.20)±1.96(0.0622)=0.15±0.122=(0.028,0.272)(0.35 - 0.20) \pm 1.96(0.0622) = 0.15 \pm 0.122 = (0.028, 0.272)

We are 95% confident that p1−p2p_1 - p_2 is between 0.028 and 0.272 (2.8% to 27.2% difference).

Worked Example 2: Two-Sample z-Test

Test H0:p1=p2H_0: p_1 = p_2 vs. Ha:p1≠p2H_a: p_1 \neq p_2 at α=0.05\alpha = 0.05 using the data above.

Calculate pooled proportion: p^pool=35+20100+100=55200=0.275\hat{p}_{pool} = \frac{35 + 20}{100 + 100} = \frac{55}{200} = 0.275

Calculate pooled SE: SE=0.275(0.725)(1100+1100)=0.199375×0.02=0.00399≈0.0631SE = \sqrt{0.275(0.725) \left( \frac{1}{100} + \frac{1}{100} \right)} = \sqrt{0.199375 \times 0.02} = \sqrt{0.00399} \approx 0.0631

Test statistic: z=0.35−0.200.0631=0.150.0631≈2.378z = \frac{0.35 - 0.20}{0.0631} = \frac{0.15}{0.0631} \approx 2.378

p-value (two-tailed): p-value=2×P(Z≥2.378)≈2(0.0087)≈0.0174p\text{-value} = 2 \times P(Z \geq 2.378) \approx 2(0.0087) \approx 0.0174

Since p-value=0.0174<0.05p\text{-value} = 0.0174 < 0.05, we reject H0H_0. Significant evidence that p1≠p2p_1 \neq p_2.

Common Pitfalls

⚠️ Pooled vs. Unpooled: Use unpooled SE for confidence intervals (we estimate both p1p_1 and p2p_2 separately). Use pooled SE for hypothesis tests under H0:p1=p2H_0: p_1 = p_2 (assumes they are equal).

⚠️ Forgetting the 10% Condition: Always check n<0.1Nn < 0.1N within each population to ensure independence of observations.

⚠️ Large Counts with Pooled Proportion: For tests, check counts using p^pool\hat{p}_{pool}, not individual p^i\hat{p}_i.

Calculator Tip

💡 TI-84 / TI-Nspire: Use 2-PropZInt for confidence intervals and 2-PropZTest for hypothesis tests. Input x1x_1, n1n_1, x2x_2, n2n_2 and the alternative hypothesis. The calculator will compute the interval or test statistic automatically.

📚 Practice Problems

1Problem 1easy

❓ Question:

A survey shows 60% of 200 men and 55% of 250 women favor a ballot measure. Find a 90% confidence interval for the difference pmen−pwomenp_{\text{men}} - p_{\text{women}}.

💡 Show Solution

Sample proportions:

  • p^1=0.60\hat{p}_1 = 0.60 (men), n1=200n_1 = 200
  • p^2=0.55\hat{p}_2 = 0.55 (women), n2=250n_2 = 250

Check Large Counts:

  • n1p^1=200(0.60)=120≥10n_1 \hat{p}_1 = 200(0.60) = 120 \geq 10 ✓
  • All four counts pass.

Unpooled SE: SE=0.60(0.40)200+0.55(0.45)250=0.24200+0.2475250SE = \sqrt{\frac{0.60(0.40)}{200} + \frac{0.55(0.45)}{250}} = \sqrt{\frac{0.24}{200} + \frac{0.2475}{250}} =0.0012+0.0099=0.0111≈0.0505= \sqrt{0.0012 + 0.0099} = \sqrt{0.0111} \approx 0.0505

90% CI (z = 1.645):* (0.60−0.55)±1.645(0.0505)=0.05±0.083=(−0.033,0.133)(0.60 - 0.55) \pm 1.645(0.0505) = 0.05 \pm 0.083 = (-0.033, 0.133)

We are 90% confident the true difference is between −3.3% and 13.3%.

2Problem 2medium

❓ Question:

A drug trial: 48 of 150 patients in the treatment group recovered, versus 35 of 150 in the control group. Test H0:p1=p2H_0: p_1 = p_2 vs. Ha:p1>p2H_a: p_1 > p_2 at α=0.05\alpha = 0.05.

💡 Show Solution

Sample proportions:

  • p^1=48/150=0.32\hat{p}_1 = 48/150 = 0.32 (treatment)
  • p^2=35/150=0.233\hat{p}_2 = 35/150 = 0.233 (control)

Pooled proportion: p^pool=48+35150+150=83300≈0.2767\hat{p}_{pool} = \frac{48 + 35}{150 + 150} = \frac{83}{300} \approx 0.2767

Check Large Counts (with pooled):

  • n1p^pool=150(0.2767)≈41.5≥10n_1 \hat{p}_{pool} = 150(0.2767) \approx 41.5 \geq 10 ✓
  • All four counts pass.

Pooled SE: SE=0.2767(0.7233)(1150+1150)=0.2×0.00133≈0.0516SE = \sqrt{0.2767(0.7233) \left( \frac{1}{150} + \frac{1}{150} \right)} = \sqrt{0.2 \times 0.00133} \approx 0.0516

Test statistic: z=0.32−0.2330.0516≈1.68z = \frac{0.32 - 0.233}{0.0516} \approx 1.68

p-value (one-tailed, Ha:p1>p2H_a: p_1 > p_2): P(Z>1.68)≈0.0465P(Z > 1.68) \approx 0.0465

Since p-value≈0.0465<0.05p\text{-value} \approx 0.0465 < 0.05, we reject H0H_0. Significant evidence that treatment is more effective.

3Problem 3hard

❓ Question:

To detect a difference of at least 10 percentage points between two proportions (p1=0.60p_1 = 0.60, p2=0.50p_2 = 0.50) with 80% power at α=0.05\alpha = 0.05 (two-tailed), approximately how many participants are needed in each group?

💡 Show Solution

This is a sample size calculation for a two-sample proportion test. Use the formula:

n≈(zα/2+zβ)2[p1(1−p1)+p2(1−p2)](p1−p2)2n \approx \frac{(z_{\alpha/2} + z_{\beta})^2 [p_1(1-p_1) + p_2(1-p_2)]}{(p_1 - p_2)^2}

Values:

  • zα/2=1.96z_{\alpha/2} = 1.96 (two-tailed, α=0.05\alpha = 0.05)
  • zβ=0.84z_{\beta} = 0.84 (80% power)
  • p1=0.60p_1 = 0.60, p2=0.50p_2 = 0.50
  • p1−p2=0.10p_1 - p_2 = 0.10

Compute: p1(1−p1)+p2(1−p2)=0.60(0.40)+0.50(0.50)=0.24+0.25=0.49p_1(1-p_1) + p_2(1-p_2) = 0.60(0.40) + 0.50(0.50) = 0.24 + 0.25 = 0.49

n≈(1.96+0.84)2×0.490.102=(2.80)2×0.490.01n \approx \frac{(1.96 + 0.84)^2 \times 0.49}{0.10^2} = \frac{(2.80)^2 \times 0.49}{0.01} =7.84×0.490.01=3.840.01=384= \frac{7.84 \times 0.49}{0.01} = \frac{3.84}{0.01} = 384

Answer: Approximately 384 participants per group (768 total) are needed.

Explain using:

⚠️ Common Mistakes: Inference for Two Sample Proportions (CI and Test)

Avoid these 3 frequent errors

📌 Related Topics in Unit 6: Inference for Categorical Data — Proportions

❓ Frequently Asked Questions

What is Inference for Two Sample Proportions (CI and Test)?▾
Two-sample z-interval and z-test for the difference in two population proportions p1 - p2, including conditions and pooled vs unpooled SE.
How can I study Inference for Two Sample Proportions (CI and Test) effectively?▾
Start by reading the study notes and working through the examples on this page. Then use the flashcards to test your recall. Practice with the 3 problems provided, checking solutions as you go. Regular review and active practice are key to retention.
Is this Inference for Two Sample Proportions (CI and Test) study guide free?▾
Yes — all study notes, flashcards, and practice problems for Inference for Two Sample Proportions (CI and Test) on Study Mondo are free to access. No account is needed.
What course covers Inference for Two Sample Proportions (CI and Test)?▾
Inference for Two Sample Proportions (CI and Test) is part of the AP Statistics course on Study Mondo, specifically in the Unit 6: Inference for Categorical Data — Proportions section. You can explore the full course for more related topics and practice resources.
Are there practice problems for Inference for Two Sample Proportions (CI and Test)?▾
Yes, this page includes 3 practice problems with detailed solutions. Each problem includes a step-by-step explanation to help you understand the approach.