4.2 - Pooled variance and the two-sample t-test

4.2 - Pooled variance and the two-sample t-test

Two independent samples can provide evidence about a difference between population means. You will combine their within-sample variation into a pooled estimate, identify when that estimate is justified, and carry out a two-sample t-test.

A pooled estimate

If one sample contains three observations and another contains nine, should their variance estimates receive equal weight? The larger sample contributes more independent deviations, so a simple average usually gives the wrong pooled estimate.

Within each sample, subtract that sample's own mean. A difference between the two sample means is the effect being investigated; it must not inflate the estimate of the common spread. If the populations share variance σ2\sigma^2, the first centred sum of squares estimates (n1−1)σ2(n_1-1)\sigma^2, and the second estimates (n2−1)σ2(n_2-1)\sigma^2. Add these and divide by their total degrees of freedom.

Pooled variance estimate

For samples of sizes n1,n2≥2n_1,n_2\ge2 from populations with a common variance,

sp2=∑(x−xˉ)2+∑(y−yˉ)2n1+n2−2=(n1−1)sx2+(n2−1)sy2n1+n2−2.s_p^2=\frac{\sum(x-\bar x)^2+\sum(y-\bar y)^2}{n_1+n_2-2} =\frac{(n_1-1)s_x^2+(n_2-1)s_y^2}{n_1+n_2-2}.

Here sx2,sy2s_x^2,s_y^2 are the separate unbiased variance estimates. The centred-sum formula is in the formula booklet, where the pooled estimate is denoted by s2s^2.

The subscript pp here distinguishes the pooled estimate from either separate estimate. Both are variances, so they use squared measurement units.

Worked example 1: pooling raw observations

Question. Two independent samples from populations with a common variance are 4,6,84,6,8 and 5,7,9,115,7,9,11. Calculate a pooled estimate of that variance.

Plan. Centre each sample separately, then pool the sums of squared deviations.

The sample means are 66 and 88, giving

Sx=(4−6)2+(6−6)2+(8−6)2=8Sy=(5−8)2+(7−8)2+(9−8)2+(11−8)2=20.\begin{aligned} S_x&=(4-6)^2+(6-6)^2+(8-6)^2=8 \\ S_y&=(5-8)^2+(7-8)^2+(9-8)^2+(11-8)^2=20. \end{aligned}

The two estimated means use two degrees of freedom, so

sp2=8+203+4−2=5.6.s_p^2=\frac{8+20}{3+4-2}=5.6.

Answer. The pooled variance estimate is 5.65.6.

Check. The separate estimates are 8/2=48/2=4 and 20/320/3. Their degrees-of-freedom weighted average is [2(4)+3(20/3)]/5=5.6[2(4)+3(20/3)]/5=5.6, between the two estimates.

Now change only the representation of the data. Raw sums require subtraction of each fitted mean's contribution before pooling.

Worked example 2: pooling summary data

Question. Samples with a common population variance have n1=3n_1=3, ∑x=18\sum x=18, ∑x2=116\sum x^2=116, and n2=4n_2=4, ∑y=32\sum y=32, ∑y2=276\sum y^2=276. Calculate the pooled variance estimate.

Plan. Recover each centred sum using ∑x2−(∑x)2/n\sum x^2-(\sum x)^2/n.

Sx=116−1823=8,Sy=276−3224=20.S_x=116-\frac{18^2}{3}=8, \qquad S_y=276-\frac{32^2}{4}=20.

Therefore

sp2=8+203+4−2=5.6.s_p^2=\frac{8+20}{3+4-2}=5.6.

Answer. sp2=5.6s_p^2=5.6.

Check. The raw observations in Worked example 1 have these exact sums and squares, so the two calculations must agree. Pooling about the overall mean would instead include variation between the sample means.

An arithmetic mean of the two unbiased variances works only when their degrees-of-freedom weights are equal, or when the estimates themselves coincide.

Independent normal samples

The pooled two-sample t-test needs more than two lists of numbers: the sampling design and population models determine whether its reference distribution is valid.

Use it for independent random samples from two normal populations whose variances are unknown but assumed equal. Independence is required within each sample and between the samples. Equal population variances do not mean equal sample variances: random samples from one common variance can produce different estimates.

The common-variance assumption concerns spread, not the means. The null hypothesis will usually set the means equal, but that is the claim being tested; it is not a reason to assume equal variances. If observations are naturally matched, such as two measurements on each person, the samples are paired and the next lesson's differences method is appropriate.

Worked example 3: identifying justified pooling

Question. Two laboratories select independent random samples of 8 and 10 components from separate production lines. Measurements are modelled by normal populations with a common unknown variance. Sample variance estimates are 44 and 55. Explain whether the pooled t model is justified by the stated information.

Plan. Check the population assumptions and sampling design rather than demanding identical observed variances.

The samples are independent random selections. Both population models are normal, and the common unknown variance is explicitly assumed. The unequal observed variance estimates do not contradict the assumption by themselves: each estimate varies between samples.

Answer. The stated conditions justify the pooled two-sample t model.

Check. The common variance could generate both sample estimates; the model never asserts that every realised sample has exactly the same spread.

Change the sampling design to matched measurements. The same sample sizes or similar spreads cannot restore independence between the two lists.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account