Tutorials › AP Statistics › Conditions for a Two-Proportion z-Test

Two-proportion hypothesis tests · Tutorial 526 of 1000

Conditions for a Two-Proportion z-Test

Learn to evaluate a study’s design and use the pooled proportion to check whether a two-proportion z-test is appropriate.

Intermediate 10 min read

What You'll Learn

  • Identify what random sampling or random assignment contributes to a two-proportion test.
  • Check whether the two groups are independent and whether a 10% condition applies.
  • Calculate pooled expected successes and failures for the Large Counts condition.
  • Distinguish the test’s pooled Large Counts check from the interval check based on observed counts.
  • Explain when a condition failure means the two-proportion z-test should not be used.

Before Using a Two-Proportion z-Test

In Test Statistic for Two Proportions, you learned how to standardize the observed difference between two sample proportions using a pooled standard error. That calculation is useful only when the test’s conditions support the normal model behind the procedure. This tutorial focuses on checking those conditions before relying on the test statistic or its p-value.

The conditions ask about the way the data were collected, the relationship between the groups, and the expected numbers of successes and failures under the null hypothesis. For the Large Counts condition, the two-proportion test uses the pooled proportion because \(H_0:p_1=p_2\) assumes a common population proportion.

Conditions: Before using a two-proportion \(z\)-test, check that the data come from random sampling or an appropriate randomized experiment; that the groups are independent; that the 10% condition is met when sampling without replacement; and that the pooled expected numbers of successes and failures are at least 10 in each group.

Check the Study Design

The Random condition concerns how the data were obtained. The data should come from independent random samples or an appropriate randomized experiment. Random sampling supports generalizing to the populations sampled. Random assignment supports a cause-and-effect conclusion about the experimental units in the study. As explained in Scope of Inference Based on How Data Were Collected, those are different contributions to inference.

The groups must also be independent. For two independent samples, an observation in one group should not be paired with or linked to a particular observation in the other group. In an experiment, each experimental unit should be assigned to one condition, rather than contributing an outcome to both groups. If the same people are measured before and after a change, the data are paired, so a two-proportion test for independent groups is not the right procedure.

When random samples are taken without replacement from finite populations, check the 10% condition in each population: each sample size should be no more than 10% of its population size. This condition helps justify treating observations within a sample as independent. For a randomized experiment, describe how units were assigned and whether the two conditions use separate units; the sampling 10% condition does not apply to random assignment in the same way.

Check Large Counts Under the Null Hypothesis

For a test of \(H_0:p_1=p_2\), the pooled proportion estimates the common success proportion assumed by the null hypothesis. Use it to find the expected numbers of successes and failures in each group if the null model were true. The condition requires each of these four expected counts to be at least 10.

$$ \hat{p}_c=\frac{x_1+x_2}{n_1+n_2} \qquad\text{and}\qquad 1-\hat{p}_c=\frac{(n_1-x_1)+(n_2-x_2)}{n_1+n_2} $$

For Group \(i\), the null model’s expected successes are \(n_i\hat{p}_c\), and its expected failures are \(n_i(1-\hat{p}_c)\). Check both counts in both groups. These are expected counts based on the pooled proportion, not simply the observed successes and failures in each sample.

This check differs from the Large Counts condition for a two-proportion confidence interval in Large Counts for Each Group in Two-Proportion Intervals. For an interval, check the observed successes and failures separately in each group. For a test of equal proportions, check the expected counts from the pooled proportion. The reason is that the test evaluates sample results under the null model of a shared population proportion.

Large Counts condition for a two-proportion test: Calculate \(n_1\hat{p}_c\), \(n_1(1-\hat{p}_c)\), \(n_2\hat{p}_c\), and \(n_2(1-\hat{p}_c)\). All four expected counts must be at least 10.

Worked Examples: Applying the Conditions

Worked Example: A Randomized Reminder Trial

Question: In a fictional experiment, 280 patients are randomly assigned to one of two appointment-reminder systems. Of the 160 assigned to System 1, 110 attend; of the 120 assigned to System 2, 72 attend. Is a two-proportion \(z\)-test appropriate for comparing the population attendance proportions under the two systems?

State: Let \(p_1\) and \(p_2\) be the true proportions of patients who attend under Systems 1 and 2. The test would compare these proportions using \(H_0:p_1=p_2\).

Plan: Check the randomization, whether the groups are independent, and the pooled Large Counts condition. Since this is an experiment, random assignment—not random sampling—is the chance-based design feature.

