Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›AP Statistics
  3. ›3 Inference for Categorical Data: Proportions
  4. ›3.13 Carrying out a two-proportion test

AP Statistics · Unit 3 · Inference for Categorical Data: Proportions

3.13 Carrying out a two-proportion test

Calculate the z statistic for a two-proportion test, find and interpret its p-value, and write a conclusion in context.

  • 4 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5The test statistic measures a difference in standard errors
  1. 1The test statistic measures a difference in standard errors
  2. 2The standard error uses the combined proportion
  3. 3The p-value is a tail area under the standard normal curve
  4. 4A small p-value is evidence against the null hypothesis
  5. 5A conclusion links the p-value to the claim in context
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: The test statistic measures a difference in standard errors

A two-proportion test starts with a gap between two sample proportions. We need to judge whether that gap is large compared with ordinary sampling variation. The test statistic does this by converting the gap into a standardized score.

If H0H_0H0​ is true, the difference between the population proportions is 0. So the statistic subtracts 0 from p^1−p^2\hat{p}_1 - \hat{p}_2p^​1​−p^​2​. It then divides by the standard error, which estimates how much p^1−p^2\hat{p}_1 - \hat{p}_2p^​1​−p^​2​ varies from sample to sample.

Common mistake

The test statistic is not a probability. It is a distance, measured in standard errors from the value that the null hypothesis predicts.

Key terms · tap one for its definition

test statistic

The test statistic is a standardized value, computed from sample data, that measures how far a result is from the null hypothesis value in standard errors.

standard error

The standard error is the estimated standard deviation of a statistic, here of p^1−p^2\hat{p}_1 - \hat{p}_2p^​1​−p^​2​, across repeated samples.

Part 1 done

2

Part 2 of 5: The standard error uses the combined proportion

To finish the formula, we need the standard error. Because H0H_0H0​ says both populations share one proportion, we estimate it by combining the samples. Find p^c=x1+x2n1+n2\hat{p}_c = \frac{x_1 + x_2}{n_1 + n_2}p^​c​=n1​+n2​x1​+x2​​, the overall proportion of successes in both samples.

The statistic is z=p^1−p^2p^c(1−p^c)(1n1+1n2)z = \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{\hat{p}_c(1-\hat{p}_c)\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}}z=p^​c​(1−p^​c​)(n1​1​+n2​1​)​p^​1​−p^​2​​. Larger samples shrink the standard error, so the same gap produces a larger zzz.

Every part of the formula is a proportion or a count, so zzz has no units. A value near 0 means the samples differ little. A value far from 0, in either direction, means a surprising gap.

Worked example

Calculating z

A school tests whether the proportion of students who ride the bus differs between two campuses. In a random sample of 200 students from campus 1, 84 ride the bus. In a random sample of 220 students from campus 2, 66 ride the bus. Calculate zzz.
  1. 1
    Sample proportions: p^1=84200=0.42\hat{p}_1 = \frac{84}{200} = 0.42p^​1​=20084​=0.42 and p^2=66220=0.30\hat{p}_2 = \frac{66}{220} = 0.30p^​2​=22066​=0.30.
  2. 2
    Combined proportion: p^c=150420≈0.3571\hat{p}_c = \frac{150}{420} \approx 0.3571p^​c​=420150​≈0.3571.
  3. 3
    Standard error: 0.3571(0.6429)(1200+1220)≈0.002192≈0.04681\sqrt{0.3571(0.6429)\left(\frac{1}{200}+\frac{1}{220}\right)} \approx \sqrt{0.002192} \approx 0.046810.3571(0.6429)(2001​+2201​)​≈0.002192​≈0.04681.
  4. 4
    Statistic: z=0.42−0.300.04681≈2.56z = \frac{0.42 - 0.30}{0.04681} \approx 2.56z=0.046810.42−0.30​≈2.56.

Answer: z≈2.56z \approx 2.56z≈2.56. The sample difference is about 2.56 standard errors above 0.

Exam tip

Keep extra decimals during the calculation. Round the final z value to two decimals only at the end.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify the quantity in the numerator of the two-proportion z statistic when H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0.
Show answer and explanation

Answer: A · Worked explanation

The numerator is the observed difference in sample proportions minus the null value of 0, which leaves p^1−p^2\hat{p}_1 - \hat{p}_2p^​1​−p^​2​. The combined proportion appears only inside the standard error. The parameters p1p_1p1​ and p2p_2p2​ are unknown, so they cannot be calculated from the data.
3

