Actuarial Statistics · Confidence intervals and prediction intervals
Confidence Intervals for Two Samples: Means and Variances
Updated 11 October 2026 · Fact-checked
A two-sample confidence interval gives a range for the difference of two population means, or for the ratio of two population variances. For means, use a t interval with pooled variance (independent samples) or on the differences (paired samples). For variances, use the F distribution. Check the interval for 0 (means) or 1 (ratio).
Understand Confidence Intervals for Two Samples
A one-sample interval estimates one unknown parameter. A two-sample interval compares two populations. You want a range for the difference μx − μy, or for the ratio σx² ÷ σy². If a range for the difference of means excludes 0, the data suggest the means differ.
First decide whether the samples are paired or independent. Paired means each x is linked to a y, such as the same policyholder before and after a change. Then you take the differences and run a one-sample t interval on them. Independent means two unrelated groups, possibly of different sizes. Then you combine the two samples.
For independent normal samples with a common but unknown variance, you pool the two sample variances into one estimate, S_p². This is a weighted average, with weights equal to the degrees of freedom. The pivotal quantity then follows a t distribution with n + m − 2 degrees of freedom. This is why pooling is only valid when the variances are equal.
For the ratio of variances, (n−1)Sx²/σx² and (m−1)Sy²/σy² are independent chi-square variables. Dividing each by its degrees of freedom and taking the ratio gives an F distribution with (n−1, m−1) degrees of freedom. Inverting this gives an interval for σx²/σy². If the interval contains 1, the data do not rule out equal variances. That also supports the pooling assumption.
Throughout, assume the samples come from normal populations unless the question says the samples are large. State this assumption in your answer.
Key rules to remember
- Pooled variance
- S_p² = [(n − 1)Sx² + (m − 1)Sy²] ÷ (n + m − 2)
- Use only when the two population variances are assumed equal. n and m are the sample sizes.
- Independent samples, pooled t interval for μx − μy
- (x̄ − ȳ) ± t(n+m−2, 1−α/2) × S_p × √(1/n + 1/m)
- Degrees of freedom are n + m − 2. Normal populations with equal unknown variances.
- Paired samples interval for μd
- d̄ ± t(n−1, 1−α/2) × s_d ÷ √n, where dᵢ = xᵢ − yᵢ
- n is the number of pairs. s_d is the sample standard deviation of the differences.
- Known variances, or large samples
- (x̄ − ȳ) ± z(1−α/2) × √(σx²/n + σy²/m)
- For large samples with unknown variances, replace σ² by the sample variances and use the normal point as an approximation.
- Interval for the variance ratio σx²/σy²
- (sx²/sy²) ÷ F(α/2; n−1, m−1) to (sx²/sy²) × F(α/2; m−1, n−1)
- F(α/2; a, b) is the upper α/2 point with a numerator and b denominator degrees of freedom. Normal populations.
- Reciprocal property of F
- F(1−α/2; a, b) = 1 ÷ F(α/2; b, a)
- Lets you find the lower point from tables that list only upper points.
How to solve Confidence Intervals for Two Samples questions
Use this order for any two-sample interval question.
- 1Identify the parameter: μx − μy, the mean difference μd, or σx²/σy². Note the confidence level and the sample sizes.
- 2Decide paired or independent. If each observation in one sample has a natural partner in the other, the samples are paired.
- 3For paired data, form the differences, then compute d̄ and s_d. Use the one-sample t interval with n − 1 degrees of freedom.
- 4For independent means, check whether equal variances are stated or reasonable. If so, compute S_p² and use t with n + m − 2 degrees of freedom. If variances are known, use z.
- 5For a variance ratio, compute sx²/sy², then find both F points with the correct degrees of freedom order. Divide by the first, multiply by the second.
- 6Find the critical value at 1 − α/2, since the interval is two-sided. Compute the standard error and the margin of error.
- 7Write the interval to a sensible number of decimals, state the assumptions, and interpret it: does it contain 0 (means) or 1 (variance ratio)?
Quickest way: Pooled t interval in four lines
When to use it: Independent samples, normal populations, equal variances assumed, summary statistics given.
- Compute S_p² = [(n−1)Sx² + (m−1)Sy²] ÷ (n+m−2), then take the square root.
- Compute SE = S_p × √(1/n + 1/m).
- Read t at n+m−2 degrees of freedom and 1 − α/2, then margin = t × SE.
- Interval = (x̄ − ȳ) ± margin. Check whether it contains 0.
Common mistakes in Confidence Intervals for Two Samples
Using the independent-samples formula on paired data
Both samples look like two columns of numbers, so the pairing is overlooked.
Fix: Ask whether the observations are linked. If so, take differences and use a one-sample t interval with n − 1 degrees of freedom. Pairing removes variation between subjects.
Using n − 1 or m − 1 as the degrees of freedom for the pooled t
Students copy the one-sample rule.
Fix: The pooled t has n + m − 2 degrees of freedom, because two sample means are estimated.
Pooling variances without checking they are equal
The pooled formula is the one remembered, so it is applied by default.
Fix: State the equal-variance assumption. If the question gives variances that look very different, you may use the F interval to check. If the variances differ, do not pool; the question may call for an approximate method.
Swapping the degrees of freedom when finding the two F points
The upper limit uses the reversed order (m−1, n−1), which is easy to forget.
Fix: Lower limit divides by F(α/2; n−1, m−1). Upper limit multiplies by F(α/2; m−1, n−1). Write the two degrees-of-freedom pairs before reading tables.
Using the wrong tail point, such as the α point instead of α/2
One-tailed tables are confused with two-sided intervals.
Fix: For a 95% two-sided interval, use the 0.975 point of t, or the upper 0.025 point of F.
Concluding the means are equal because the interval contains 0
Treating a confidence interval like a proof.
Fix: Say the data give no evidence of a difference at that confidence level. Do not say the means are equal.
Worked examples
Example 1
Claims-processing times (in days) for two branches are assumed normal with equal variances. Branch X: n = 8, mean 45.2, variance 9.0. Branch Y: m = 10, mean 41.8, variance 12.0. Find a 95% confidence interval for μx − μy.
Show the solution
- The samples are independent, with equal variances assumed, so use the pooled t interval. Degrees of freedom = 8 + 10 − 2 = 16.
- S_p² = (7 × 9.0 + 9 × 12.0) ÷ 16 = (63 + 108) ÷ 16 = 171 ÷ 16 = 10.6875. So S_p = 3.2692.
- √(1/8 + 1/10) = √0.225 = 0.4743. SE = 3.2692 × 0.4743 = 1.5507.
- t(16, 0.975) = 2.120. Margin = 2.120 × 1.5507 = 3.288.
- Difference of means = 45.2 − 41.8 = 3.4. Interval = 3.4 ± 3.288.
Answer: (0.11, 6.69) days. It excludes 0, so there is evidence at the 95% level that Branch X takes longer on average.
Example 2
Two normal samples give n = 11 with sx² = 20 and m = 16 with sy² = 8. Find a 95% confidence interval for σx²/σy². Use F(0.025; 10, 15) = 3.06 and F(0.025; 15, 10) = 3.52 as upper 2.5% points.
Show the solution
- The ratio of sample variances is 20 ÷ 8 = 2.5. Degrees of freedom are (n−1, m−1) = (10, 15).
- Lower limit = 2.5 ÷ F(0.025; 10, 15) = 2.5 ÷ 3.06 = 0.817.
- Upper limit = 2.5 × F(0.025; 15, 10) = 2.5 × 3.52 = 8.80.
- The interval contains 1.
Answer: (0.82, 8.80). Because it contains 1, there is no evidence at the 95% level that the two variances differ, assuming normal populations.
Exam tips
- Write the assumption (normal populations, equal variances, independent samples) in one line. Marks are often given for this.
- Always state degrees of freedom before using tables. Tables are provided, but wrong degrees of freedom lose the answer mark.
- For the F interval, write both degrees-of-freedom pairs and which one goes with the lower and upper limit.
- In multiple-choice questions, check first whether the data are paired. The pooled formula is the usual trap.
- In the computer-based paper, show how the R output maps to the interval: the estimate, the standard error and the critical value. Interpret the result in words.
Practice questions from Confidence intervals and prediction intervals
- Ten paired observations of claim costs before and after a process change give differences (before minus after) with mean 12 and sample stand…
- Independent random samples of sizes 40 and 50 are taken from two normal populations with known standard deviations 6 and 8 respectively. The…
- A sample of n = 10 from a normal population has sample variance s^2 = 18. The chi-square(9) points are 2.700 (2.5%) and 19.023 (97.5%). What…
- A 95% confidence interval for a proportion based on a sample of size n is (0.30, 0.40). The same sample proportion is used, but the sample s…
- A normal population has known standard deviation 12. A 95% confidence interval for the mean is to have total width at most 6. Using z = 1.96…
Confidence Intervals for Two Samples in other exams
The same ground in other exams, if you are preparing for more than one or want another angle on it.
Confidence Intervals for Two Samples: frequently asked questions
When do I use a paired interval instead of a pooled interval?
Use paired when each observation in one sample is naturally matched with one in the other, such as the same person measured twice. This also needs equal sample sizes. Otherwise the samples are independent, and you use the pooled or unpooled approach.
Why is the pooled variance a weighted average?
Each sample variance is weighted by its degrees of freedom, n − 1 and m − 1. A larger sample carries more information about the common variance, so it gets more weight.
How do I find the lower F point if tables show only upper points?
Use the reciprocal property. The lower point with degrees of freedom (a, b) is 1 divided by the upper point with the degrees of freedom reversed, (b, a). In the interval form given here, you only need upper points.
What does it mean if the interval for the variance ratio contains 1?
It means the data are consistent with equal variances at that confidence level. It does not prove the variances are equal. It also supports the use of a pooled variance for comparing means.