Tests for the difference between two Normal means

Tests for the difference between two Normal means

Spec 5.4–5 · Edexcel A-Level Further Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Xˉ−Yˉ∼N(μx−μy, σx2nx+σy2ny)\bar X-\bar Y\sim N\left(\mu_x-\mu_y,\ \frac{\sigma_x^2}{n_x}+\frac{\sigma_y^2}{n_y}\right): variances add.
  • Under H0:μx=μyH_0:\mu_x=\mu_y, Z=Xˉ−Yˉσx2/nx+σy2/ny∼N(0,1)Z=\frac{\bar X-\bar Y}{\sqrt{\sigma_x^2/n_x+\sigma_y^2/n_y}}\sim N(0,1).
  • Hypotheses are about population means, not xˉ\bar x and yˉ\bar y.
  • Two-tailed critical values ±1.96\pm1.96 (5%); one-tailed 1.6451.645 (5%) and 2.3262.326 (1%).
  • With large samples, use s2s^2 in place of σ2\sigma^2 (Central Limit Theorem).

Distribution of the difference

It is Normal, with the means subtracted but the variances added.

Take independent samples from N(μx,σx2)\mathrm{N}(\mu_x,\sigma_x^2) and N(μy,σy2)\mathrm{N}(\mu_y,\sigma_y^2). Then Xˉ∼N(μx,σx2nx)\bar X\sim\mathrm{N}\left(\mu_x,\frac{\sigma_x^2}{n_x}\right) and Yˉ∼N(μy,σy2ny)\bar Y\sim\mathrm{N}\left(\mu_y,\frac{\sigma_y^2}{n_y}\right).

The difference of independent Normal variables is Normal: means subtracted, variances added.

−6−4−22468101214160.050.10.150.20.25xyX̄ȲX̄ − Ȳ
Illustrative: X̄ ~ N(10, 4), Ȳ ~ N(7, 5), so X̄ − Ȳ ~ N(3, 9): the means subtract and the variances add, giving a wider curve.
  • Meanmux−muymu_x-mu_y
  • Variancedfracsigmax2nx+dfracsigmay2nydfrac{sigma_x^2}{n_x}+dfrac{sigma_y^2}{n_y}

Xˉ∼N(10, 4)\bar X\sim N(10,\,4) and Yˉ∼N(7, 5)\bar Y\sim N(7,\,5) independent. What is the distribution of Xˉ−Yˉ\bar X-\bar Y?

The test with known variances

Standardise xˉ−yˉ\bar x-\bar y with the combined standard error and compare with a Normal critical value.

Under H0:μx=μyH_0:\mu_x=\mu_y the test statistic is Z=(Xˉ−Yˉ)−(μx−μy)σx2nx+σy2ny∼N(0,1)Z=\frac{(\bar X-\bar Y)-(\mu_x-\mu_y)}{\sqrt{\frac{\sigma_x^2}{n_x}+\frac{\sigma_y^2}{n_y}}}\sim\mathrm{N}(0,1) with μx−μy=0\mu_x-\mu_y=0. Hypotheses are always about population means.

  1. 1

    State hypotheses

    H0H_0 and H1H_1 in terms of μx,μy\mu_x,\mu_y

  2. 2

    Calculate zz

    using the combined standard error

  3. 3

    Compare

    critical value, or find the pp-value

  4. 4

    Conclude

    in context

The method

Worked example

nx=20n_x=20, σx2=9\sigma_x^2=9, xˉ=52.8\bar x=52.8; ny=30n_y=30, σy2=16\sigma_y^2=16, yˉ=51.2\bar y=51.2. Find the test statistic.

Which is a correct null hypothesis?

One-tailed and two-tailed tests

Choose from the wording: "differ" gives two-tailed, "greater" gives one-tailed.

"Differ" gives two-tailed H1:μx≠μyH_1:\mu_x\ne\mu_y, with the significance level split between both tails. "Greater" or "larger" gives one-tailed H1:μx>μyH_1:\mu_x>\mu_y.

For a two-tailed test double the tail probability to get the pp-value. Reject H0H_0 if p<p< the significance level. Write the conclusion as evidence, never proof: "insufficient evidence that ...".

−4−3−2−112340.10.20.30.4xy1.6451.96−1.96N(0, 1)
Standard normal: the shaded tail beyond 1.645 is the 5% one-tailed region; two-tailed uses 2.5% beyond each of ±1.96.

Two-tailed

Alternative:
H1:μx≠μyH_1:\mu_x\ne\mu_y
Critical value at 5%:
±1.96\pm1.96
Critical value at 1%:
±2.576\pm2.576

One-tailed

Alternative:
H1:μx>μyH_1:\mu_x>\mu_y
Critical value at 5%:
1.645
Critical value at 1%:
2.326

A question asks whether the mean of XX is "greater than" the mean of YY at the 5%5\% level. The critical value is...

Unknown variances, large samples

For large samples, use sx2s_x^2 and sy2s_y^2 in place of the population variances.

When variances are unknown, replace σx2\sigma_x^2 and σy2\sigma_y^2 by the sample variances. For large samples the Central Limit Theorem says Xˉ−Yˉ\bar X-\bar Y is approximately Normal even if the populations are not, and s2s^2 is close to σ2\sigma^2.

Quote the Central Limit Theorem and the large samples when you do this.

−3−2−11230.511.52xyPopulation (σ = 1)Sample mean, n = 4Sample mean, n = 25
Illustrative: for a population with σ = 1, the sample mean has a Normal distribution with standard deviation σ ÷ √n, narrower as n grows.
  • Variancesuse Sx2S_x^2 and Sy2S_y^2
  • StatisticZapproxN(0,1)Zapprox N(0,1)

Worked example

n1=60n_1=60, s12=18.4s_1^2=18.4, xˉ1=24.6\bar x_1=24.6; n2=75n_2=75, s22=22.5s_2^2=22.5, xˉ2=23.1\bar x_2=23.1. Test H0:μ1=μ2H_0:\mu_1=\mu_2 against H1:μ1≠μ2H_1:\mu_1\ne\mu_2 at 5%5\%.

Why can sample variances replace population variances in the test?

Try an exam question

Machine A fills 4040 bags with mean mass 12.412.4 kg and machine B fills 5050 bags with mean mass 11.911.9 kg. The population variances are known to be 1.61.6 and 2.02.0. Test, at the 5%5\% level, whether the mean for machine A is greater than the mean for machine B.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Find the standard error of Xˉ−Yˉ\bar X-\bar Y.

1 mark, marked against the mark scheme

Revision notes