Tutorials › AP Statistics › Two-Sided Two-Proportion Test Example

Two-proportion hypothesis tests · Tutorial 530 of 1000

Two-Sided Two-Proportion Test Example

Learn how to test whether policy support differs between two cities, from defining the population proportions to interpreting the two-sided p-value.

Intermediate 9 min read

What You'll Learn

  • Define the population proportions and write hypotheses for a two-sided comparison.
  • Check the study design, independence, 10% condition, and null-model Large Counts condition.
  • Calculate the pooled proportion, pooled standard error, and two-proportion z-statistic.
  • Find and interpret a two-sided p-value using both tails of the standard normal distribution.
  • Write a complete four-step test conclusion in the context of a policy survey.

Testing Whether Support Differs Between Two Cities

In Running 2-PropZTest on the Calculator, you learned how to enter sample counts and select an alternative hypothesis on the TI-84. Now we will use a complete example to connect the calculator output to a two-sided question: does support for a policy differ between two cities? The key is to keep the group order consistent, check the conditions, and interpret the p-value in context.

A two-sided alternative is appropriate when the question asks whether the population proportions are different, without predicting which one is higher. As explained in Hypotheses for Comparing Two Population Proportions, the null hypothesis states that the population proportions are equal. The test uses the pooled proportion to calculate how unusual the observed difference would be if that null hypothesis were true.

Definition: In a two-sided two-proportion \(z\)-test, the alternative is \(H_a:p_1\ne p_2\). Results at least as far from zero as the observed difference count as evidence in either direction: Group 1 could have a higher proportion or a lower proportion than Group 2.

A Four-Step Structure for the Test

Use the same four-step structure introduced in earlier inference tutorials: State, Plan, Do, Conclude. In the Plan step, explain why the two-proportion \(z\)-test is suitable by checking the study design and the expected counts under the null model. In the Do step, calculate the pooled estimate and test statistic, then find the two-sided p-value.

1
State.
Define \(p_1\) and \(p_2\), then write \(H_0:p_1=p_2\) and \(H_a:p_1\ne p_2\).
2
Plan.
Check random sampling or random assignment, independence between groups, the 10% condition when sampling without replacement, and the Large Counts condition using the pooled proportion.
3
Do.
Calculate the sample proportions, pooled proportion, pooled standard error, test statistic, and two-sided p-value.
4
Conclude.
Compare the p-value with \(\alpha\), then state whether the evidence is convincing that the population proportions differ, in context.

For a test of equal population proportions, the pooled proportion is the combined number of successes divided by the combined sample size. The pooled standard error estimates the variability of the sample difference under the null hypothesis. These are the test calculations described in Pooled Proportion and Why It Is Used and Calculating the Pooled Standard Error.

Formula: For \(H_0:p_1=p_2\), calculate \(\hat{p}_c=(x_1+x_2)/(n_1+n_2)\), then \(SE_{\text{pooled}}=\sqrt{\hat{p}_c(1-\hat{p}_c)(1/n_1+1/n_2)}\). The test statistic is \(z=(\hat{p}_1-\hat{p}_2)/SE_{\text{pooled}}\), where \(\hat{p}_i=x_i/n_i\). For \(H_a:p_1\ne p_2\), the p-value includes both tails beyond \(|z|\).

Worked Examples

Worked Example: Comparing Policy Support in Two Cities

Question: In a fictional survey, independent random samples of 150 adult residents are selected from each of two cities. In City A, 87 support a proposed transit policy; in City B, 78 support it. Is there evidence that the proportion of adult residents who support the policy differs between the cities? Use \(\alpha=0.05\).

State: Let \(p_1\) be the true proportion of adult residents in City A who support the policy, and let \(p_2\) be the true proportion of adult residents in City B who support it. The hypotheses are \(H_0:p_1=p_2\) and \(H_a:p_1\ne p_2\). The alternative is two-sided because the question asks whether support differs, not whether one city has greater support.

