Logo

Data Learning Center Statistical Guides

Comparing Two Proportions

 Sometimes when we sample data from two populations we are interested in whether those two populations differ on some binary (only two outcomes) variable. For example, we may be interested if Democrat and Republican senators vote differently (either yes or no) on a bill, or whether smokers and non-smokers believe that cigarettes should be taxed to fund health care (agree or disagree). For these questions we can compare the population proportions with the following hypotheses:

Null hypothesis: The proportions of the two variables are the equal.

H0: p1 = p2


Alternative hypothesis: The proportions of the two variables are not equal.

HA: p1 ≠ p2


 To statistically test the equality of two proportions the following assumptions should be valid.

 To compare the proportions, a z-statistic is first calculated in the equation:

where p1 and p2 are the proportions from the first and second populations, n1 and n2 are their sample sizes, and p is the pooled proportion from the two populations.

 Once the z-statistic is calculated the corresponding p-value can be determined from the z-distribution. A p-value less than the chosen statistical threshold (typically α = 0.05) allows the null hypothesis to be rejected, to conclude that there is a statistically significant difference in the proportions between the two populations.

Comparing Two Proportions | DLC_statistical_guides