01 / 21

Confidence Interval for
Difference of Means

Learn how to construct and interpret confidence intervals that estimate how far apart two population means truly are: \( \mu_1 - \mu_2 \).

College Statistics

What Are We Estimating?

In many real-world studies we compare two independent groups: a treatment vs. a control, men vs. women, or two different brands. The quantity we care about is the true difference in population means:

$$ \mu_1 - \mu_2 $$

Key Vocabulary

Point Estimate
The single best guess: \(\bar{x}_1 - \bar{x}_2\). It sits at the center of the interval.
Margin of Error
How far the interval extends from the center: \(t^* \cdot SE\). Captures sampling variability.
Standard Error
Measures the spread of \(\bar{x}_1 - \bar{x}_2\): \(\displaystyle SE = \sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}\).

Visual Intuition

\(\mu_1\)
\(\mu_2\)
\(\mu_1 - \mu_2\)
Population 1 Population 2

The Core Formula

$$ (\bar{x}_1 - \bar{x}_2) \;\pm\; t^*\,\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}} $$
\(\bar{x}_1 - \bar{x}_2\)
Point estimate: difference of sample means.
\(t^*\)
Critical value from the \(t\)-distribution at the chosen confidence level.
\(SE\)
Standard error: \(\sqrt{s_1^2/n_1 + s_2^2/n_2}\).

Required Conditions

1
Random: Both samples are collected via a random process (random sampling or random assignment).
2
Independent: The two samples are independent of each other. Within each sample, observations are independent. If sampling without replacement, check the 10% condition: \(n_1 \leq 0.10\,N_1\) and \(n_2 \leq 0.10\,N_2\).
3
Normal/Large Sample: Each population is approximately normal, or each sample size is large enough (\(n_1 \geq 30\) and \(n_2 \geq 30\)) for the CLT to apply.

Degrees of Freedom

The \(t^*\) critical value depends on degrees of freedom. For two independent samples with unequal variances, the Welch approximation is used:

$$ df = \frac{\left(\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}\right)^2}{\frac{(s_1^2/n_1)^2}{n_1-1}+\frac{(s_2^2/n_2)^2}{n_2-1}} $$

One-Sample vs. Two-Sample

One-Sample CI Two-Sample CI
Parameter \(\mu\) \(\mu_1 - \mu_2\)
Point Estimate \(\bar{x}\) \(\bar{x}_1 - \bar{x}_2\)
Standard Error \(\displaystyle\frac{s}{\sqrt{n}}\) \(\displaystyle\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}\)
df (conservative) \(n - 1\) \(\min(n_1-1,\,n_2-1)\)
Interpretation Range for single mean Range for difference

How to Apply It

1
Check conditions: Verify Random, Independent, and Normal/Large Sample for both groups.
2
Compute the point estimate: \(\bar{x}_1 - \bar{x}_2\).
3
Calculate the standard error: \(SE = \sqrt{s_1^2/n_1 + s_2^2/n_2}\).
4
Find \(t^*\): Use df from Welch or the conservative method, then look up \(t^*\) for your confidence level.
5
Build the interval: \((\bar{x}_1 - \bar{x}_2) \pm t^* \cdot SE\). Then interpret in context.

Example 1: Study Hours

A researcher randomly samples 35 science majors (\(\bar{x}_1 = 18.2\) hrs/week, \(s_1 = 4.5\)) and 40 humanities majors (\(\bar{x}_2 = 14.6\) hrs/week, \(s_2 = 5.1\)). Construct a 95% CI for \(\mu_1 - \mu_2\).

Example 1: Finishing Up

Example 2: Battery Life

Brand A: \(n_1 = 25\), \(\bar{x}_1 = 310\) min, \(s_1 = 28\) min. Brand B: \(n_2 = 30\), \(\bar{x}_2 = 298\) min, \(s_2 = 32\) min. Build a 90% CI for \(\mu_A - \mu_B\).

1
Point estimate: \(310 - 298 = 12\) min
2
SE: \(\sqrt{\frac{28^2}{25} + \frac{32^2}{30}} = \sqrt{31.36 + 34.13} \approx 8.09\)
3
\(t^*\): Conservative \(df = 24\), 90% confidence: \(t^* \approx 1.711\)
4
Interval: \(12 \pm 1.711 \times 8.09 = 12 \pm 13.84 = \) (-1.84, 25.84)

Does the Interval Contain Zero?

0 (1.35, 5.85) Ex 1 (-1.84, 25.84) Ex 2
0 not in interval
Evidence of a real difference. The sign of both endpoints tells you which mean is larger.
0 is in interval
No convincing evidence the means differ. The true difference could be zero.

Example 3: Small Samples

A pilot study compares reaction times. Group A: \(n_1 = 12\), \(\bar{x}_1 = 0.42\) s, \(s_1 = 0.08\). Group B: \(n_2 = 10\), \(\bar{x}_2 = 0.51\) s, \(s_2 = 0.10\). Build a 99% CI.

1
Check Normal condition: Small samples, so we need each population to be roughly normal (no strong skew or outliers).
2
Point estimate: \(0.42 - 0.51 = -0.09\) s
3
SE: \(\sqrt{0.08^2/12 + 0.10^2/10} = \sqrt{0.000533 + 0.001} \approx 0.0392\)
4
\(t^*\): \(df = \min(11, 9) = 9\), 99% CI: \(t^* \approx 3.250\). Interval: \(-0.09 \pm 0.127 = \) (-0.217, 0.037)

Common Mistakes

✕ Pooling Variances
Using a pooled \(s_p\) when you should use separate \(s_1\) and \(s_2\). Only pool when you have strong reason to assume \(\sigma_1 = \sigma_2\).
✕ Subtracting SE
Calculating \(SE_1 - SE_2\) instead of combining variances under the square root. Variances add: you never subtract them.
✕ Using \(z^*\) Instead of \(t^*\)
Unless both \(n\) are very large and \(\sigma\) is known, always use the \(t\)-distribution.

Quick Reference Summary

Component Formula / Value Notes
Point Estimate \(\bar{x}_1 - \bar{x}_2\) Center of the interval
Standard Error \(\sqrt{s_1^2/n_1 + s_2^2/n_2}\) Variances add, not SE
Critical Value \(t^*\) from \(t\)-table Use Welch or conservative df
Interval \((\bar{x}_1-\bar{x}_2)\pm t^*\cdot SE\) Always interpret in context
Contains 0? Check both endpoints If yes: no evidence of difference

Question 1 of 5

What is the point estimate in a confidence interval for the difference of two means?

Question 2 of 5

Given \(s_1 = 6\), \(n_1 = 36\), \(s_2 = 8\), \(n_2 = 64\). What is the standard error \(SE\)?

Question 3 of 5

A 95% CI for \(\mu_1 - \mu_2\) is (2.1, 8.7). Which interpretation is correct?

Question 4 of 5

If a 90% CI for \(\mu_1 - \mu_2\) is (-3.2, 1.8), what can we conclude?

Question 5 of 5

Using the conservative method, what are the degrees of freedom when \(n_1 = 20\) and \(n_2 = 15\)?