Plan: Each group is an independent random sample from its city, supporting the Random condition and independence between groups. Assume that each sample is less than 10% of the adult population of its city; this satisfies the 10% condition for sampling without replacement. The pooled proportion under \(H_0\) is \((87+78)/(150+150)=0.55\). The expected successes are \(150(0.55)=82.5\) in each group, and the expected failures are \(150(0.45)=67.5\) in each group. All four expected counts are at least 10, so the Large Counts condition is met.

Do: The sample proportions are \(\hat{p}_1=87/150=0.58\) and \(\hat{p}_2=78/150=0.52\). Their difference, in the defined order, is \(0.58-0.52=0.06\). The pooled proportion is:

$$ \hat{p}_c =\frac{87+78}{150+150} =\frac{165}{300} =0.55 $$

The pooled standard error and test statistic are:

$$ SE_{\text{pooled}} =\sqrt{0.55(0.45)\left(\frac{1}{150}+\frac{1}{150}\right)} =\sqrt{0.0033} \approx 0.05745 $$
$$ z =\frac{0.58-0.52}{0.0574456} \approx 1.044 $$

For the two-sided alternative, results at least as far from zero as \(1.044\) in either direction count toward the p-value. Using the unrounded test statistic, the p-value is approximately \(0.2963\). A TI-84 2-PropZTest with \(x_1=87,n_1=150,x_2=78,n_2=150\), and \(p_1\ne p_2\) gives results that round to \(z=1.044\) and \(p=0.2963\).

Conclude: Assuming that the true support proportions are equal in the two cities, the probability of getting a sample difference at least as far from zero as the observed difference, in either direction, is about \(0.2963\). Because this p-value is greater than \(0.05\), we fail to reject \(H_0\). The survey does not provide convincing evidence that the proportion of adult residents who support the transit policy differs between City A and City B.

Worked Example: A Smaller P-Value for a Policy Comparison

Question: In another fictional survey, independent random samples of 240 adult residents are taken from each of two cities. Support for a proposed water-conservation policy is reported by 168 residents in City North and 132 residents in City South. Test whether the support proportions differ at \(\alpha=0.05\).

Let \(p_1\) and \(p_2\) be the true proportions of adult residents who support the policy in City North and City South, respectively. The hypotheses are \(H_0:p_1=p_2\) and \(H_a:p_1\ne p_2\). Both groups are independent random samples, and we assume each sample is less than 10% of its city’s adult population. These support the Random and independence conditions and the 10% condition. The pooled proportion is \((168+132)/(240+240)=300/480=0.625\). Each group has 150 expected successes and 90 expected failures under the null, so the Large Counts condition is met.

The sample proportions are \(\hat{p}_1=168/240=0.70\) and \(\hat{p}_2=132/240=0.55\), giving an observed difference of \(0.15\). The pooled standard error is:

$$ SE_{\text{pooled}} =\sqrt{0.625(0.375)\left(\frac{1}{240}+\frac{1}{240}\right)} =\sqrt{0.001953125} \approx 0.04419 $$

The test statistic is \(z=0.15/0.04419\approx 3.394\). For a two-sided test, the standard normal areas beyond \(3.394\) and \(-3.394\) combine to give a p-value of approximately \(0.00069\). Using 2-PropZTest with the two cities in the stated order and the \(p_1\ne p_2\) alternative produces the same rounded statistic and p-value.

Conclusion: Because \(0.00069<0.05\), we reject \(H_0\). The survey provides convincing evidence that the proportion of adult residents who support the water-conservation policy differs between City North and City South. The sample results suggest higher support in City North, but the two-sided test itself evaluates whether the proportions differ in either direction.

Worked Example: A Negative Statistic in a Two-Sided Test

Question: A fictional survey asks independent random samples of 120 residents in each of two towns whether they support a proposed late-night noise restriction. In Town A, 54 say yes; in Town B, 66 say yes. Is there evidence that the support proportions differ? Use \(\alpha=0.05\).

