Confidence Intervals for
Differences
Learn to compute and interpret confidence intervals for the difference in means and proportions between two populations.
Why Compare Two Groups?
In biostatistics we rarely study a single population in isolation. We want to know: Is the new drug better than the placebo? Do males and females differ in blood pressure? These questions ask about the difference between two population parameters.
Key Terminology
Anatomy of a Confidence Interval
CI for Difference in Means
When both populations are approximately normal (or \(n\) is large):
CI for Difference in Proportions
When both samples are large enough for the normal approximation:
Means vs. Proportions: Key Differences
| Difference in Means | Difference in Proportions | |
|---|---|---|
| Parameter | \(\mu_1 - \mu_2\) | \(p_1 - p_2\) |
| Estimator | \(\bar{x}_1 - \bar{x}_2\) | \(\hat{p}_1 - \hat{p}_2\) |
| Distribution | \(t\)-distribution | Standard normal \(z\) |
| SE formula | \(\sqrt{s_1^2/n_1 + s_2^2/n_2}\) | \(\sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}\) |
| Data type | Quantitative (continuous) | Categorical (binary) |
Checking Conditions
Step-by-Step Procedure
Example 1: Difference in Means
A clinical trial compares systolic blood pressure in two groups. Drug group: \(n_1 = 40\), \(\bar{x}_1 = 126\), \(s_1 = 14\). Placebo group: \(n_2 = 35\), \(\bar{x}_2 = 134\), \(s_2 = 16\). Find a 95% CI for \(\mu_1 - \mu_2\).
Visualizing Example 1
Example 2: Difference in Proportions
A vaccine study: Vaccine group: 320 out of 4000 got sick (\(\hat{p}_1 = 0.08\)). Control group: 560 out of 4000 got sick (\(\hat{p}_2 = 0.14\)). Find a 95% CI for \(p_1 - p_2\).
Example 3: When the CI Contains Zero
Two study techniques are compared on exam scores. Group A: \(n_1 = 25\), \(\bar{x}_1 = 78\), \(s_1 = 10\). Group B: \(n_2 = 25\), \(\bar{x}_2 = 75\), \(s_2 = 12\). Find a 95% CI for \(\mu_A - \mu_B\).
Interpreting the Interval
Common Mistakes
Question 1 of 5
The general form of any confidence interval is:
Question 2 of 5
When constructing a CI for the difference in proportions, which critical value do you use?
Question 3 of 5
A 95% CI for \(\mu_1 - \mu_2\) is \((-4.2,\;1.8)\). What can we conclude?
Question 4 of 5
Given: \(\hat{p}_1 = 0.35\), \(n_1 = 200\), \(\hat{p}_2 = 0.28\), \(n_2 = 250\). What is the standard error for \(\hat{p}_1 - \hat{p}_2\)?
Question 5 of 5
Which condition must be checked for a CI for the difference in proportions but not for a CI for the difference in means?