Tutorials › VEE Mathematical Statistics › Why The Pooled Two-Sample t Interval Is Exact

VEE Mathematical Statistics · Intervals for Means · Tutorial 553 of 880

Why The Pooled Two-Sample t Interval Is Exact

See how the pooled variance and an independent Student t pivot produce an exact confidence interval for the difference between two population means.

Intermediate 10 min read

What You'll Learn

  • State the assumptions required for an exact pooled two-sample t interval.
  • Derive the pooled variance estimator from the two within-sample sums of squares.
  • Explain why its degrees of freedom are \(n_1+n_2-2\).
  • Establish the independence and distribution of the Student t pivot.
  • Distinguish exact coverage under the model from approximate coverage in other settings.
  • Identify common errors in pooling variances and assigning degrees of freedom.

Why Exactness Requires More Than a Familiar Formula

A pooled two-sample t interval is often introduced as a recipe: combine the two sample variances, calculate a standard error, and use a Student t critical value. The reason this procedure has exact coverage is more specific. It depends on normal samples, independence between the groups, and equal population variances. Under those assumptions, the pooled variance is a scaled chi-square variable that is independent of the difference between sample means. That combination produces a Student t pivot.

Here, “exact” means that the interval’s coverage probability is exactly the stated confidence level for every allowed value of the population means, when the model assumptions hold. It does not mean the calculated endpoints are exact values, or that the procedure has exact coverage for arbitrary populations.

Model and assumptions: Let \(X_{11},\ldots,X_{1n_1}\) be an independent random sample from \(N(\mu_1,\sigma^2)\), and let \(X_{21},\ldots,X_{2n_2}\) be an independent random sample from \(N(\mu_2,\sigma^2)\). Assume the two samples are independent of one another, the common variance \(\sigma^2\) is unknown, and \(n_1,n_2\geq 2\). Write \(\bar X_1,\bar X_2\) for the sample means and \(S_1^2,S_2^2\) for the usual unbiased sample variances.

How the Pooled Variance and Its Degrees of Freedom Arise

Each sample variance measures variation around its own sample mean. The corresponding within-sample sum of squares is \((n_i-1)S_i^2\), where \(i\) denotes group 1 or group 2. Since both populations have the same variance, the two sums of squares provide information about the same \(\sigma^2\). Adding them gives a combined estimate after dividing by the total number of independent within-group deviations.

$$ S_p^2 = \frac{(n_1-1)S_1^2+(n_2-1)S_2^2} {(n_1-1)+(n_2-1)} = \frac{(n_1-1)S_1^2+(n_2-1)S_2^2} {n_1+n_2-2}. $$

The weights are the groups’ degrees of freedom, not their sample sizes. Once a group mean has been estimated, only \(n_i-1\) independent deviations from that mean remain. Thus there are \((n_1-1)+(n_2-1)=n_1+n_2-2\) within-group degrees of freedom in total.

Definition: The pooled sample variance \(S_p^2\) is the degrees-of-freedom-weighted average of the two sample variances shown above. Under the stated model, \(S_p^2\) estimates the shared population variance \(\sigma^2\).

The weighting also follows from the sum of squares. Under normal sampling, each group’s within-sample sum of squares, divided by \(\sigma^2\), has a chi-square distribution with \(n_i-1\) degrees of freedom. The two sums are independent because the samples are independent. Independent chi-square variables add, with their degrees of freedom adding as well. Therefore:

$$ \frac{(n_1-1)S_1^2+(n_2-1)S_2^2}{\sigma^2} \sim \chi^2_{n_1+n_2-2}, \qquad \frac{(n_1+n_2-2)S_p^2}{\sigma^2} \sim \chi^2_{n_1+n_2-2}. $$

Why does each within-sample sum of squares have \(n_i-1\), rather than \(n_i\), degrees of freedom? In a normal sample, standardizing the observations gives a vector of independent standard normal variables. An orthogonal change of coordinates separates one coordinate in the direction of the sample mean from \(n_i-1\) coordinates describing deviations from that mean. The residual sum of squares is the sum of squares of those \(n_i-1\) independent standard normal coordinates, which is chi-square with \(n_i-1\) degrees of freedom. This also explains why estimating the sample mean uses one degree of freedom.

Worked Example: Combining Two Within-Sample Variances

A hypothetical laboratory compares the variability of processing times under two procedures. Independent normal samples have \(n_1=4\), \(S_1^2=6\), \(n_2=5\), and \(S_2^2=3\). Assume the two procedures have the same population variance. Find the pooled variance and its degrees of freedom.

Method. Weight each sample variance by its own degrees of freedom. Group 1 contributes \(n_1-1=3\) degrees of freedom, and group 2 contributes \(n_2-1=4\).

The weighted sum of squares is \((3)(6)+(4)(3)=18+12=30\). The total degrees of freedom are \(3+4=7\), equivalently \(4+5-2=7\). Thus \(S_p^2=30/7=4.285714\ldots\).

