Significance Test for a Difference in Proportions
Does a new study method raise pass rates? Are Ontario students more likely than BC students to take a gap year? A confidence interval for a difference estimates how big a difference is. A two-sample z-test asks a sharper question: is the difference in the samples big enough to be convincing evidence of a real difference, or could chance alone explain it? The steps are the same as the one-sample test, with one new idea: the pooled proportion.
Key ideas
Section titled “Key ideas”Hypotheses: no difference
Section titled “Hypotheses: no difference”The null hypothesis says there is no difference between the two population (or treatment) proportions:
The alternative is one of
Define both parameters in context, and say which group is which. In AP Statistics, the null hypothesis for this test is always “no difference”.
The pooled proportion
Section titled “The pooled proportion”A test calculates everything assuming is true. If , the two groups have one common proportion, and the best estimate of it combines both samples:
This is the pooled (or combined) proportion. You can also find it as .
The test statistic
Section titled “The test statistic”Using for both groups in the standard error gives the two-sample z-test for a difference between population proportions:
The numerator is (statistic parameter) with the parameter from . If is true, has approximately a standard normal distribution, so the p-value comes from the normal table or 2-PropZTest, exactly as in the one-sample test.
Pooled for the test, unpooled for the interval
Section titled “Pooled for the test, unpooled for the interval”| Test of | Confidence interval for | |
|---|---|---|
| Assumes | nothing about and | |
| Standard error | (pooled) | (unpooled) |
| Large Counts uses | , , , | the observed successes and failures |
Both are on the formula sheet. Use the test to decide whether there’s a difference; use the interval to estimate how big it is. Usually they agree, but they use different standard errors, so they can disagree in borderline cases.
The conditions
Section titled “The conditions”- Random: two independent random samples, or a randomized experiment (treatments randomly assigned).
- 10%: for random samples, of population 1 and of population 2. Not needed for an experiment.
- Large Counts: , , , and are all at least .
Interpreting the p-value
Section titled “Interpreting the p-value”Assuming there is no difference between [the two proportions, in context], there is a [p-value] probability of getting a difference in sample proportions of [] or [more extreme, in the direction of ] by chance alone.
For an experiment, “by chance alone” means by the random assignment alone.
What can you conclude?
Section titled “What can you conclude?”How the data were produced decides what a significant result means:
| Treatments randomly assigned | Not randomly assigned | |
|---|---|---|
| Random sample from the population | Cause and effect, for the whole population | A difference (association) in the populations, not cause |
| Not a random sample | Cause and effect, but only for units like those in the study | Only a difference in these particular groups |
A randomized experiment on volunteers can show that a treatment causes a difference, but only for people like the volunteers. Two random samples from two populations let you generalize to those populations, but they can’t rule out other explanations (confounding variables).
On the AP exam
Section titled “On the AP exam”Use the same four parts as every test: hypotheses with both parameters defined in context; the procedure name (two-sample z-test for ) and conditions with the pooled counts; the test statistic and p-value; and a conclusion in context, in terms of . If the question asks, add what the design lets you conclude (cause? which population?). The p-values on this page come from technology using the unrounded test statistic, so the normal table can differ slightly in the last digit.
Worked examples
Section titled “Worked examples”Example 1: Hypotheses
Section titled “Example 1: Hypotheses”Define the parameters and write the hypotheses.
- (a) A researcher wonders whether the proportion of Grade 12 students planning a gap year is different in Ontario and British Columbia.
- (b) A teacher wants to know whether retrieval practice (self-quizzing) leads to a higher pass rate than rereading notes.
Solution.
(a) and are the true proportions of all Grade 12 students in Ontario and in BC who plan to take a gap year. , .
(b) and are the true proportions of students like these who would pass using retrieval practice and using rereading. , .
Example 2: Two independent random samples
Section titled “Example 2: Two independent random samples”In independent random samples, of Ontario Grade 12 students and of BC Grade 12 students said they plan to take a gap year. At , do the data give convincing evidence that the proportions differ?
Solution.
State. Hypotheses as in Example 1(a), with .
Plan. Two-sample z-test for .
- Random: independent random samples of students from each province.
- 10%: and are less than of Grade 12 students in each province.
- Large Counts: . Then , , , and are all at least .
Do. and .
Conclude. Because the p-value of is greater than , we fail to reject . There is not convincing evidence that the proportion of Grade 12 students planning a gap year is different in Ontario and BC.
(The interval for is , which contains , agreeing with the test.)
Example 3: A randomized experiment
Section titled “Example 3: A randomized experiment”A teacher randomly assigns student volunteers to two groups of . One group studies by retrieval practice and the other by rereading. On the unit test, of the retrieval group and of the rereading group pass. Do the data give convincing evidence at that retrieval practice leads to a higher pass rate?
Solution.
State. Hypotheses as in Example 1(b), with .
Plan. Two-sample z-test for . Random: the study methods were randomly assigned. (The 10% condition isn’t needed for an experiment.) Large Counts: , and and are at least for both groups.
Do. and .
Conclude. Because , we reject . There is convincing evidence that retrieval practice leads to a higher pass rate than rereading. Because the methods were randomly assigned, this is evidence that retrieval practice causes the higher pass rate, for students like these volunteers.
Example 4: Interpreting the p-value
Section titled “Example 4: Interpreting the p-value”Interpret the p-value from Example 3.
Solution. Assuming that retrieval practice and rereading have the same pass rate, there is a probability of getting a difference in pass rates of or higher (retrieval minus rereading) by the random assignment alone.
Common mistakes
Section titled “Common mistakes”Not pooling in the test. A test assumes : , so it uses one combined estimate in the standard error and in Large Counts. (The interval does the opposite: it doesn’t pool.)
Averaging the two sample proportions to pool. is total successes over total observations. That only equals when .
Writing hypotheses about p̂₁ and p̂₂. You know the sample proportions; the hypotheses are about the population (or true treatment) proportions and .
Claiming cause and effect without random assignment. Two random samples from two populations show a difference between the populations. Only a randomized experiment supports “causes”.
Generalizing an experiment to everyone. Random assignment doesn’t make volunteers representative. Conclusions apply to units like those in the study.
Getting the direction of Hₐ wrong. If you define the difference as and the claim is that group 2 is higher, is . Keep the order the same throughout.
Practice
Section titled “Practice”1. (Warm-up) Define the parameters and write the hypotheses: a city wants to know whether a smaller proportion of drivers speed in school zones with flashing signs than in school zones with ordinary signs.
Solution
and are the true proportions of all drivers who speed in school zones with flashing signs and with ordinary signs. , .
2. (Warm-up) In independent random samples, of customers at Store A and of customers at Store B used a coupon. Find the pooled proportion, check the Large Counts condition for a test, and find the test statistic for .
Solution
.
Large Counts: , , , and are all at least .
and :
3. (Warm-up) A two-sample z-test gives . Find the p-value for (a) , (b) , and (c) .
Solution
(a) .
(b) .
(c) .
4. (Core) A pollster takes independent random samples of adults in Calgary and in Edmonton. In Calgary, say they support a new arena tax; in Edmonton, do. At , is there convincing evidence that the proportions differ?
Solution
State. and : the true proportions of all Calgary and all Edmonton adults who support the arena tax. , , .
Plan. Two-sample z-test for . Independent random samples; each sample is less than of the city’s adults; , and and are at least for both cities.
Do. , .
Conclude. Because , reject . There is convincing evidence that the proportion of adults who support the arena tax is different in Calgary and Edmonton.
5. (Core) A hospital randomly assigns patients recovering from knee surgery to two physiotherapy programs, each. After six weeks, patients in the new program and in the standard program can climb stairs without pain. Do the data give convincing evidence at that the new program works better?
Solution
State. and : the true proportions of patients like these who could climb stairs without pain after six weeks with the new program and with the standard program. , , .
Plan. Two-sample z-test for . Random assignment; , and and are at least for both groups.
Do. , .
Conclude. Because , reject . There is convincing evidence that the new program leads to a higher proportion of patients climbing stairs without pain after six weeks. Since the programs were randomly assigned, the new program appears to cause the improvement, for patients like these.
6. (Core) For the study in Question 5:
- (a) Interpret the p-value in context.
- (b) Which type of error might the hospital have made? Describe it in context.
Solution
(a) Assuming the two programs have the same success rate, there is a probability of getting a difference in sample proportions (new minus standard) of or more by the random assignment alone.
(b) The hospital rejected , so a Type I error is possible: concluding that the new program works better when in fact the two programs have the same success rate.
7. (Core) For each design, say whether a significant result would support (i) cause and effect and (ii) generalizing to a larger population.
- (a) A random sample of Canadian teens is surveyed; those who play a team sport are compared with those who don’t on whether they report high stress.
- (b) volunteers are randomly assigned to two diets.
- (c) A random sample of adults is selected, and each is randomly assigned to one of two exercise plans.
Solution
(a) (i) No: team sport wasn’t assigned, so other variables could explain a difference. (ii) Yes: to Canadian teens, because it’s a random sample.
(b) (i) Yes: random assignment. (ii) No: volunteers aren’t a random sample, so only to people like these volunteers.
(c) (i) Yes: random assignment. (ii) Yes: to the population the adults were sampled from.
8. (Challenge) In independent random samples, of Grade 9 students and of Grade 12 students at a large board said they read for fun every week.
- (a) Test at whether the proportions differ.
- (b) Construct a confidence interval for .
- (c) Explain why (a) and (b) use different standard errors, and whether they agree here.
Solution
(a) , , . Large Counts: and for both groups. (Random samples; each is less than of a large board’s students in that grade.)
Since , reject : there is convincing evidence that the proportions of Grade 9 and Grade 12 students who read for fun weekly are different.
(b)
(c) The test assumes , so it pools the samples; the interval makes no such assumption, so it uses each sample’s own proportion. They agree here: the test rejects “no difference”, and the interval doesn’t contain .
9. (Challenge) Two groups of the same size have and . Find the smallest for which a test of against would be significant at .
Solution
With equal sizes, . Reject when :
So in each group. (Check: gives ; gives .)
Homework
Section titled “Homework”Try these independently after the practice questions. Show your setup and explain your reasoning. Check every condition with numbers and in context, and write every conclusion in context in terms of the alternative hypothesis. Homework solutions are not provided on the published site.
All data in these questions are hypothetical.
Foundations
Section titled “Foundations”H1. (Foundations) Define the parameters and write the hypotheses. Also say whether the study is an experiment or uses samples from two populations.
- (a) A nutrition researcher randomly assigns volunteers to a high-fibre or a regular breakfast and records whether each is still hungry two hours later. She thinks fewer people will be hungry after the high-fibre breakfast.
- (b) A survey compares the proportions of Nunavut and Yukon adults who hunt or fish for food, to see whether they differ.
H2. (Foundations) In independent random samples, of Halifax adults and of Moncton adults said they had taken a ferry in the past year. For a test of :
- (a) Find the pooled proportion and check Large Counts.
- (b) Find the test statistic and the p-value.
H3. (Core) In independent random samples, of Manitoba students and of Saskatchewan students said they walk or bike to school. At , is there convincing evidence that a higher proportion of Manitoba students walk or bike to school?
H4. (Core) A language-learning company randomly assigns new users to two versions of its first lesson, each. With a game-based lesson, users complete the course; with a video lesson, do. At , is there convincing evidence that the completion rates differ?
H5. (Core) For your test in H3:
- (a) Interpret the p-value in context.
- (b) Can you conclude that living in Manitoba causes students to walk or bike more? Explain.
H6. (Core) A student compared the proportions of urban and rural teens with a part-time job, using independent random samples of each: urban and rural teens had a job. Here is part of her write-up:
, .
, so and p-value .
Since , living in a city causes teens to be more likely to get a job.
- (a) Identify three errors.
- (b) Carry out the test correctly at and write a correct conclusion.
Challenge
Section titled “Challenge”H7. (Challenge) A calculator’s 2-PropZTest output for shows , , pooled , and . The two samples were the same size.
- (a) Find the sample size of each group (to the nearest whole number).
- (b) Find the p-value, and state the conclusion at .
H8. (Challenge) Two equal-sized groups have and . Find the smallest group size for which a test of against is significant at .
H9. (Challenge) A two-sided two-sample z-test gives a p-value of .
- (a) Would a confidence interval for from the same data be likely to contain ? What about a interval? Explain.
- (b) Why is the answer to (a) only “likely”?
H10. (Challenge) A coach randomly assigns swimmers, to a new starting technique and to the usual one. After a month, swimmers using the new technique and using the usual one have improved their start time.
- (a) Show that the Large Counts condition fails, so a z-test isn’t appropriate.
- (b) Instead, the coach writes the results ( “improved”, “not improved”) on cards, shuffles them, and deals them into two groups of , recording the difference in proportions improved (new minus usual). Explain why this simulates what would happen if the technique made no difference.
- (c) In shuffles, gave a difference of or more. Estimate the p-value and write a conclusion at .