Comparing Two Independent Population Proportions
When you want to know whether two groups genuinely differ in some proportion (like the percentage of customers who click an ad on two different websites), you need a formal way to test that. A two-proportion z-test lets you determine whether the difference you observe in your samples reflects a real difference in the populations, or whether it could just be random variation.
Hypothesis Tests for Population Proportions
Setting Up Hypotheses
The null hypothesis always assumes the two population proportions are equal:
Your alternative hypothesis depends on the research question:
- Two-tailed: (you're just checking if they differ in either direction)
- Left-tailed: (you suspect group 1's proportion is lower)
- Right-tailed: (you suspect group 1's proportion is higher)
Checking Conditions for Inference
Before running the test, you need to verify three conditions. If these aren't met, the test results can't be trusted.
-
Random sampling: Both samples must be selected randomly and independently of each other. This prevents bias from creeping in.
-
Independence (10% condition): Each sample size should be no more than 10% of its population. Formally: and . This ensures that sampling without replacement doesn't distort your results.
-
Success-failure condition (Large Counts): You need at least 10 expected successes and 10 expected failures in each sample so the normal approximation works. When checking this condition for a hypothesis test, use the pooled proportion (described below) rather than the individual sample proportions, since you're assuming is true:
- and
- and

Choosing a Significance Level
Pick your significance level before collecting data. Common choices:
- (most common in intro courses)
- (more conservative, harder to reject )
- (more liberal, easier to reject )
The significance level is the probability of committing a Type I error, which means rejecting when it's actually true.
Pooled Proportion and Test Statistic
Here's the step-by-step calculation process:
Step 1: Calculate each sample proportion.
and
where and are the number of successes, and and are the sample sizes.
Step 2: Calculate the pooled proportion.
You pool because under you're assuming both groups share the same true proportion. Combining the samples gives you the best single estimate of that shared proportion.
Step 3: Calculate the standard error.
This measures how much variability you'd expect in the difference from sample to sample.
Step 4: Calculate the z-test statistic.
The numerator uses 0 because claims . This test statistic tells you how many standard errors the observed difference is from zero.
This is a z-test, not a t-test. There are no degrees of freedom here. You compare your z-statistic to the standard normal distribution. The degrees of freedom formula applies to two-sample t-tests for means, not proportions.
Worked Example
Suppose 120 out of 400 users clicked an ad on Website A, and 90 out of 350 clicked on Website B. Test whether the click rates differ at .
- ,
With a two-tailed test at , the critical values are . Since 1.31 falls between them, you fail to reject . There isn't sufficient evidence that the click rates differ.

Interpreting Two-Proportion Test Results
Making the Decision
You have two equivalent approaches:
- Critical value method: Reject if the z-statistic falls in the rejection region (beyond the critical value). Otherwise, fail to reject.
- P-value method: Reject if the p-value is less than . Otherwise, fail to reject.
Writing Your Conclusion
Always state your conclusion in context. Don't just say "reject" or "fail to reject."
- If you reject : "There is sufficient evidence at the level to conclude that the proportion of users who click the ad differs between Website A and Website B."
- If you fail to reject : "There is not sufficient evidence at the level to conclude that the proportion of users who click the ad differs between Website A and Website B."
Notice: failing to reject does not mean the proportions are equal. It means you don't have enough evidence to say they're different.
Statistical vs. Practical Significance
A result can be statistically significant but not practically meaningful. For example, if a drug reduces infection rates from 5.0% to 4.8%, that difference might be statistically significant with a large enough sample, but a 0.2 percentage point improvement may not justify the cost of switching treatments.
Always consider the magnitude of the difference alongside the p-value. Statistical significance tells you the difference is probably real; practical significance tells you whether it matters.
Additional Considerations
- Confidence intervals for complement hypothesis tests by giving a range of plausible values for the true difference. If the interval doesn't contain 0, that's consistent with rejecting .
- Type II error occurs when you fail to reject even though the proportions truly are different. Its probability is denoted .
- Power () is the probability of correctly rejecting a false . Larger sample sizes and larger true differences both increase power.