The pooled variance is \(4.286\) to three decimal places, with 7 degrees of freedom. The check is that its numerator, 30, is exactly the sum of the two within-group sums of squares, and its denominator is the total within-group degrees of freedom. A common mistake avoided here is taking the unweighted average \((6+3)/2\), which does not account for the different amounts of within-group information.

From the Pooled Variance to a Student t Pivot

The difference between the sample means has a normal distribution under the model. Independence of the samples gives its mean and variance:

$$ \bar X_1-\bar X_2 \sim N\!\left(\mu_1-\mu_2,\, \sigma^2\left(\frac{1}{n_1}+\frac{1}{n_2}\right)\right). $$

Consequently, if \(\sigma\) were known, standardizing this difference by its true standard deviation would give a standard normal variable. In the pooled procedure, \(\sigma\) is unknown and is replaced by \(S_p\). The replacement does not leave the standardized quantity normal: the random denominator contributes a chi-square component. The crucial fact is that this component is independent of the numerator’s normal component.

For normal samples, each sample mean is independent of the deviations of observations from that sample mean. Since the pooled variance is calculated only from those within-sample deviations, it is independent of both sample means, and hence independent of their difference. Combining this independence with the distributions just established gives the pivot:

$$ T = \frac{(\bar X_1-\bar X_2)-(\mu_1-\mu_2)} {S_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}} \sim t_{n_1+n_2-2}. $$

To see the Student t form directly, let \(Z\) be the standardized normal difference and let \(Q=(n_1+n_2-2)S_p^2/\sigma^2\). Then \(Z\) and \(Q\) are independent, \(Z\sim N(0,1)\), and \(Q\sim\chi^2_{n_1+n_2-2}\). The displayed pivot is \(Z/\sqrt{Q/(n_1+n_2-2)}\), which is the defining construction of a Student t variable.

Theorem: Under independent normal sampling with a common unknown variance, the pivot \(T\) has a Student t distribution with \(n_1+n_2-2\) degrees of freedom. For a two-sided confidence level \(1-\alpha\), inverting the central pivot event gives
$$ (\bar X_1-\bar X_2) \ \pm\ t_{1-\alpha/2,\,n_1+n_2-2}\, S_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}, $$

where \(t_{1-\alpha/2,\,\nu}\) is the \(1-\alpha/2\) quantile of a Student t distribution with \(\nu\) degrees of freedom. Specifically, the pivot lies between \(-t_{1-\alpha/2,\,\nu}\) and \(t_{1-\alpha/2,\,\nu}\) with probability \(1-\alpha\). Rearranging those two inequalities to isolate \(\mu_1-\mu_2\) produces the interval. Since the pivot’s distribution does not depend on the unknown means or the unknown common variance, the coverage is exactly \(1-\alpha\) under the model.

Worked Example: Exact 95% Interval From Small Samples

Two independent normal samples measure completion time, in minutes, under hypothetical scheduling methods. Assume a common population variance. Method 1 has observations \(8,10,12,10\); method 2 has observations \(13,16,16\). Construct the pooled 95% interval for \(\mu_1-\mu_2\). Use \(t_{0.975,5}=2.571\).

Method. Calculate both sample means and within-sample sums of squares, pool the variances, and then use the exact t pivot with \(n_1+n_2-2\) degrees of freedom.

For method 1, \(n_1=4\) and \(\bar X_1=(8+10+12+10)/4=40/4=10\). Its squared deviations sum to \((8-10)^2+(10-10)^2+(12-10)^2+(10-10)^2=4+0+4+0=8\). Thus \(S_1^2=8/(4-1)=8/3\).

For method 2, \(n_2=3\) and \(\bar X_2=(13+16+16)/3=45/3=15\). Its squared deviations sum to \((13-15)^2+(16-15)^2+(16-15)^2=4+1+1=6\). Thus \(S_2^2=6/(3-1)=3\).

The pooled variance is \[ S_p^2=\frac{(3)(8/3)+(2)(3)}{3+2} =\frac{8+6}{5} =\frac{14}{5}=2.8. \] The degrees of freedom are \(4+3-2=5\). The standard error is \[ \sqrt{2.8\left(\frac14+\frac13\right)} =\sqrt{2.8\left(\frac{7}{12}\right)} =\sqrt{\frac{49}{30}} =1.278019\ldots. \] The observed mean difference is \(10-15=-5\). The margin of error is \(2.571(1.278019\ldots)=3.285787\ldots\).

The interval is \(-5\pm3.285787\ldots\), or \((-8.286,-1.714)\) minutes to three decimal places. Its midpoint is \(-5\), as required, and its half-width is the calculated margin. The interval is exact only under the independent normal, equal-variance model stated in the problem; the calculation itself cannot establish those assumptions.

What Exactness Does—and Does Not—Promise

