Course contentsShow
← Data Science
Lesson 409 of 2,14511. Hypothesis Tests for Proportions and CategoriesFree lesson

Z-Test Statistic for Two Proportions

Computing the z-statistic from observed proportions and sample sizes.

Z-Test Statistic for Two Proportions

What You'll Learn

You'll learn how to compute the z-statistic that measures how far apart two sample proportions are, accounting for sample sizes and pooled variation.

The Core Idea

Now that you have the pooled proportion estimator and the standard error for the difference in proportions, you're ready to compute the z-test statistic. This single number tells you how many standard errors away your observed difference is from what you'd expect under the null hypothesis (usually zero difference).

The formula is:

z = (p̂₁ - p̂₂) / SE

Where:

  • p̂₁ and p̂₂ are your two sample proportions
  • SE is the standard error for the difference (calculated using the pooled proportion)

Think of It This Way

Imagine two groups: 60% of Group A and 45% of Group B support a proposal. The raw difference is 15 percentage points. But is that a lot? The z-statistic converts this difference into a standardized scale by dividing by the standard error—essentially asking "how unusual is a 15-point gap given our sample sizes and overall variation?"

A z-statistic near zero means the proportions are similar. Large positive or negative values mean they're far apart (relative to sampling variability).

Example Calculation

  • p̂₁ = 0.60, p̂₂ = 0.45 → difference = 0.15
  • SE = 0.05 (calculated from pooled proportion and sample sizes)
  • z = 0.15 / 0.05 = 3.0

A z-statistic of 3.0 is quite large, suggesting strong evidence of a real difference.

Key Takeaway: The z-test statistic for two proportions standardizes the observed difference by its standard error, producing a value you can compare against the standard normal distribution to assess statistical significance.