In the last topic you learned how a difference of two sample proportions behaves when you know both true proportions. In real studies you know neither. You have two samples and want to estimate how far apart the populations are. A confidence interval for does that job, and it is built exactly like the interval for one proportion: an estimate plus or minus a margin of error.
The parts of the interval
Every confidence interval in this course has the same structure:
statistic (critical value) (standard error of the statistic)
For a difference of two proportions:
- The statistic is the sample difference, .
- The critical value comes from the standard normal distribution: 1.645 for 90%, 1.96 for 95%, 2.576 for 99%.
- The standard error is the standard deviation of with each unknown replaced by its sample proportion.
Put together, the two-sample z interval for is
Why the sample proportions in the standard error? Because we do not know and ; the whole point is to estimate them. The variances still add, just as in the last topic.
Conditions, in words, with numbers
- Random: two independent random samples, or two groups formed by random assignment in an experiment. Say which, in the words of the problem.
- 10%: when sampling without replacement, each sample is less than 10% of its population. (In an experiment with no sampling, this check is not needed.)
- Large counts: at least 10 successes and 10 failures in each sample: , , and are each at least 10. These are just the counts of yes and no answers in the data. Some books use 5; 10 is the common threshold.
Never check for proportions. That rule belongs to means.
A full example
Worked example. A transit agency takes a random sample of 400 city residents and a separate random sample of 300 suburban residents. In the city, 248 say they would ride a new train line (); in the suburbs, 162 do (). Construct and interpret a 95% confidence interval for .
Name the procedure and the parameter. A two-sample z interval for , where is the true proportion of all city residents who would ride the line and is the true proportion of all suburban residents who would.
Conditions. Random: the problem says two separate random samples. 10%: 400 is less than 10% of city residents and 300 is less than 10% of suburban residents. Large counts: 248, 152, 162 and 138 are each at least 10.
Calculate.
On a calculator this is a 2-proportion z interval; type the counts (248 of 400, 162 of 300) and the level.
Interpret. We are 95% confident that the interval from 0.006 to 0.154 captures the true difference in the proportions of all city residents and all suburban residents who would ride the new train line (city minus suburbs).
The figure shows the same interval as a bar around the estimate. Notice the phrase "(city minus suburbs)". A difference has an order, and a reader needs to know which group came first. Subtract the other way and every sign flips: the interval for is from to .
What "95% confident" means
The 95% describes the method, not this one interval. If the agency took many pairs of random samples of these sizes and built a 95% interval from each, about 95% of those intervals would capture the true difference. Our interval either captures it or does not; we just do not know which.
Three readings to avoid:
- "There is a 95% chance the true difference is in this interval." The true difference is a fixed number, not a random one.
- "95% of city residents ..." The interval is about one number for the whole population, never about individuals.
- Anything about the sample difference. We know it exactly: 0.08.
What changes the width
| Change | Effect on the margin of error | Why |
|---|---|---|
| Higher confidence level | wider | is larger |
| Larger samples | narrower | each divides a variance; four times the halves the SE |
| Proportions near 0.5 | wider | is largest at 0.5 |
Experiments: random assignment
The same interval works for an experiment that randomly assigns subjects to two treatments. Random assignment takes the place of two random samples. It also changes what you can conclude: a difference between the groups can be blamed on the treatment, a cause-and-effect conclusion. If the subjects were volunteers rather than a random sample, generalize only to subjects like them.