Do: Patients were randomly assigned, and each patient was assigned to only one system. Thus, the groups do not consist of the same patients measured under both conditions. The experiment supports the Random condition and the independence between groups, assuming one patient’s attendance outcome does not determine another’s.

For the Large Counts condition, pool the successes and sample sizes:

$$ \hat{p}_c=\frac{110+72}{160+120} =\frac{182}{280} =0.65 $$

The expected successes and failures under the null model are:

$$ \begin{aligned} \text{System 1 successes: }&160(0.65)=104, &\quad \text{failures: }&160(0.35)=56,\\ \text{System 2 successes: }&120(0.65)=78, &\quad \text{failures: }&120(0.35)=42. \end{aligned} $$

All four expected counts are at least 10. The sample-without-replacement 10% condition is not relevant to this randomized assignment.

Conclude: The randomization, separate groups, and pooled expected counts support using a two-proportion \(z\)-test to compare the attendance proportions. This condition check does not itself say whether the reminder systems differ; a test statistic, p-value, and significance level are needed for that conclusion.

Check: The pooled count totals are consistent: \(104+78=182\) expected successes, and \(56+42=98\) expected failures. Together, \(182+98=280\), the total number assigned.

Worked Example: Random Samples From Two Neighborhoods

Question: A fictional city takes independent random samples of residents from two distinct neighborhoods. In Neighborhood 1, 52 of 80 sampled residents favor a proposed recycling schedule. In Neighborhood 2, 45 of 90 favor it. Each neighborhood has at least 900 residents. Check whether a two-proportion \(z\)-test is appropriate.

State: Let \(p_1\) and \(p_2\) be the true proportions of residents in Neighborhoods 1 and 2 who favor the schedule. The proposed test compares these population proportions.

Plan: Check that the samples are random, that the groups are independent, that each sample meets the 10% condition, and that all pooled expected counts are at least 10.

Do: The scenario specifies independent random samples. The neighborhoods are distinct, so a resident cannot be in both samples; assume each resident is sampled only once. Each sample is no more than 10% of its neighborhood population: \(80\leq90\) for Neighborhood 1 and \(90\leq90\) for Neighborhood 2, with each population at least 900.

The pooled proportion is:

$$ \hat{p}_c=\frac{52+45}{80+90} =\frac{97}{170} \approx0.5706 $$

Using the exact fraction for the expected-count calculations gives:

$$ \begin{aligned} \text{Neighborhood 1 successes: }&80\left(\frac{97}{170}\right)\approx45.65, &\quad \text{failures: }&80\left(\frac{73}{170}\right)\approx34.35,\\ \text{Neighborhood 2 successes: }&90\left(\frac{97}{170}\right)\approx51.35, &\quad \text{failures: }&90\left(\frac{73}{170}\right)\approx38.65. \end{aligned} $$

Each expected count is greater than 10, so the pooled Large Counts condition is satisfied.

Conclude: The random samples, distinct groups, 10% condition, and pooled expected counts support using a two-proportion \(z\)-test. Any resulting inference concerns the two neighborhood populations and the stated preference, not all city residents unless the sampling design supports that broader claim.

Check: The expected successes add to \(45.65+51.35=97.00\), matching the pooled number of observed successes. The expected failures add to \(34.35+38.65=73.00\), matching the pooled number of observed failures, with rounding.

Worked Example: Large Counts Do Not Fix Paired Data

Question: In a fictional study, 60 students report whether they bring a reusable bottle before and after a school campaign. Before the campaign, 24 report doing so; afterward, 36 do. A student is counted in both groups. Would a two-proportion \(z\)-test for independent groups be appropriate?

State: The question concerns a change in the proportion of these students who bring a bottle. A two-proportion \(z\)-test would treat the before and after groups as independent.

Plan: Check the group relationship before interpreting any Large Counts calculation. If the same students provide both measurements, their responses are paired, which violates the independent-groups condition for this test.

Do: The groups are not independent: each student contributes a before response and an after response. The counts also show that the pooled Large Counts calculation, if performed mechanically, would be comfortably above 10: the combined successes are \(24+36=60\), and the combined sample sizes are \(60+60=120\), giving \(\hat{p}_c=60/120=0.50\). That would produce expected counts of \(60(0.50)=30\) successes and \(60(0.50)=30\) failures in each measurement group.

