← Back to course

Comparing Two Proportions

You’ll be able to

Comparing two groups

To compare two populations we estimate p₁ − p₂. The statistic is p-hat₁ − p-hat₂, and — because the samples are independent — the standard error adds the two variances under one square root. Conditions extend the one-sample list: both samples random and independent, both under 10% of their populations, and Large Counts satisfied in each group.

The pooled proportion for the test

For a test of H₀: p₁ = p₂, the null says the two proportions are equal, so we get the best estimate of that common value by pooling — combining all successes over all trials into one p-hat_c. The pooled proportion is used only in the test’s standard error. A confidence interval, which does not assume the proportions are equal, uses the separate p-hats instead.

Two-proportion inference
CI: (p-hat₁ − p-hat₂) ± z\*·sqrt( p-hat₁(1−p-hat₁)/n₁ + p-hat₂(1−p-hat₂)/n₂ ) · TEST SE: sqrt( p-hat_c(1−p-hat_c)(1/n₁ + 1/n₂) )
p-hat_c = (x₁ + x₂)/(n₁ + n₂) is the pooled (combined) proportion, used only in the test. The interval uses unpooled separate proportions.
Worked example

Treatment: 45 of 100 improve (p-hat₁ = 0.45). Control: 30 of 100 improve (p-hat₂ = 0.30). Set up the pooled proportion and the test standard error for H₀: p₁ = p₂.

  1. 1.Pool the successes: p-hat_c = (45 + 30)/(100 + 100) = 75/200 = 0.375.
  2. 2.Test standard error: sqrt( p-hat_c(1−p-hat_c)(1/n₁ + 1/n₂) ) = sqrt( 0.375·0.625·(1/100 + 1/100) ).
  3. 3.Compute: 0.375·0.625 = 0.234375; times (0.02) = 0.0046875; sqrt ≈ 0.0685.
  4. 4.z = (0.45 − 0.30)/0.0685 ≈ 2.19, giving a two-sided p-value ≈ 0.029.
Answer: Pooled p-hat_c = 0.375, test SE ≈ 0.0685, z ≈ 2.19, two-sided p-value ≈ 0.029. At α = 0.05 we reject H₀: there is convincing evidence the treatment and control improvement rates differ.
Checkpoint

When performing a two-proportion z test of H₀: p₁ = p₂, why do we use the pooled (combined) proportion in the standard error?

On the exam

Match the standard error to the procedure: a two-proportion test pools into p-hat_c because H₀ assumes equality; a two-proportion confidence interval keeps the proportions separate because it makes no equality assumption. Using the wrong one is a common lost point.

Checkpoint

A 95% confidence interval for p₁ − p₂ is (−0.02, 0.10). What does this interval suggest about the two proportions?

Answer the 2 checkpoints as you read.

Sign in to save your progress