Confidence Interval for a Difference in Proportions
Many real questions compare two groups. Are British Columbia adults more likely than Quebec adults to own a bike? Does a text reminder make people more likely to get a flu shot? To answer them, you estimate the difference between two population proportions. This page extends the one-sample interval to two samples or two treatment groups.
Key ideas
Section titled “Key ideas”Notation for two groups
Section titled “Notation for two groups”| Group 1 | Group 2 | |
|---|---|---|
| Population proportion (unknown) | ||
| Sample size | ||
| Sample proportion |
The parameter is the difference , and its point estimate is . Always say which group is “1” and which is “2”: the sign of the difference depends on it.
The sampling distribution of the difference
Section titled “The sampling distribution of the difference”If you took many pairs of independent random samples and calculated each time, the values would form the sampling distribution of :
Notice the plus sign, even though it’s a difference. For independent samples, the variabilities add: two uncertain estimates give a more uncertain difference, never a less uncertain one. (Add the variances, the squares, then take the square root. Don’t add the standard deviations.)
The distribution is approximately normal if all four expected counts, , , , and , are at least .
The two-sample z-interval
Section titled “The two-sample z-interval”When and are unknown, replace them with the sample proportions to get the standard error. The two-sample z-interval for a difference between population proportions is
with the same critical values as before (, , for , , ).
The conditions
Section titled “The conditions”| Condition | Two independent random samples | A randomized experiment |
|---|---|---|
| Random | Two independent random samples from the two populations. | Treatments randomly assigned to the experimental units. |
| 10% | of population 1 and of population 2. | Not needed (no sampling without replacement from a population). |
| Large Counts | The observed successes and failures in both groups (, , , ) are all at least . | Same. |
“Independent” means the two samples don’t affect each other. Asking the same people two different questions does not give independent samples, so this procedure doesn’t apply.
Interpreting the interval
Section titled “Interpreting the interval”We are confident that the interval from to captures the true difference (group 1 minus group 2) in the proportions of [population] who [response].
The confidence level means the same as before: in repeated random sampling with the same sample sizes, about of intervals built this way would capture the true difference .
Does the interval show a difference?
Section titled “Does the interval show a difference?”Look at where is. A difference of means .
- All values positive: convincing evidence that .
- All values negative: convincing evidence that .
- Contains 0: no convincing evidence of a difference. Equal proportions are plausible, but so are the other values in the interval.
If the data come from a randomized experiment, an interval that excludes is evidence that the treatment causes a difference. With samples from two populations (an observational study), it shows a difference between the populations, not a cause.
On the AP exam
Section titled “On the AP exam”The formula sheet gives and . Use the same four parts as the one-sample interval: define in context (which minus which), name the procedure (two-sample z-interval for ), check conditions for both groups, and interpret in context. 2-PropZInt on a TI-84 checks your calculation.
Worked examples
Section titled “Worked examples”Example 1: The sampling distribution of the difference
Section titled “Example 1: The sampling distribution of the difference”In a large city, of downtown adults and of suburban adults use public transit at least once a week. A researcher takes independent random samples of downtown adults and suburban adults.
- (a) Find the mean and standard deviation of the sampling distribution of .
- (b) Find the probability that the downtown sample shows a lower proportion of transit users than the suburban sample.
Solution.
(a)
(b) Check the shape: , , , and are all at least , so the distribution is approximately normal. (Both samples are less than of large populations.)
“Downtown lower” means :
Even though downtown adults use transit more, about of pairs of samples would show the reverse, just by chance.
Example 2: An interval from two random samples
Section titled “Example 2: An interval from two random samples”In independent random samples, of British Columbia adults and of Quebec adults said they had ridden a bike in the past month. Construct and interpret a confidence interval for the difference in the proportions. Does it give convincing evidence of a difference?
Solution.
State. , where and are the true proportions of all BC adults and all Quebec adults who rode a bike in the past month. confidence.
Plan. Two-sample z-interval for .
- Random: independent random samples from each province.
- 10%: is less than of BC adults, and is less than of Quebec adults.
- Large Counts: , , , and are all at least .
Do. and .
Conclude. We are confident that the interval from to captures the true difference (BC minus Quebec) in the proportions of adults who rode a bike in the past month. Because every value is positive, the interval gives convincing evidence that a higher proportion of BC adults than Quebec adults rode a bike. (Just barely: the lower end is close to .)
Example 3: An interval from an experiment
Section titled “Example 3: An interval from an experiment”A clinic recruits volunteers and randomly assigns to get a text reminder about flu shots and to get no reminder. Of the reminder group, get a flu shot; of the no-reminder group, do. Construct and interpret a confidence interval for the difference in the proportions. What can the clinic conclude?
Solution.
State. , the true difference in the proportions of people like these volunteers who would get a flu shot with a text reminder and without one. confidence.
Plan. Two-sample z-interval for . Random: treatments were randomly assigned. (The 10% condition isn’t needed for an experiment.) Large Counts: , , , and are all at least .
Do. , .
Conclude. We are confident that the interval from to captures the true difference (reminder minus no reminder) in the proportions who would get a flu shot. The interval is entirely above , and the treatments were randomly assigned, so there is convincing evidence that text reminders cause an increase in flu-shot rates for people like these volunteers. Because they were volunteers, not a random sample, be careful about generalizing to everyone.
(At confidence the interval is , which just includes . Higher confidence makes the evidence look weaker here.)
Example 4: Reading calculator output
Section titled “Example 4: Reading calculator output”A student compares two large high schools. Using independent random samples, 2-PropZInt for (the proportions of students who bring a reusable water bottle to school) gives the interval .
- (a) Find the point estimate and margin of error.
- (b) Interpret the interval. Is there convincing evidence of a difference?
- (c) A friend says, “So the two schools have the same proportion.” Respond.
Solution.
(a) Point estimate: the midpoint, . Margin of error: half the width, .
(b) We are confident that the interval from to captures the true difference (School A minus School B) in the proportions of students who bring a reusable bottle. Because the interval contains , there is no convincing evidence that the proportions differ.
(c) Not necessarily. is plausible, but so is everything from School A being points lower to points higher. Failing to find a difference isn’t the same as showing there’s none.
Common mistakes
Section titled “Common mistakes”Subtracting in the standard error. It’s always under the square root. Variability adds, even for a difference.
Adding the two standard errors. is not . Add the two fractions first, then take one square root.
Not saying which minus which. An interval of means something completely different for than for . Define the parameter clearly and interpret the sign.
Treating “contains 0” as proof of no difference. It only means a difference of is plausible. Many non-zero differences are plausible too.
Using two-sample methods on paired data. If the same people answer two questions, or each person is matched with another, the samples aren’t independent. This interval would be wrong.
Claiming cause and effect from two samples. Only a randomized experiment supports “the treatment causes the difference”. Two random samples from two populations show an association.
Practice
Section titled “Practice”1. (Warm-up) In independent random samples, of Grade 11 students and of Grade 12 students at a large school board said they have a library card. Define the parameter and find the point estimate.
Solution
The parameter is , the difference in the true proportions of all Grade 11 and all Grade 12 students in the board who have a library card. The point estimate is .
2. (Warm-up) For the data in Question 1, find the standard error and a confidence interval for . (Assume the conditions are met.)
Solution
3. (Warm-up) A confidence interval for , the difference in the proportions of men and women in a province who listen to podcasts weekly, is . Interpret it, and say what it suggests about the two proportions.
Solution
We are confident that the interval from to captures the true difference (men minus women) in the proportions who listen to podcasts weekly. All values are positive, so it gives convincing evidence that a higher proportion of men than women in the province listen to podcasts weekly, by between and percentage points.
4. (Core) An outdoor-gear company surveys independent random samples of its customers in two regions. In the Prairies, of customers bought winter boots this year; in Atlantic Canada, of did. Construct and interpret a confidence interval for the difference in the proportions.
Solution
State. : the true difference in the proportions of all the company’s Prairie and Atlantic customers who bought winter boots this year. confidence.
Plan. Two-sample z-interval for . Independent random samples; each sample is less than of the company’s customers in that region (assuming each region has more than customers); successes and failures , , , are all at least .
Do. , .
Conclude. We are confident that the interval from to captures the true difference (Prairies minus Atlantic) in the proportions of customers who bought winter boots this year. Because all the values are positive, there is convincing evidence that a higher proportion of Prairie customers bought boots.
5. (Core) At a large university, of first-year students and of fourth-year students live in residence. Independent random samples of first-year and fourth-year students are taken.
- (a) Find the mean and standard deviation of .
- (b) Find the probability that the fourth-year sample has a higher proportion living in residence than the first-year sample.
Solution
(a) and
(b) Large Counts: , , , and are all at least , so the distribution is approximately normal.
6. (Core) A researcher wants a interval for the difference between the proportions of two small towns’ residents who own a boat. In a random sample of residents of Town A, own a boat; in a random sample of residents of Town B, do. Which condition fails? Why does it matter?
Solution
Large Counts fails: Town A has only successes, which is less than . (The other counts, , , and , are fine.) With so few successes, the sampling distribution of may not be approximately normal, so the interval and its confidence level may not be accurate. (The 10% condition should also be checked: each town would need at least and residents.)
7. (Core) A company randomly assigns new users of its app to one of two sign-up screens, each. With the new screen, users finish signing up; with the old screen, do. Construct and interpret a confidence interval for the difference in the proportions who finish (new minus old). Does it show that the new screen works better?
Solution
Random assignment; the 10% condition isn’t needed; , , , and are all at least .
, .
We are confident that the interval from to captures the true difference (new minus old) in the proportions of users like these who would finish signing up. The interval contains (just), so at confidence there is not convincing evidence that the new screen works better, although most of the plausible values favour it.
8. (Challenge) A confidence interval for is .
- (a) Find the standard error.
- (b) Find the confidence interval from the same data. Does it contain ?
Solution
(a) The point estimate is and the margin of error is , so .
(b) , which gives . It still contains , so even at confidence there’s no convincing evidence of a difference.
9. (Challenge) A researcher wants to estimate to within with confidence, using two samples of the same size . With no prior estimates, how large should be?
Solution
Use , the worst case:
So in each group. That’s about twice what one proportion needs for the same margin of error, because two estimates bring two sources of variability.
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, for both groups, and interpret your answers in context. Homework solutions are not provided on the published site.
All data in these questions are hypothetical.
Foundations
Section titled “Foundations”H1. (Foundations) For each study, say whether a two-sample z-interval for is appropriate. Explain.
- (a) A random sample of Winnipeg households and a separate random sample of Regina households are asked whether they have a backyard garden.
- (b) A random sample of students is asked whether they own a laptop and whether they own a tablet, to compare the two proportions.
- (c) volunteers are randomly assigned to two study methods, and the proportion who pass a test is recorded for each group.
H2. (Foundations) In a large province, of urban households and of rural households have high-speed internet. Independent random samples of urban and rural households are taken. Find the mean and standard deviation of , and check that its sampling distribution is approximately normal.
H3. (Core) In independent random samples, of Ontario homeowners and of Alberta homeowners said they had made an energy-saving upgrade in the past five years. Construct a confidence interval for the difference in the proportions (Ontario minus Alberta).
H4. (Core) For your interval in H3:
- (a) Interpret the interval in context.
- (b) Interpret the confidence level.
- (c) Does the interval give convincing evidence that the proportions differ? Can you conclude that something about Ontario causes more upgrades? Explain.
H5. (Core) Two large towns each have of residents who volunteer. Independent random samples of residents are taken from each town. Find the probability that the two sample proportions differ by more than in favour of the first town (that is, ).
H6. (Core) A fitness app randomly assigns new users to two onboarding styles. Of the who get a personalized plan, are still active after a month; of the who get the standard plan, are. Construct and interpret a confidence interval for the difference in the proportions (personalized minus standard). What can the company conclude?
Challenge
Section titled “Challenge”H7. (Challenge) A report gives a confidence interval of for , the difference in the proportions of two companies’ employees who work from home at least one day a week.
- (a) Find the point estimate and margin of error.
- (b) Give the interval for .
- (c) Interpret the interval for and state what it shows.
H8. (Challenge) A teacher asks a random sample of students two questions: “Do you play a sport?” ( yes) and “Do you play an instrument?” ( yes). She computes a two-sample z-interval for .
- (a) Explain why the two-sample interval is not appropriate.
- (b) Describe how she could design a study for which it would be appropriate.
H9. (Challenge) A researcher wants to estimate the difference between two proportions to within with confidence, using samples of equal size . Earlier studies suggest and . How large should each sample be? Compare with the size needed if she used for both.
H10. (Challenge) Two populations have the same proportion, . Independent random samples of the same size are taken from each.
- (a) Show that .
- (b) Find the smallest for which .
- (c) Explain what your answer says about seeing a -point gap between two samples when the populations are actually identical.