Part 3 of 5: The p-value is a tail area under the standard normal curve

A z value of 2.56 means little until we know how unusual it is. The p-value is a probability calculated assuming H0H_0H0​ is true. It is the chance of a difference at least as extreme as the one observed. We find it as an area under the standard normal curve.

The alternative hypothesis decides which tail to use:

  • For Ha:p1−p2>0H_a: p_1 - p_2 > 0Ha​:p1​−p2​>0, use the area to the right of zzz
  • For Ha:p1−p2<0H_a: p_1 - p_2 < 0Ha​:p1​−p2​<0, use the area to the left of zzz
  • For Ha:p1−p2≠0H_a: p_1 - p_2 \neq 0Ha​:p1​−p2​=0, double the area in one tail
Figure 1. In a two-sided test, the areas beyond both 2.56 and -2.56 count toward the p-value.

For z≈2.56z \approx 2.56z≈2.56 and a two-sided alternative, each tail has area about 0.005. The p-value is about 0.010.

Common mistake

A p-value is not the probability that the null hypothesis is true. It assumes the null hypothesis and asks how surprising the data would be.

Key term

p-value

The p-value is the probability, assuming the null hypothesis is true, of a test statistic at least as extreme as the one observed in the direction of the alternative.

Part 3 done

4

Part 4 of 5: A small p-value is evidence against the null hypothesis

With a p-value in hand, we compare it with a cutoff. The significance level, α\alphaα, is that cutoff, chosen before the test. Common choices are 0.05 and 0.01.

If the p-value is less than α\alphaα, we reject H0H_0H0​. Otherwise, we fail to reject H0H_0H0​. A small p-value means the data would be unlikely if H0H_0H0​ were true.

Interpret the p-value in context. Suppose the two campuses had the same true proportion of bus riders. There would be about a 1.0% chance of sample proportions at least this far apart.

Key term

significance level

The significance level, α\alphaα, is the p-value cutoff chosen before the test, below which the null hypothesis is rejected.

Part 4 done

Quick check

One question on the part you just read

Easy

Identify the area that gives the p-value when Ha:p1−p2<0H_a: p_1 - p_2 < 0Ha​:p1​−p2​<0.
Show answer and explanation

Answer: C · Worked explanation

A less-than alternative puts the evidence in the lower tail, so the p-value is the area to the left of z. The right-tail area is used for a greater-than alternative. Doubling a tail is for two-sided alternatives, and the area between 0 and z is not a p-value.
5

Part 5 of 5: A conclusion links the p-value to the claim in context

The last step turns the decision into a sentence about the populations. A complete conclusion has three parts:

  • Compare the p-value with α\alphaα
  • State the decision about H0H_0H0​
  • Say what it means, in context, about HaH_aHa​

For the campus example, 0.010<0.050.010 < 0.050.010<0.05, so we reject H0H_0H0​. There is convincing evidence that the true proportions of bus riders differ between the two campuses.

Common mistake

Failing to reject H0H_0H0​ does not prove the proportions are equal. It means the data do not give convincing evidence of a difference.

Go deeperWhy the standard error uses one combined estimate

The null hypothesis claims both populations have the same proportion. Under that claim, every observation in both samples estimates one shared value.

Combining the samples uses all the data to estimate that value. It gives a more stable standard error than treating the two proportions as separate.

Note read

Check your recall[13 marks]

