AP Statistics · Topic 3.13 · Reading guide, about 5 min

Running the two-proportion z-test

Compute the pooled z statistic and p-value, interpret the p-value, and state a conclusion about two proportions in context.

In one minute

After the setup in 3.12, the test measures how far the observed difference in sample proportions is from 0, in standard errors. A large standardized gap, and a small p-value, would be rare if the two populations really shared a proportion.

This topic walks through the test statistic, the p-value, the decision, and the conclusion. Wording matters as much as arithmetic, especially how you describe the p-value and what you say about HaH_a.

Key terms

Test statistic
A number that says how many standard errors the sample result is from what H0H_0 predicts. Here it is a z-score for p^1−p^2\hat{p}_1-\hat{p}_2.
Pooled standard error
p^c(1−p^c)(1n1+1n2)\sqrt{\hat{p}_c(1-\hat{p}_c)\left(\dfrac{1}{n_1}+\dfrac{1}{n_2}\right)}, the standard error computed assuming H0H_0 is true.
Standard normal
The bell curve with mean 0 and standard deviation 1. The statistic follows it approximately when H0H_0 is true and the conditions hold.
P-value
The probability, assuming H0H_0 is true, of getting a result at least as extreme as the one observed, in the direction of HaH_a.
Significance level
The cutoff α\alpha chosen in advance. A p-value at or below α\alpha leads to rejecting H0H_0.
Reject H0
The decision when the p-value is at most α\alpha. It means convincing evidence for HaH_a, not proof.
Fail to reject H0
The decision when the p-value is above α\alpha. It means not enough evidence for HaH_a, not that H0H_0 is true.
Two-sided p-value
For Ha:p1≠p2H_a: p_1\neq p_2, the probability in both tails, found by doubling the one-tail area.

The test statistic

The statistic is z=(p^1−p^2)−0p^c(1−p^c)(1n1+1n2)z=\dfrac{(\hat{p}_1-\hat{p}_2)-0}{\sqrt{\hat{p}_c(1-\hat{p}_c)\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}}. The numerator is the observed difference minus the difference H0H_0 predicts, which is 0. The denominator is the standard error under H0H_0, built from the pooled proportion p^c\hat{p}_c.

The pooled form is used because H0H_0 says the proportions are equal, so a single shared value describes both groups. The interval in 3.10 differs for the opposite reason: it estimates the difference without assuming it is 0.

A z-score near 0 says the samples look like what equal proportions would produce. A z-score far from 0 says the gap is large compared with usual sampling variation.

From z to the p-value

Use a standard normal table or technology. For Ha:p1>p2H_a: p_1>p_2, the p-value is the area to the right of zz. For Ha:p1<p2H_a: p_1 < p_2, it is the area to the left. For Ha:p1≠p2H_a: p_1\neq p_2, double the one-tail area beyond ∣z∣|z|.

Interpret the p-value in context and assuming H0H_0: "If the true proportions of the two populations were equal, the probability of seeing a difference in sample proportions at least this large would be about ..." Never describe it as the probability that H0H_0 is true.

Four steps of the test
StepWhat you write
StateTest name, parameters, H0 and Ha in context, and alpha
PlanCheck randomization, the 10% condition, and the pooled counts
DoPooled proportion, z statistic, and p-value
ConcludeCompare p-value with alpha; wording about Ha in context for both populations

Worked example: a rejection

A coach compares two training plans (invented data). Of n1=120n_1=120 athletes randomly assigned to plan A, 78 met a fitness goal; of n2=150n_2=150 randomly assigned to plan B, 75 did. Test whether plan A has a higher true proportion of athletes who would meet the goal, at α=0.05\alpha=0.05.

State: H0:p1=p2H_0: p_1=p_2 and Ha:p1>p2H_a: p_1>p_2, where p1p_1 and p2p_2 are the true proportions who would meet the goal under plan A and plan B. Plan: random assignment holds. The pooled proportion is p^c=(78+75)/(120+150)=153/270=0.5667\hat{p}_c=(78+75)/(120+150)=153/270=0.5667, giving counts 120(0.5667)=68120(0.5667)=68, 120(0.4333)=52120(0.4333)=52, 150(0.5667)=85150(0.5667)=85 and 150(0.4333)=65150(0.4333)=65, all at least 10.

Do: p^1=78/120=0.6500\hat{p}_1=78/120=0.6500 and p^2=75/150=0.5000\hat{p}_2=75/150=0.5000, so the difference is 0.15000.1500. The standard error is 0.5667(0.4333)(1/120+1/150)=0.24556(0.015)=0.0607\sqrt{0.5667(0.4333)(1/120+1/150)}=\sqrt{0.24556(0.015)}=0.0607 (from 0.060690). Then z=0.1500/0.060690=2.4716z=0.1500/0.060690=2.4716, and the right-tail area is 0.00670.0067.

Conclude: if the two plans had equal true proportions, the probability of a sample difference of 0.15 or more in favor of plan A would be about 0.0067. Since 0.0067<0.050.0067<0.05, we reject H0H_0. There is convincing evidence that the true proportion of athletes who would meet the goal is higher under plan A than under plan B. Random assignment supports a causal claim for athletes like these.

A fail-to-reject outcome

Return to the checkout data from 3.12: p^1=0.7000\hat{p}_1=0.7000 with n1=90n_1=90 and p^2=0.6000\hat{p}_2=0.6000 with n2=110n_2=110, p^c=0.6450\hat{p}_c=0.6450, and a two-sided alternative. The standard error is 0.645(0.355)(1/90+1/110)=0.068013\sqrt{0.645(0.355)(1/90+1/110)}=0.068013, so z=0.1000/0.068013=1.4703z=0.1000/0.068013=1.4703 and the two-sided p-value is 2(0.07074)=0.14152(0.07074)=0.1415.

At α=0.05\alpha=0.05 we fail to reject H0H_0. The data do not give convincing evidence that the true purchase proportions differ for the two checkout pages. That is not evidence that they are equal; a 10-percentage-point gap in a modest sample can easily arise by chance, and a larger study might tell us more.

How it connects

  • Back to 3.6: the p-value is a probability computed assuming the null hypothesis, exactly as defined there.
  • Back to 3.7: the four-step structure matches the one-proportion test, with a pooled standard error here.
  • Back to 3.8: failing to reject can be a Type II error, and larger groups raise the power.
  • Forward to 3.14: when a variable has more than two categories or there are more than two groups, a chi-square test takes over.

Common mistakes

  • Pooling when building an interval, or not pooling in the test. The test pools and the interval does not.
  • **Saying the p-value is the probability H0H_0 is true.** It assumes H0H_0 is true.
  • Doubling for the wrong alternative. Double only for a two-sided alternative.
  • Concluding the proportions are equal after a large p-value. Say there is not enough evidence of a difference.

How it shows up on the exam

  • A full scenario asks for a complete test: hypotheses, conditions, test statistic, p-value and conclusion in context.
  • A written prompt asks you to interpret a given p-value, or to compare it with alpha and state the decision.
  • A multiple-choice item gives output and asks which conclusion is justified.

Check yourself

  1. Why does the numerator of the statistic subtract 0?
  2. If a two-sided test gave z=−2.1z=-2.1, how would you find the p-value?
  3. After failing to reject, what two things would you say to a coach who asks if the plans are the same?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.