Let \(p_1\) and \(p_2\) be the true proportions of residents who support the restriction in Town A and Town B, respectively. Test \(H_0:p_1=p_2\) against \(H_a:p_1\ne p_2\). Assume random sampling from each town, independent groups, and samples less than 10% of the respective resident populations. The pooled proportion is \((54+66)/(120+120)=0.50\). Under the null model, each sample has 60 expected successes and 60 expected failures, so all four expected counts meet the Large Counts condition.

The sample proportions are \(54/120=0.45\) and \(66/120=0.55\), so \(\hat{p}_1-\hat{p}_2=-0.10\). The pooled standard error is:

$$ SE_{\text{pooled}} =\sqrt{0.50(0.50)\left(\frac{1}{120}+\frac{1}{120}\right)} =\sqrt{0.0041667} \approx 0.06455 $$

Therefore, \(z=-0.10/0.06455\approx-1.549\). Because the alternative is two-sided, the p-value includes both tails beyond \(|-1.549|\), and is approximately \(0.1213\). Since this is greater than \(0.05\), we fail to reject \(H_0\). The survey does not provide convincing evidence that support for the noise restriction differs between the two towns. The negative statistic simply shows that the observed sample proportion is lower in Town A; it does not change which tails are counted for a two-sided test.

Common Mistakes and AP Exam Tips

  • Using a one-sided alternative for a two-sided question: If the question asks whether proportions “differ,” use \(H_a:p_1\ne p_2\). Do not choose a direction based on which sample proportion turns out to be larger.
  • Using the wrong standard error: A two-proportion test of equal population proportions uses the pooled proportion in its standard error. The confidence-interval standard error uses the two separate sample proportions instead.
  • Checking observed counts instead of expected counts: For the test’s Large Counts condition, calculate expected successes and failures using \(\hat{p}_c\) for each group. Check all four expected counts against 10.
  • Reporting only one tail: A two-sided p-value includes results at least as extreme in both directions. Use the area beyond \(|z|\) in each tail, or the calculator’s \(p_1\ne p_2\) option.
  • Confusing the p-value with the probability the null is true: As explained in Misinterpretations of the P-Value, the p-value is calculated assuming \(H_0\) is true. It is not the probability that the population proportions are equal.
  • Making a claim of equality after failing to reject: A large p-value does not prove that the proportions are the same. Say that the data do not provide convincing evidence of a difference.
  • Leaving the conclusion out of context: Name the population characteristic and both groups. A complete conclusion connects the decision to the proportion of residents supporting the policy in the two cities.
AP Exam Tip: For a two-sided two-proportion test, clearly state \(H_a:p_1\ne p_2\), check the null-model expected counts, and describe the p-value using “at least as far from zero in either direction.” Then compare it with \(\alpha\) and use “reject” or “fail to reject” followed by a conclusion about the two population proportions in context.

Key Takeaway

A two-sided two-proportion test asks whether two population proportions differ in either direction. The pooled standard error and the test statistic measure how unusual the observed sample difference would be under equal population proportions; the two-sided p-value accounts for outcomes at least that far from zero on both sides.

Key takeaway: Define the two population proportions in a consistent order, use \(H_0:p_1=p_2\) and \(H_a:p_1\ne p_2\), verify the conditions, and interpret both tails of the p-value. A test conclusion describes the evidence about the population proportions, not just the sample results.

Check Your Understanding

Assume the two-proportion test conditions are met unless a question asks you to identify a condition.

  1. A sample of 180 residents in City A has 99 policy supporters, and a sample of 200 residents in City B has 96 supporters. Define \(p_1\) and \(p_2\), then write the hypotheses for testing whether support differs.
  2. For the counts in Question 1, calculate the pooled proportion and the four expected success and failure counts under the null hypothesis.
  3. Why does a two-sided test include areas beyond both \(z\) and \(-z\), rather than only the tail on the side of the observed statistic?
  4. A test gives a p-value of \(0.08\) at \(\alpha=0.05\). What decision should be made, and what should the conclusion avoid claiming?
  5. If \(z\) is negative when Group 1 is City A and Group 2 is City B, what does its sign say about the observed sample proportions?