Unit 3 · Topic 3.12 Beta

Setting Up a Test for the Difference Between Two Population Proportions

A two-sample z test for p_1 − p_2 starts from H_0:p_1 − p_2 = 0 and an alternative chosen from the question.

Practice 2: Collect DataPractice 4: Interpret Results

Part 1 · Hook

Why this matters

A city hands out a new recycling bin to 160 randomly chosen households and leaves 140 with the old one. A month later, 78% of the new bin households sort correctly against 65% of the others. Before anyone runs the numbers, the test has to be set up: what exactly is being claimed, which procedure fits, and are its conditions met?

Part 2 · Before you start

What this builds on

Part 3 · Prerequisite check

Quick check before you start

1. Which is a correct null hypothesis for one proportion?

  1. H0:p=0.4H_0: p = 0.4
  2. H0:p^=0.4H_0: \hat{p} = 0.4
  3. H0:p>0.4H_0: p > 0.4
  4. H0:p^>0.4H_0: \hat{p} > 0.4
Show the answer

A null hypothesis is about the parameter, with an equals sign.

  • Correct: H0:p=0.4H_0: p = 0.4:
  • H0:p^=0.4H_0: \hat{p} = 0.4:
  • H0:p>0.4H_0: p > 0.4:
  • H0:p^>0.4H_0: \hat{p} > 0.4:

2. For a test of H0:p=0.4H_0: p = 0.4 with n=50n = 50, which large counts check is right?

  1. 50(0.4)=2050(0.4) = 20 and 50(0.6)=3050(0.6) = 30 are at least 10
  2. n=50n = 50 is at least 30
  3. 50p^50\hat{p} is at least 10
  4. 50(0.5)=2550(0.5) = 25 is at least 10
Show the answer

A test checks large counts with the null value p0p_0.

  • Correct: 50(0.4)=2050(0.4) = 20 and 50(0.6)=3050(0.6) = 30 are at least 10:
  • n=50n = 50 is at least 30:
  • 50p^50\hat{p} is at least 10:
  • 50(0.5)=2550(0.5) = 25 is at least 10:

Part 4 · See it

See it first

Bar chart of the share of households that sorted recycling correctly: new bin 0.781 (125 of 160), old bin 0.650 (91 of 140), and the pooled proportion 0.72 (216 of 300), shown as a dashed line that lies between the two.
The two sample proportions and the pooled proportion pc=216300=0.72p_c = \frac{216}{300} = 0.72, the estimate of the common proportion if H0H_0 is true. LevlPrep original diagram.

Part 5 · Step by step

How it works, step by step

  1. The question compares two groups on a yes or no outcomethe parameter is p1−p2p_1 - p_2, and the procedure is a two-sample z test
  2. The null hypothesis says there is no differenceH0:p1−p2=0H_0: p_1 - p_2 = 0, and HaH_a says >>, << or ≠\ne as the question asks, chosen before seeing the data
  3. If H0H_0 is true, both samples come from populations with one common proportionestimate it by pooling: pcp_c=x1+x2n1+n2= \frac{x_1 + x_2}{n_1 + n_2}, total successes over total sample size
  4. The test is computed as if H0H_0 were truecheck large counts with pcp_c: n1pcn_1 p_c, n1(1−pc)n_1(1 - p_c), n2pcn_2 p_c, n2(1−pc)n_2(1 - p_c) each at least 10, plus random and 10%

Part 6 · Key ideas

Key ideas

  • Hypotheses: H0:p1−p2=0H_0: p_1 - p_2 = 0 and Ha:p1−p2>0H_a: p_1 - p_2 > 0, <0< 0 or ≠0\ne 0, with each pp defined as a true proportion in context.
  • Pooled proportion: pcp_c=x1+x2n1+n2= \frac{x_1 + x_2}{n_1 + n_2}, the combined successes over the combined sample size. Never the average of p^1\hat{p}_1 and p^2\hat{p}_2.
  • Conditions: two independent random samples or randomly assigned groups; 10% for each sample; large counts with pcp_c.
  • Name it in full: "a two-sample z test for p1−p2p_1 - p_2".

