6. Inference for Categorical Data(COLON) Proportions

Setting Up A Test For The Difference Of Two Population Proportions

Setting Up a Test for the Difference of Two Population Proportions

Welcome, students, to one of the most important ideas in AP Statistics 📊. In this lesson, you will learn how to set up a significance test for the difference of two population proportions. This means deciding whether two groups really have different percentages in the population, or whether any difference in your sample could just be due to random chance.

What you are trying to answer

A population proportion is the fraction of a whole population with a certain trait. For example, the proportion of all students at one school who prefer online homework might be $p_1$, and the proportion at another school might be $p_2$. When we compare two groups, the parameter of interest is usually the difference $p_1-p_2$.

The main question in a test for two proportions is: Is the observed difference in sample proportions strong enough evidence that the population proportions are different? 🧐

The hypotheses always start with a claim about the population difference. The null hypothesis says there is no difference, so it is usually written as $H_0:p_1-p_2=0$. The alternative hypothesis says there is a difference, or that one proportion is greater than the other, depending on the context. Common alternatives are $H_a:p_1-p_2\neq 0$, $H_a:p_1-p_2>0$, or $H_a:p_1-p_2<0$.

Before doing any calculations, students, you need to understand the meaning of these symbols. The hypotheses are about population proportions, not sample proportions. Sample proportions, written as $\hat p_1$ and $\hat p_2$, are used to gather evidence, but they are not the parameters being tested.

Identifying the parameter and context

A good setup begins with defining the parameter in words. Suppose a school counselor wants to know whether the proportion of students who support a new start time is different between freshmen and seniors. Then the parameter could be written as $p_1-p_2$, where $p_1$ is the true proportion of all freshmen who support the change and $p_2$ is the true proportion of all seniors who support it.

Always connect the symbols to the real situation. This is important because AP Statistics problems are not just about formulas; they are about interpreting data in context. If the groups are two brands, two teaching methods, two cities, or two medical treatments, the setup is the same idea: compare two population proportions.

For a test, the null hypothesis usually represents “no difference.” That makes the benchmark value $0$ for the difference $p_1-p_2$. This is different from confidence intervals, which estimate the difference without assuming it is $0$.

A simple example: imagine a survey of voters in two districts. District A has sample proportion $\hat p_1=0.52$ supporting a proposal, and District B has $\hat p_2=0.44$. The observed difference is $\hat p_1-\hat p_2=0.08$. The test asks whether that $0.08$ difference is likely to be real in the population or just the result of random sampling variation.

Writing the hypotheses correctly

The hypotheses must match the research question.

If the question asks, “Are the proportions different?” the alternative is two-sided: $H_a:p_1-p_2\neq 0$.

If the question asks, “Is the proportion in group 1 greater than in group 2?” the alternative is right-tailed: $H_a:p_1-p_2>0$.

If the question asks, “Is the proportion in group 1 less than in group 2?” the alternative is left-tailed: $H_a:p_1-p_2<0$.

The null hypothesis is always the equality statement: $H_0:p_1-p_2=0$. In AP Statistics, you do not write the null with $\neq$.

Here is a quick real-world example. A teacher wants to know whether the proportion of students who pass a quiz is higher after using flashcards than after using only rereading. Let $p_1$ be the proportion who pass with flashcards and $p_2$ be the proportion who pass with rereading. Then the hypotheses might be:

$$H_0:p_1-p_2=0$$

$$H_a:p_1-p_2>0$$

This setup means the teacher believes flashcards may lead to a higher success rate.

Why randomization and sampling matter

A test is used because samples vary from one to another. Even if two populations have exactly the same proportion, one sample may show a difference just by chance 🎲. That is why we do not immediately conclude that a sample difference proves a population difference.

The logic of a significance test is this: assume the null hypothesis is true, then ask how surprising the sample result would be. If the result would be very unusual under $H_0$, we may have evidence against $H_0$.

For two proportions, the sample proportions are computed as $\hat p_1=\frac{x_1}{n_1}$ and $\hat p_2=\frac{x_2}{n_2}$, where $x_1$ and $x_2$ are the counts of “successes” in each group and $n_1$ and $n_2$ are the sample sizes. The observed difference is $\hat p_1-\hat p_2$.

In a setup question, you are usually not asked to calculate the test statistic yet. Instead, you are asked to identify the parameter, write the hypotheses, and maybe state the type of test. The correct test is a two-proportion $z$ test for the difference $p_1-p_2$.

