Hypothesis Tests for Two Proportions

Use the pooled-proportion z-test to compare two independent population proportions. Covers computing the test statistic, performing two-tailed tests, and performing one-tailed tests with appropriate critical values.

Step 1 of 119%

Tutorial

The Two-Proportion z-Test

When we want to compare two population proportions p1p_1 and p2,p_2, we draw an independent sample from each population and test whether the proportions are equal.

From the two populations we have:

  • Sample 1: size n1n_1 with x1x_1 successes, so p^1=x1n1.\hat{p}_1 = \dfrac{x_1}{n_1}.
  • Sample 2: size n2n_2 with x2x_2 successes, so p^2=x2n2.\hat{p}_2 = \dfrac{x_2}{n_2}.

The null hypothesis is always

H0 ⁣:p1=p2.H_0\!: p_1 = p_2.

Under H0,H_0, both populations share a single common proportion p.p. Combining both samples, our best estimate of pp is the pooled sample proportion

p^=x1+x2n1+n2.\hat{p} = \dfrac{x_1 + x_2}{n_1 + n_2}.

The test statistic is then

z=p^1p^2p^(1p^)(1n1+1n2).z = \dfrac{\hat{p}_1 - \hat{p}_2}{\sqrt{\hat{p}(1-\hat{p})\left(\dfrac{1}{n_1} + \dfrac{1}{n_2}\right)}}.

Provided n1n_1 and n2n_2 are large enough, zz is approximately standard normal under H0.H_0.

For a quick illustration, if n1=n2=100n_1 = n_2 = 100 with x1=50x_1 = 50 and x2=40,x_2 = 40, then p^1=0.50,\hat{p}_1 = 0.50, p^2=0.40,\hat{p}_2 = 0.40, p^=90/200=0.45,\hat{p} = 90/200 = 0.45, and

z=0.500.400.450.55(0.01+0.01)=0.100.004951.42.z = \dfrac{0.50 - 0.40}{\sqrt{0.45 \cdot 0.55 \cdot (0.01 + 0.01)}} = \dfrac{0.10}{\sqrt{0.00495}} \approx 1.42.
navigate · Enter open · Esc close · ⌘K/Ctrl K toggle