6 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Calculate[3 marks]

    Calculate the z statistic for testing H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0 when 45 of 90 individuals in sample 1 and 30 of 110 individuals in sample 2 are successes.

    Show mark schemeHide mark scheme

    Model answer

    p^1=0.500\hat{p}_1 = 0.500p^​1​=0.500, p^2≈0.2727\hat{p}_2 \approx 0.2727p^​2​≈0.2727 and p^c=75200=0.375\hat{p}_c = \frac{75}{200} = 0.375p^​c​=20075​=0.375. The standard error is 0.375(0.625)(190+1110)≈0.0688\sqrt{0.375(0.625)\left(\frac{1}{90}+\frac{1}{110}\right)} \approx 0.06880.375(0.625)(901​+1101​)​≈0.0688. So z=0.22730.0688≈3.30z = \frac{0.2273}{0.0688} \approx 3.30z=0.06880.2273​≈3.30.

    • 1 mark for finding the combined proportion p^c=0.375\hat{p}_c = 0.375p^​c​=0.375
    • 1 mark for calculating the standard error ≈0.0688\approx 0.0688≈0.0688
    • 1 mark for obtaining z≈3.30z \approx 3.30z≈3.30
  2. 2.Determine[2 marks]

    Determine the p-value for z=3.30z = 3.30z=3.30 when Ha:p1−p2≠0H_a: p_1 - p_2 \neq 0Ha​:p1​−p2​=0.

    Show mark schemeHide mark scheme

    Model answer

    The area to the right of 3.30 is about 0.0005. Doubling it for the two-sided alternative gives a p-value of about 0.001.

    • 1 mark for finding a one-tail area of about 0.0005
    • 1 mark for doubling it to get about 0.001
  3. 3.Interpret[2 marks]

    Interpret a p-value of 0.010 in a test of whether the proportion of bus riders differs between two campuses.

    Show mark schemeHide mark scheme

    Model answer

    If the true proportions of bus riders were equal at the two campuses, there would be about a 1.0% chance of sample proportions at least this far apart.

    • 1 mark for assuming the true proportions are equal
    • 1 mark for stating a probability of about 0.010 of a difference at least this extreme
  4. 4.Justify[2 marks]

    Justify a conclusion in context for a test of whether the proportion preferring online tutoring differs from the proportion preferring in-person tutoring, when the p-value is 0.036 and α=0.05\alpha = 0.05α=0.05.

    Show mark schemeHide mark scheme

    Model answer

    Because 0.036<0.050.036 < 0.050.036<0.05, we reject H0H_0H0​. There is convincing evidence that the true proportions preferring online and in-person tutoring differ.

    • 1 mark for comparing the p-value with α\alphaα to reject H0H_0H0​
    • 1 mark for concluding in context that the proportions differ
  5. 5.Explain[2 marks]

    Explain why the standard error in a two-proportion z-test uses the combined proportion.

    Show mark schemeHide mark scheme

    Model answer

    The null hypothesis says both populations have the same proportion. Combining both samples uses all the data to estimate that one shared value.

    • 1 mark for stating that the null hypothesis claims equal proportions
    • 1 mark for explaining that the samples are combined to estimate the common proportion
  6. 6.Describe[2 marks]

    Describe what it means to fail to reject the null hypothesis in a two-proportion test.

    Show mark schemeHide mark scheme

    Model answer

    The data do not give convincing evidence that the population proportions differ. This does not prove that the proportions are equal.

    • 1 mark for stating that there is not convincing evidence of a difference
    • 1 mark for stating that this does not prove the proportions are equal

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy·Identify[1 mark]

Identify the correct decision when the p-value is 0.03 and α=0.05\alpha = 0.05α=0.05.
Show answer and explanation

Answer: C · Worked explanation

Because 0.03<0.050.03 < 0.050.03<0.05, the p-value is below the cutoff, so we reject H0H_0H0​. Failing to reject would require a p-value larger than α\alphaα. Even a rejection only gives convincing evidence for HaH_aHa​, not certainty, and tests never accept H0H_0H0​ as true.
4.

Medium·Calculate[2 marks]

Sample 1 has 20 successes out of 40. Sample 2 has 18 successes out of 60. Calculate zzz for H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0 using the combined proportion.
Show answer and explanation

Answer: B · Worked explanation

p^c=38100=0.38\hat{p}_c = \frac{38}{100} = 0.38p^​c​=10038​=0.38. The standard error is 0.38(0.62)(140+160)≈0.0991\sqrt{0.38(0.62)\left(\frac{1}{40}+\frac{1}{60}\right)} \approx 0.09910.38(0.62)(401​+601​)​≈0.0991, so z=0.50−0.300.0991≈2.02z = \frac{0.50 - 0.30}{0.0991} \approx 2.02z=0.09910.50−0.30​≈2.02. The value 4.12 uses the total sample size instead of the sum of reciprocals. The value 20.4 forgets the square root.
5.

Medium·Calculate[2 marks]

A two-sided test gives z=−2.33z = -2.33z=−2.33. The area to the left of -2.33 is about 0.0099. Calculate the p-value.
Show answer and explanation

Answer: A · Worked explanation

