Confidence Interval for Difference of Two Means (Equal Variances)
Use this calculator for the confidence interval of the difference between two population means when sample standard deviations are unknown but assumed equal (pooled method).
When to Use This Calculator
- Two independent samples from two different populations
- Sample standard deviations are unknown (estimated from samples)
- Equal population variances can be assumed (test with Levene’s test first)
- Comparing means between two groups
- Most common scenario for comparing averages
How to Use This Calculator
Step 1: Enter both sample means (x̄₁ and x̄₂)
Step 2: Enter both sample sizes (n₁ and n₂)
Step 3: Enter both sample standard deviations (s₁ and s₂)
Step 4: Select confidence level (typically 95%)
Step 5: Click “Calculate”
| Confidence Interval Calculator for Difference between means | ||
|---|---|---|
| Sample 1 | Sample 2 | |
| Sample Mean | ||
| Sample Size | ||
| Standard Deviation | ||
| Confidence Level ($1-\alpha$) | ||
| Results | ||
| Standard Error of Diff. of Means: | ||
| Degrees of Freedom: | ||
| t-critical value: ($t_{\alpha/2,df}$) | ||
| Margin of Error: ($E$) | ||
| Lower Confidence Limits: | ||
| Upper Confidence Limits: | ||
Theory & Formula
$$CI = (\overline{x}_1 - \overline{x}2) \pm t{\alpha/2, df} \times s_p\sqrt{\frac{1}{n_1} + \frac{1}{n_2}}$$
Where:
- $s_p = \sqrt{\frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1+n_2-2}}$ = pooled standard deviation
- $df = n_1 + n_2 - 2$ = degrees of freedom
Assumptions
- Independent samples - two distinct groups
- Equal population variances - σ₁ = σ₂ (test with Levene’s test)
- Normal populations or large samples - n₁, n₂ ≥ 30 or approximately normal
- Random samples - no systematic bias
Worked Example
Scenario: Testing if two manufacturing processes produce different average output. Process A (n₁=20, x̄₁=95, s₁=8) vs Process B (n₂=20, x̄₂=88, s₂=9).
Solution:
- Pooled SD: $s_p = \sqrt{\frac{19(64) + 19(81)}{38}} = 8.51$
- SE: $\sqrt{\frac{8.51^2}{20} + \frac{8.51^2}{20}} = 2.70$
- For 95% CI, df=38, $t_{0.025,38} = 2.024$
- E = 2.024 × 2.70 = 5.46
- CI = (95-88) ± 5.46 = 7 ± 5.46 = [1.54, 12.46]
Interpretation: We’re 95% confident that Process A produces 1.54 to 12.46 units more on average than Process B.
When variances are unequal: Use Welch’s method
Related: Tutorial