Difference between two means: pooled t-test

Difference between two means: pooled t-test

Spec 7.3 · Edexcel A-Level Further Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • The pooled tt-test compares two means from independent Normal samples with unknown but equal variances.
  • Pooled variance: s2=(nX−1)sx2+(nY−1)sy2nX+nY−2s^2=\frac{(n_X-1)s_x^2+(n_Y-1)s_y^2}{n_X+n_Y-2}.
  • T=Xˉ−YˉS1/nX+1/nY∼tnX+nY−2T=\frac{\bar X-\bar Y}{S\sqrt{1/n_X+1/n_Y}}\sim t_{n_X+n_Y-2}.
  • The degrees of freedom are nX+nY−2n_X+n_Y-2, for both the variance and the critical value.
  • Confidence interval: (xˉ−yˉ)±t s1nX+1nY(\bar x-\bar y)\pm t\,s\sqrt{\frac1{n_X}+\frac1{n_Y}}. If it contains 00, no evidence of a difference.

When it applies

For two independent Normal samples with unknown but equal variances.

Use the pooled tt-test to compare means μX\mu_X and μY\mu_Y from two independent random samples. The variances are unknown but assumed equal, and the populations must be Normal.

The common variance is estimated from both samples together, so the standardised difference follows a tt distribution, not a Normal.

−5−4−3−2−1123450.10.20.30.4xyt, 4 degrees of freedomStandard Normal
The t distribution (4 degrees of freedom, solid) has heavier tails than the Normal distribution (dashed)

Pooled test

  • Two independent samples
  • Variances equal, unknown

Paired test

  • Each value linked to one in the other sample
  • Take differences, one-sample test

Ten students sit a test before and after a revision course. Is the pooled test appropriate?

The pooled variance

Weight each sample variance by its degrees of freedom.

Combine the two unbiased sample variances, weighting each by its degrees of freedom. If you are given sums, use Sxx=∑x2−(∑x)2nS_{xx}=\sum x^2-\frac{(\sum x)^2}{n}, so s2=Sxx+SyynX+nY−2s^2=\frac{S_{xx}+S_{yy}}{n_X+n_Y-2}.

The pooled value always lies between the two sample variances, nearer to the one from the larger sample.

  1. 1

    Sample variances

    s_X² and s_Y²

  2. 2

    Weight by degrees of freedom

    (n_X − 1)s_X² and (n_Y − 1)s_Y²

  3. 3

    Add

    Combine both weighted values

  4. 4

    Divide by n_X + n_Y − 2

    This gives the pooled s²

Building the pooled variance
  • Pooled variances2=(nX−1)sx2+(nY−1)sy2nX+nY−2s^2=\dfrac{(n_X-1)s_x^2+(n_Y-1)s_y^2}{n_X+n_Y-2}

sx2=2.4s_x^2=2.4 with nX=6n_X=6, and sy2=3.1s_y^2=3.1 with nY=8n_Y=8. Which pooled value is plausible?

Statistic and degrees of freedom

Divide the difference of means by its estimated standard error; use nX+nY−2n_X+n_Y-2 degrees of freedom.

Under H0:μX=μYH_0:\mu_X=\mu_Y, T∼tnX+nY−2T\sim t_{n_X+n_Y-2}. More generally, (Xˉ−Yˉ)−(μX−μY)S1/nX+1/nY∼tnX+nY−2\frac{(\bar X-\bar Y)-(\mu_X-\mu_Y)}{S\sqrt{1/n_X+1/n_Y}}\sim t_{n_X+n_Y-2}.

One degree of freedom is lost for each sample mean estimated. The denominator is the estimated standard error of Xˉ−Yˉ\bar X-\bar Y.

−5−4−3−2−1123450.10.20.30.4xyt, 8 degrees of freedom
t distribution with 8 degrees of freedom: for a 5% two-tailed test the critical values are ±2.306, with 2.5% in each tail (upper tail shaded)
  • StatisticT=Xˉ−YˉS1nX+1nYT=\dfrac{\bar X-\bar Y}{S\sqrt{\frac1{n_X}+\frac1{n_Y}}}
  • Degrees of freedomnX+nY−2n_X+n_Y-2

Samples have sizes nX=6n_X=6 and nY=8n_Y=8. How many degrees of freedom does the pooled tt statistic have?

Carrying out the test

State the hypotheses, find s2s^2 then tt, compare with tnX+nY−2t_{n_X+n_Y-2}, and conclude in context.

State H0:μX=μYH_0:\mu_X=\mu_Y and H1H_1 (one-tailed or two-tailed). Find s2s^2, then tt. Find the critical value of tnX+nY−2t_{n_X+n_Y-2}, halving the level for two tails. Compare, and conclude about the real situation, not just "reject H0H_0".

  1. 1

    Hypotheses

    H0:μX=μYH_0:\mu_X=\mu_Y

  2. 2

    Pooled s2s^2

    weighted by degrees of freedom

  3. 3

    Calculate tt

    with the estimated standard error

  4. 4

    Compare and conclude

    critical value of tnX+nY−2t_{n_X+n_Y-2}

The pooled t-test

Worked example

nX=6n_X=6, xˉ=20.5\bar{x}=20.5, sx2=2.4s_x^2=2.4; nY=8n_Y=8, yˉ=18.9\bar{y}=18.9, sy2=3.1s_y^2=3.1. Test H1:μX>μYH_1:\mu_X>\mu_Y at 5%5\%.

The test statistic is 1.771.77 and the critical value is 1.7821.782. What is the conclusion?

Interval for the difference

Use (xˉ−yˉ)±t s1nX+1nY(\bar x-\bar y)\pm t\,s\sqrt{\frac1{n_X}+\frac1{n_Y}} with the two-tailed critical value.

The tt value is the two-tailed critical value (for 95%95\%, the upper 2.5%2.5\% point).

If the interval contains 00, there is no evidence of a difference in means at the matching significance level. If it does not, there is.

−2−1.5−1−0.500.511.522.533.544.55-0.3701.63.57

Worked example

Using the data from the worked example, find a 95%95\% confidence interval for μX−μY\mu_X-\mu_Y, given t12=2.179t_{12}=2.179.

A 95%95\% interval for μX−μY\mu_X-\mu_Y is (0.4, 3.1)(0.4,\ 3.1). What does it suggest?

Try an exam question

Two independent random samples from Normal populations with equal variances give: nX=10n_X=10, xˉ=45.2\bar x=45.2, sx2=6.0s_x^2=6.0; nY=12n_Y=12, yˉ=42.1\bar y=42.1, sy2=5.0s_y^2=5.0. Test, at the 5%5\% level, whether μX>μY\mu_X>\mu_Y. The upper 5%5\% point of t20t_{20} is 1.7251.725.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

How many degrees of freedom does the tt statistic for testing the difference between the two population means have?

1 mark, marked against the mark scheme

Revision notes