Part 7 · Misconception

A common mistake

The wrong idea: The pooled proportion is the average of the two sample proportions.

What actually happens: Pool the counts, not the proportions: add the successes and divide by the total sample size. With unequal sample sizes the two answers differ, and only the pooled counts give the right estimate.

Part 8 · Check yourself

Check yourself

Exam-style questions. Anything you miss goes into your review queue.

Table

New recycling bins

A city wants to know whether a new bin design increases the share of households that sort their recycling correctly. It randomly assigns 300 volunteer households: 160 get the new bin and 140 keep the old one. After a month, inspectors record which households sorted correctly. (Invented data.)
Households that sorted correctly
BinSorted correctlyHouseholdsSample proportion
New1251600.781
Old911400.650

1. Which hypotheses match the city's question?

  1. H0:pN−pO=0H_0: p_N - p_O = 0, Ha:pN−pO>0H_a: p_N - p_O > 0
  2. H0:pN−pO>0H_0: p_N - p_O > 0, Ha:pN−pO=0H_a: p_N - p_O = 0
  3. H0:pN−pO=0H_0: p_N - p_O = 0, Ha:pN−pO≠0H_a: p_N - p_O \ne 0
  4. H0:p^N−p^OH_0: \hat{p}_N - \hat{p}_O=0= 0, Ha:p^N−p^O>0H_a: \hat{p}_N - \hat{p}_O > 0
Show the answer

The null is no difference; the alternative is the direction of the research question.

  • Correct: H0:pN−pO=0H_0: p_N - p_O = 0, Ha:pN−pO>0H_a: p_N - p_O > 0: Right: the null says no difference; the alternative says the new bin is better, the direction the city asked about.
  • H0:pN−pO>0H_0: p_N - p_O > 0, Ha:pN−pO=0H_a: p_N - p_O = 0: The null hypothesis is the "no difference" claim, with an equals sign; the alternative is what we look for evidence of.
  • H0:pN−pO=0H_0: p_N - p_O = 0, Ha:pN−pO≠0H_a: p_N - p_O \ne 0: The city asked whether the new design increases correct sorting, a one-sided question. Choose the direction before seeing the data.
  • H0:p^N−p^OH_0: \hat{p}_N - \hat{p}_O=0= 0, Ha:p^N−p^O>0H_a: \hat{p}_N - \hat{p}_O > 0: Hypotheses are about parameters. We know the sample proportions differ; the question is about the true proportions.

2. How should pNp_N be defined in context?

  1. The proportion of the 160 new bin households in this study that sorted correctly
  2. The chance that a household chosen at random picks the new bin over the old one
  3. The number of households in the study that sorted correctly with the new bin
  4. The true share of such households that would sort correctly with the new bin
Show the answer

Define each parameter as a true proportion, in context.

  • The proportion of the 160 new bin households in this study that sorted correctly: That is p^N=0.781\hat{p}_N = 0.781, a statistic we already know.
  • The chance that a household chosen at random picks the new bin over the old one: Households did not choose; the city assigned the bins at random.
  • The number of households in the study that sorted correctly with the new bin: A proportion is a fraction of a group, not a count.
  • Correct: The true share of such households that would sort correctly with the new bin: Right: in an experiment, the parameter is the proportion of subjects like these who would succeed with that treatment.

3. What is the pooled proportion pcp_c for this test? Give three decimal places.

Type a number. A table answer and a calculator answer are both accepted.

Show the answer

pcp_c=125+91160+140= \frac{125 + 91}{160 + 140}=216300= \frac{216}{300}=0.72= 0.72.

  • Answer: 0.72

4. Which statement correctly checks the large counts condition for this test?

  1. 160(0.5)=80160(0.5) = 80 and 140(0.5)=70140(0.5) = 70 are each at least 10
  2. Both p^N\hat{p}_N and p^O\hat{p}_O are greater than 0.10
  3. 160(0.72)=115.2160(0.72) = 115.2, 160(0.28)=44.8160(0.28) = 44.8, 140(0.72)=100.8140(0.72) = 100.8 and 140(0.28)=39.2140(0.28) = 39.2 are each at least 10
  4. The total of 300 households is at least 30