Conditions for using the test

Setting up a test also means checking whether the procedure is appropriate. AP Statistics often expects you to state conditions before carrying out the test.

First, the data should come from a random sample or a randomized experiment. Randomness helps make the sample representative or supports cause-and-effect conclusions.

Second, the observations in each sample should be independent. If sampling without replacement, the sample should be no more than 10% of the population: $n_1\le 0.1N_1$ and $n_2\le 0.1N_2$, where $N_1$ and $N_2$ are the population sizes.

Third, the large counts condition should be checked using the pooled proportion under the null hypothesis, because the null says the proportions are the same. Let $\hat p$ be the pooled proportion, given by $\hat p=\frac{x_1+x_2}{n_1+n_2}$. Then the counts must satisfy $n_1\hat p\ge 10$, $n_1(1-\hat p)\ge 10$, $n_2\hat p\ge 10$, and $n_2(1-\hat p)\ge 10$.

Why pooled? Because under $H_0:p_1-p_2=0$, the best estimate of the common population proportion is the combined sample proportion. This is a key idea in inference for two proportions.

If the counts are too small, the $z$ procedure may not be reliable. In that case, AP Statistics usually expects you to say the condition is not met.

Example of a full setup

Suppose a company wants to compare the proportion of customers who prefer two packaging designs. Design A was shown to one random sample of customers, and Design B was shown to another random sample. Let $p_1$ be the true proportion of all customers who prefer Design A, and let $p_2$ be the true proportion of all customers who prefer Design B.

If the company wants to know whether the designs are preferred differently, the hypotheses are:

$$H_0:p_1-p_2=0$$

$$H_a:p_1-p_2\neq 0$$

The test is a two-proportion $z$ test.

Next, the conditions are checked: both samples must be random, the samples must be independent, and the large counts condition must hold using the pooled proportion. If all conditions are met, the test can proceed.

Notice how the setup includes the context, symbols, hypotheses, and conditions. That is the core of AP Statistics reasoning. You are building a statistical argument, not just plugging numbers into a formula.

How this connects to the bigger unit

This lesson fits inside Inference for Categorical Data: Proportions because it deals with categorical outcomes, such as yes/no, success/failure, support/not support, or purchase/no purchase. The two-proportion test is a natural extension of the one-proportion test.

In the same unit, you also study confidence intervals for proportions, significance tests for one proportion, and error types. The difference here is that you are comparing two groups instead of one. That makes the setup slightly more complex, but the logic stays the same: define the parameter, state hypotheses, check conditions, and use sample evidence to make a conclusion.

This lesson also connects to later decision-making about $\alpha$, $P$-values, Type I errors, and Type II errors. If you reject $H_0$ when it is true, that is a Type I error. If you fail to reject $H_0$ when the alternative is true, that is a Type II error. Those ideas matter because a significance test is really a controlled way to make a decision from sample data.

Conclusion

Setting up a test for the difference of two population proportions is about telling a clear statistical story, students. You identify two population proportions, write the hypotheses in terms of $p_1-p_2$, choose the correct alternative based on the question, and check whether the test conditions are met. This setup is the first major step in a two-proportion $z$ test, and it is an essential skill in AP Statistics 📘.

Once you can set up the test correctly, the later steps—calculating a test statistic, finding a $P$-value, and making a conclusion—become much easier. The key idea is simple: use sample data to decide whether there is convincing evidence that two population proportions are different.

Study Notes

  • The parameter for comparing two proportions is usually $p_1-p_2$.
  • The null hypothesis for a two-proportion test is almost always $H_0:p_1-p_2=0$.
  • The alternative hypothesis depends on the wording of the question: $H_a:p_1-p_2\neq 0$, $H_a:p_1-p_2>0$, or $H_a:p_1-p_2<0$.
  • Use $\hat p_1$ and $\hat p_2$ for sample proportions; use $p_1$ and $p_2$ for population proportions.
  • The correct procedure is a two-proportion $z$ test.
  • Check randomness, independence, and the large counts condition before using the test.
  • For the large counts condition, use the pooled proportion $\hat p=\frac{x_1+x_2}{n_1+n_2}$ under the null hypothesis.
  • The test helps decide whether an observed difference in sample proportions is likely due to chance or reflects a real population difference.
  • This topic is part of inference for categorical data and connects to confidence intervals, $P$-values, and Type I and Type II errors.

Practice Quiz

5 questions to test your understanding