A two-sided alternative counts both tails, so the p-value is 2(0.0099)≈0.0202(0.0099) \approx 0.0202(0.0099)≈0.020. The value 0.010 is only one tail. The values 0.990 and 0.980 are areas that favor the null hypothesis, not the small tail areas that measure evidence against it.
6.

Medium·Identify[2 marks]

A test gives a p-value of 0.020. Identify the correct interpretation.
Show answer and explanation

Answer: B · Worked explanation

A p-value is calculated assuming the null hypothesis is true, and it gives the chance of data at least this extreme. It is not the probability that either hypothesis is true. It also says nothing about the percentage of the population that differs between the groups.
7.

Medium·Determine[2 marks]

A test of H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0 against Ha:p1−p2≠0H_a: p_1 - p_2 \neq 0Ha​:p1​−p2​=0 gives a p-value of 0.08 with α=0.05\alpha = 0.05α=0.05. Determine the best conclusion.
Show answer and explanation

Answer: D · Worked explanation

Because 0.08>0.050.08 > 0.050.08>0.05, we fail to reject H0H_0H0​, which means the evidence for a difference is not convincing. It does not show the proportions are equal. Rejecting would need a p-value below α\alphaα, and 92% is not a valid probability statement about the hypotheses.
8.

Hard·Predict[2 marks]

Two samples have p^1=0.60\hat{p}_1 = 0.60p^​1​=0.60 and p^2=0.50\hat{p}_2 = 0.50p^​2​=0.50, with equal sample sizes. Predict what happens to zzz if both sample sizes are multiplied by 4 and the proportions stay the same.
Show answer and explanation

Answer: C · Worked explanation

The combined proportion and the numerator stay the same. The standard error contains 1n1+1n2\frac{1}{n_1}+\frac{1}{n_2}n1​1​+n2​1​ under a square root, so multiplying both sizes by 4 divides the standard error by 2, and zzz doubles. It does not quadruple, because of the square root.
9.

Hard·Determine[2 marks]

A test with α=0.05\alpha = 0.05α=0.05 gives z=1.80z = 1.80z=1.80. The area to the right of 1.80 is about 0.036. Determine which statement is correct.
Show answer and explanation

Answer: A · Worked explanation

The one-sided p-value is the single tail, 0.036, which is below 0.05. The two-sided value doubles it to about 0.072, which is above 0.05. The reversed pairing mixes up which alternative needs doubling, and using one value for both ignores that two-sided tests count both tails.
10.

Hard·Determine[2 marks]

A two-sided test gives z=−2.10z = -2.10z=−2.10. The area to the left of -2.10 is about 0.018. Determine the correct conclusion at α=0.01\alpha = 0.01α=0.01.
Show answer and explanation

Answer: B · Worked explanation

The alternative is two-sided, so the p-value is 2(0.018)≈0.0362(0.018) \approx 0.0362(0.018)≈0.036. Since 0.036>0.010.036 > 0.010.036>0.01, we fail to reject H0H_0H0​. Being close to α\alphaα is not enough to reject, and the sign of z only shows direction. Using one tail and 0.05 misreads both the p-value and α\alphaα.

Keep going

Next topic3.14 Setting up a chi-square test for two-way tablesPrevious topic3.12 Setting up a two-proportion test

More in Unit 3 · Inference for Categorical Data: Proportions

  1. 3.7Carrying out a test for a proportionNotes · 10 questions
  2. 3.8Errors in testsNotes · 10 questions
  3. 3.9Differences in sample proportionsNotes · 10 questions
  4. 3.10Interval for a difference of proportionsNotes · 10 questions
  5. 3.11Claims from a difference intervalNotes · 10 questions
  6. 3.12Setting up a two-proportion testNotes · 10 questions
  7. 3.13Carrying out a two-proportion testNotes · 10 questions
  8. 3.14Setting up a chi-square test for two-way tablesNotes · 10 questions
  9. 3.15Carrying out a chi-square test for two-way tablesNotes · 10 questions

All AP Statistics topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by College Board or any exam board.

On this page

0/5 read

  1. 1The test statistic measures a difference in standard errors
  2. 2The standard error uses the combined proportion
  3. 3The p-value is a tail area under the standard normal curve
  4. 4A small p-value is evidence against the null hypothesis
  5. 5A conclusion links the p-value to the claim in context
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe

Two-sided p-value area

Density-4-3-2-10123400.10.20.30.4z statistic (standard errors from 0)
  • Standard normal curve
  • z = 2.56
  • z = -2.56