Conclude: Despite those large expected counts, the two-proportion \(z\)-test for independent groups is not appropriate because the same students were measured twice. Passing one condition cannot compensate for failing another. The data require a method that accounts for pairing.

Check: The expected counts are \(30\) successes and \(30\) failures in each of two measurement occasions, but the 120 occasion-records are not 120 independent students. The pairing is the decisive issue.

Worked Example: Pooled Counts That Are Too Small

Question: In a fictional randomized trial, 2 of 40 units assigned to Treatment 1 and 8 of 50 units assigned to Treatment 2 have the specified success. The groups are separate and the assignment is random. Does the Large Counts condition support a two-proportion \(z\)-test?

State: Let \(p_1\) and \(p_2\) be the success proportions for the two treatment conditions. The question here is whether the pooled Large Counts condition is met.

Plan: Find the pooled proportion under \(H_0:p_1=p_2\), then calculate expected successes and failures for each group. The condition requires all four values to be at least 10.

Do: The pooled proportion is:

$$ \hat{p}_c=\frac{2+8}{40+50} =\frac{10}{90} =\frac{1}{9} \approx0.1111 $$

The expected counts under the null model are:

$$ \begin{aligned} \text{Treatment 1 successes: }&40\left(\frac{1}{9}\right)\approx4.44, &\quad \text{failures: }&40\left(\frac{8}{9}\right)\approx35.56,\\ \text{Treatment 2 successes: }&50\left(\frac{1}{9}\right)\approx5.56, &\quad \text{failures: }&50\left(\frac{8}{9}\right)\approx44.44. \end{aligned} $$

The expected successes in both groups are less than 10. Therefore, the pooled Large Counts condition is not met, even though the expected failure counts are large.

Conclude: The two-proportion \(z\)-test is not justified by the Large Counts condition for these data. Do not proceed as though the normal approximation were supported merely because the groups were randomly assigned or the total number of units was 90.

Check: The expected successes add to \(4.44+5.56=10.00\), consistent with the 10 pooled successes. The condition is checked in each group, however, and neither group reaches 10 expected successes.

Common Mistakes and AP Exam Tips

  • Checking only the total count: A total of at least 10 successes across both groups is not enough. State all four pooled expected counts and verify each one.
  • Using observed counts for a test: Do not substitute the observed successes and failures for the pooled expected counts. For a test of equal proportions, calculate the pooled proportion first and use it for both groups.
  • Confusing test and interval conditions: The interval check uses observed counts separately by group; the test check uses expected counts under the pooled null model. Name which procedure you are checking.
  • Assuming separate labels guarantee independence: Explain how the groups were formed. If the same people or matched units contribute to both groups, the groups are not independent for this procedure.
  • Skipping the 10% condition: For random samples without replacement, address the sample size relative to each population. “The sample is random” does not automatically establish the 10% condition.
  • Thinking one failed condition is canceled by another: Random assignment does not make small expected counts large, and large expected counts do not make paired groups independent. Check every condition.
AP Exam Tip: Write a specific condition check, not just “conditions are met.” Identify the random design, explain why the groups are independent, address the 10% condition when it applies, and show the pooled proportion and all four expected counts. If a condition fails, state clearly that the two-proportion \(z\)-test is not appropriate.

Key Takeaway

The conditions for a two-proportion \(z\)-test combine evidence from the study design with a check of the null model. Random sampling or random assignment, independent groups, and the 10% condition where relevant address the design. The pooled proportion supplies the expected counts for the test’s Large Counts condition.

Key takeaway: For a two-proportion test of equal population proportions, check the study design and group independence, then use \(\hat{p}_c\) to calculate expected successes and failures in each group. All four expected counts must be at least 10.

Check Your Understanding

For each question, distinguish the study-design conditions from the pooled Large Counts condition.

  1. A random sample of 70 people from one population and an independent random sample of 90 from another are compared. What additional population-size check is needed when these samples are taken without replacement?
  2. In a test of equal proportions, there are 18 expected successes overall. Is that enough to establish the Large Counts condition? Explain what must be checked.
  3. Two groups each have 50 participants, but the same 50 people are measured in both groups. Which condition fails for a two-proportion test of independent groups?
  4. For \(x_1=30,n_1=60,x_2=20,n_2=40\), calculate the pooled proportion and the four expected counts. Does the Large Counts condition hold?
  5. Why does a test of equal proportions use pooled expected counts, while a two-proportion interval checks observed counts in each group?