The pooled method’s exactness comes from the full chain of distributional facts: normality makes the mean difference normal and the within-group sums of squares chi-square; equal variances let those sums be combined into one scaled chi-square; and normal-sample independence makes the pooled variance independent of the mean difference. If any link fails, the stated Student t pivot is not established by this derivation.

In particular, if the population variances differ, the two within-group sums of squares are scaled by different variances. Their pooled combination is not generally a single chi-square variable scaled by one common variance, so the exact pivot above does not follow. Dependence between groups can also change the variance of the difference of sample means. For nonnormal populations, the finite-sample normal and chi-square results used here need not hold. The interval may sometimes be used as an approximation in other settings, but that is a different claim from exact coverage.

Worked Example: A 90% Interval and the Degrees-of-Freedom Check

Two independent normal samples come from populations with equal, unknown variances. For group 1, \(n_1=5\), \(\bar X_1=42\), and \(S_1^2=16\). For group 2, \(n_2=4\), \(\bar X_2=38\), and \(S_2^2=9\). Construct a two-sided 90% pooled interval, using \(t_{0.95,7}=1.895\).

Method. Use the weighted pooled variance and the Student t critical value with the sum of the two within-group degrees of freedom.

The degrees of freedom are \((5-1)+(4-1)=4+3=7\). The pooled variance is \[ S_p^2=\frac{(4)(16)+(3)(9)}{7} =\frac{64+27}{7} =\frac{91}{7}=13. \] The standard error is \[ \sqrt{13\left(\frac15+\frac14\right)} =\sqrt{13\left(\frac{9}{20}\right)} =\sqrt{5.85} =2.418677\ldots. \] The sample mean difference is \(42-38=4\), and the margin of error is \(1.895(2.418677\ldots)=4.583393\ldots\).

The 90% interval is \(4\pm4.583393\ldots\), or \((-0.583,8.583)\) to three decimal places. Zero lies in the interval. This calculation uses 7, not \(n_1+n_2=9\), degrees of freedom: each separately estimated sample mean costs one degree of freedom.

Common Exam Traps

  • Using an unweighted average. The pooled variance is not generally \((S_1^2+S_2^2)/2\). Each variance is weighted by its own \(n_i-1\).
  • Using the wrong degrees of freedom. The pooled t interval uses \(n_1+n_2-2\), not \(n_1+n_2\). There is one lost degree of freedom per sample because each sample mean is estimated.
  • Assuming equal sample sizes are required. They are not. The degrees-of-freedom weights handle different sample sizes.
  • Calling the result exact without its assumptions. Exact coverage here requires independent normal samples and a common population variance.

For instance, with \(n_1=4,n_2=3,S_1^2=8/3,S_2^2=3\), the incorrect unweighted average is \((8/3+3)/2=17/6\), not the correct pooled variance \(14/5\). Also, using 7 degrees of freedom rather than the correct 5 would select the wrong critical value. The corrected calculation weights by 3 and 2, divides by 5, and uses \(t_{1-\alpha/2,5}\). These are not cosmetic adjustments: the pooled variance and degrees of freedom are the pieces that make the pivot’s distribution exact.

Key takeaway: The pooled two-sample t interval is exact because the within-group sums of squares combine into an independent chi-square quantity with \(n_1+n_2-2\) degrees of freedom. Together with the normal difference of sample means, that quantity creates a Student t pivot.

Check Your Understanding

For numerical questions, assume the stated model conditions hold. Round interval endpoints to three decimal places.

  1. Independent normal samples with equal variances have \(n_1=4,S_1^2=9,n_2=3,S_2^2=4\). Find \(S_p^2\) and its degrees of freedom. (Answer: \(S_p^2=7\), 5 degrees of freedom.)
  2. Two independent normal samples have sizes \(8\) and \(6\) and a common unknown variance. What is the degrees of freedom for the pooled t pivot, and why? (Answer: 12, because \((8-1)+(6-1)=12\) within-sample degrees of freedom.)
  3. Independent equal-variance normal samples have \(n_1=n_2=5\), \(\bar X_1=12\), \(\bar X_2=9\), \(S_1^2=4\), and \(S_2^2=9\). Using \(t_{0.975,8}=2.306\), find the pooled 95% interval for \(\mu_1-\mu_2\). (Answer: \((-0.718,6.718)\).)
  4. Independent normal samples have a common unknown variance, \(n_1=4,n_2=5,\bar X_1=6,\bar X_2=4,S_1^2=4,S_2^2=9\). Using \(t_{0.975,7}=2.365\), calculate the pooled 95% interval. (Answer: \((-2.154,6.154)\).)
  5. Two samples are independent and normal, but their population variances are known to be unequal. Is the pooled pivot proved to have a Student t distribution with \(n_1+n_2-2\) degrees of freedom? Identify the failed step. (Answer: No; the two within-sample sums of squares are scaled by different variances, so their pooled sum is not generally one scaled chi-square variable.)
Clinical Biostats