Show the answer

For the test, n1pcn_1 p_c, n1(1−pc)n_1(1 - p_c), n2pcn_2 p_c, n2(1−pc)n_2(1 - p_c) are each at least 10.

  • 160(0.5)=80160(0.5) = 80 and 140(0.5)=70140(0.5) = 70 are each at least 10: Nothing in the problem is 0.5. The null hypothesis says the proportions are equal, and pcp_c estimates that common value.
  • Both p^N\hat{p}_N and p^O\hat{p}_O are greater than 0.10: That is not the condition. Each group needs at least 10 expected successes and failures.
  • Correct: 160(0.72)=115.2160(0.72) = 115.2, 160(0.28)=44.8160(0.28) = 44.8, 140(0.72)=100.8140(0.72) = 100.8 and 140(0.28)=39.2140(0.28) = 39.2 are each at least 10: Right: a test assumes pN=pOp_N = p_O, so the four counts use the pooled proportion pc=0.72p_c = 0.72.
  • The total of 300 households is at least 30: Comparing nn with 30 is a rule for means. Check counts against 10.

5. A researcher looks at her data, sees that p^1>p^2\hat{p}_1 > \hat{p}_2, and then writes Ha:p1−p2>0H_a: p_1 - p_2 > 0. What is wrong?

  1. The direction of HaH_a must come from the question, not the data
  2. HaH_a should say p1−p2=0p_1 - p_2 = 0
  3. HaH_a should be written about the sample proportions, p^1−p^2\hat{p}_1 - \hat{p}_2
  4. One-sided alternatives are not allowed for two proportions
Show the answer

Set hypotheses from the question, before the data.

  • Correct: The direction of HaH_a must come from the question, not the data: Right: choosing a one-sided test because of the sample result makes evidence look stronger than it is.
  • HaH_a should say p1−p2=0p_1 - p_2 = 0: The equality belongs in H0H_0.
  • HaH_a should be written about the sample proportions, p^1−p^2\hat{p}_1 - \hat{p}_2: Hypotheses are about parameters, never sample statistics.
  • One-sided alternatives are not allowed for two proportions: One-sided alternatives are fine when the question has a direction.

6. A clinic randomly assigns 30 patients to each of two treatments for a rare reaction. In all, 6 of the 60 patients have the reaction. Why is the large counts condition not met for a two-sample z test?

  1. 30(0.90)=2730(0.90) = 27 is more than 10
  2. The groups have the same size, 30
  3. Random assignment was used instead of random sampling
  4. pc=0.10p_c = 0.10, so 30(0.10)=330(0.10) = 3 is less than 10 in each group
Show the answer

Each of the four counts with pcp_c must reach 10.

  • 30(0.90)=2730(0.90) = 27 is more than 10: That count passes. It is the other count, 30(0.10)=330(0.10) = 3, that fails.
  • The groups have the same size, 30: Equal groups are fine. The small number of reactions expected in each group is the problem.
  • Random assignment was used instead of random sampling: Random assignment satisfies the random condition. The counts are the problem.
  • Correct: pc=0.10p_c = 0.10, so 30(0.10)=330(0.10) = 3 is less than 10 in each group: Right: with so few reactions overall, each group expects only 3, too few for a normal model.

Part 9 · Summary

Summary

A two-sample z test for p1−p2p_1 - p_2 starts from H0:p1−p2=0H_0: p_1 - p_2 = 0 and an alternative chosen from the question. Because the test assumes H0H_0, it pools the samples, pcp_c=x1+x2n1+n2= \frac{x_1 + x_2}{n_1 + n_2}, and checks large counts with pcp_c, along with two independent random samples (or random assignment) and the 10% condition.

Part 10 · Up next

What comes next

Part 11 · Connections

Connections