Confidence Interval for Two Independent Means
Confidence interval for the difference of two independent means
What is being estimated
Two populations have means μ1 and μ2. You take an independent random sample from each, of sizes n1 and n2, and record the sample means x̄1, x̄2 and standard deviations s1, s2. The parameter of interest is the difference μ1 − μ2, and its point estimate is x̄1 − x̄2.
Independent samples are selected so that selection and measured outcomes in one sample do not determine or systematically relate to those in the other. Naturally paired or clustered observations require a method that accounts for that dependence.
Measuring the same subject before and after, pairing twins, and drawing both samples from the same households or classrooms all create that dependence; matched pairs call for a matched-pairs method, and distinct membership by itself does not make two samples independent.
The standard error of a difference
For independent samples, the variance of a difference is the sum of the two variances:
SE(x̄1 − x̄2) = √( s12/n1 + s22/n2 )
Add the variances of the two means, then take the square root. Adding the two standard errors directly overstates the uncertainty, because standard deviations do not add.
The interval
(x̄1 − x̄2) ± t* × SE
t* is the t critical value for the chosen confidence level. This unpooled (Welch) interval does not assume the two population standard deviations are equal. Two common ways to choose its degrees of freedom:
- Conservative: df = the smaller of n1 − 1 and n2 − 1. This gives a t* at least as large as the Welch choice; the resulting interval can be substantially wider when the smaller sample's s2/n contribution is small.
- Welch–Satterthwaite (software): df = (a + b)2 / [a2/(n1 − 1) + b2/(n2 − 1)], where a = s12/n1 and b = s22/n2. Rounding the result down is a cautious choice when using a table. This df always lies between the conservative value and n1 + n2 − 2.
Conditions
- Two independent random samples, or two groups formed by random assignment in an experiment.
- Each sample comes from a roughly normal population, or each sample is large enough for the central limit theorem to apply. Small samples should show no strong skew or outliers.
- When sampling without replacement, each sample should be less than about 10% of its population.
Worked example
Sample 1: n1 = 36, x̄1 = 52.0, s1 = 6.0. Sample 2: n2 = 49, x̄2 = 48.5, s2 = 7.0. Build a 95% interval with conservative df.
- Point estimate: 52.0 − 48.5 = 3.5.
- SE = √(36/36 + 49/49) = √(1 + 1) = √2 ≈ 1.414.
- df = smaller of 35 and 48 = 35, so t* ≈ 2.030.
- Margin of error = 2.030 × 1.414 ≈ 2.87.
- Interval: 3.5 ± 2.87, which is about (0.63, 6.37).
Interpreting the interval
- The interval gives plausible values for the difference in population means. "95% confidence" describes the method: in repeated sampling, about 95% of intervals built this way would contain the true μ1 − μ2.
- If the whole interval lies above 0 (or below 0), the data give evidence of a difference in that direction, which matches a two-sided test at the corresponding significance level. An interval that contains 0 means "no difference" is still a plausible value. It does not prove the means are equal.
- The interval says nothing about the range of individual values, and it describes sampling uncertainty only. It does not show that group membership causes the difference, unless the groups were formed by random assignment.
Independent random samples are taken from two populations.
- Sample 1: n1 = 40, s1 = 12
- Sample 2: n2 = 50, s2 = 15
What is the standard error of x̄1 − x̄2 used in the unpooled confidence interval?
A researcher builds a 95% confidence interval for μ1 − μ2 from independent samples of sizes n1 = 12 and n2 = 18, using the unpooled standard error and the conservative degrees-of-freedom rule. Which critical value should be used?