All revision notes topics

Hypothesis tests for the difference between two meansEdexcel International A Level Further Maths: Revision notes

Section 1

Comparing two population means

Two independent random samples are taken, one from each of two populations, to test whether their means differ. Let XX have mean μx\mu_x and variance σx2\sigma_x^2, with sample size nxn_x and sample mean Xˉ\bar X, and similarly YY with μy\mu_y, σy2\sigma_y^2, nyn_y and Yˉ\bar Y. The hypotheses are H0:μx=μyH_0:\mu_x=\mu_y (or μx−μy=0\mu_x-\mu_y=0) against H1:μx≠μyH_1:\mu_x\neq\mu_y (two-tailed), or H1:μx>μyH_1:\mu_x>\mu_y or H1:μx<μyH_1:\mu_x<\mu_y (one-tailed). As always, the null hypothesis holds the equality and the hypotheses concern population means, not sample means. The statistic that is tested is the difference of the sample means, Xˉ−Yˉ\bar X-\bar Y.

Key termsindependent samplesdifference of means
Common mistake

Writing the hypotheses with xˉ\bar x and yˉ\bar y. They must use μx\mu_x and μy\mu_y.

Section 2

The distribution of Xˉ−Yˉ\bar X-\bar Y

If X∼N(μx,σx2)X\sim N(\mu_x,\sigma_x^2) and Y∼N(μy,σy2)Y\sim N(\mu_y,\sigma_y^2) are independent, then Xˉ∼N(μx,σx2nx)\bar X\sim N\left(\mu_x,\frac{\sigma_x^2}{n_x}\right) and Yˉ∼N(μy,σy2ny)\bar Y\sim N\left(\mu_y,\frac{\sigma_y^2}{n_y}\right), so 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). The means subtract but the variances add, because subtracting independent random variables does not remove any of the variability. The standard error of the difference is σx2nx+σy2ny\sqrt{\frac{\sigma_x^2}{n_x}+\frac{\sigma_y^2}{n_y}}. Example: σx=4\sigma_x=4, nx=20n_x=20, σy=5\sigma_y=5, ny=25n_y=25 gives variance 1620+2525=1.8\frac{16}{20}+\frac{25}{25}=1.8.

Key termsvariances addstandard error of the difference
Common mistake

Subtracting the variances. Variances always add, even for a difference.

Section 3

Carrying out the test (variances known)

Under H0H_0 (μx=μy\mu_x=\mu_y), the test statistic is Z=(Xˉ−Yˉ)−(μx−μy)σx2nx+σy2ny=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}}}=\frac{\bar X-\bar Y}{\sqrt{\frac{\sigma_x^2}{n_x}+\frac{\sigma_y^2}{n_y}}}\sim N(0,1). Compare zz with the critical value for the significance level and the tail(s): ±1.96\pm1.96 (two-tailed 5%5\%), 1.6451.645 or −1.645-1.645 (one-tailed 5%5\%), 2.3262.326 (one-tailed 1%1\%), ±2.576\pm2.576 (two-tailed 1%1\%). Worked example: fertilisers AA and BB, σA=2.1\sigma_A=2.1, σB=2.4\sigma_B=2.4, nA=30n_A=30, nB=40n_B=40, xˉA=14.6\bar x_A=14.6, xˉB=13.8\bar x_B=13.8, H1:μA>μBH_1:\mu_A>\mu_B. The variance of the difference is 0.147+0.144=0.2910.147+0.144=0.291, so z=0.80.539=1.48<1.645z=\frac{0.8}{0.539}=1.48<1.645. Do not reject H0H_0: insufficient evidence at the 5%5\% level that AA gives taller seedlings.

Key termstest statistic
Exam tip

Keep the order of the means the same as in H1H_1: for H1:μA<μBH_1:\mu_A<\mu_B use xˉA−xˉB\bar x_A-\bar x_B, which gives a negative zz when the result supports H1H_1.

Section 4

Large samples with unknown variances

When the population variances are not known, use the unbiased estimates sx2s_x^2 and sy2s_y^2. If both samples are large, the Central Limit Theorem makes Xˉ\bar X and Yˉ\bar Y approximately Normal (even if the populations are not Normal), and Sx2S_x^2, Sy2S_y^2 are close enough to σx2\sigma_x^2, σy2\sigma_y^2 that Z=(Xˉ−Yˉ)−(μx−μy)Sx2nx+Sy2ny≈N(0,1).Z=\frac{(\bar X-\bar Y)-(\mu_x-\mu_y)}{\sqrt{\frac{S_x^2}{n_x}+\frac{S_y^2}{n_y}}}\approx N(0,1). Example: stores PP and QQ with nP=60n_P=60, sP2=81s_P^2=81, nQ=50n_Q=50, sQ2=64s_Q^2=64, xˉP=42.5\bar x_P=42.5, xˉQ=39.8\bar x_Q=39.8. The variance is 8160+6450=2.63\frac{81}{60}+\frac{64}{50}=2.63 and z=2.71.622=1.66<1.96z=\frac{2.7}{1.622}=1.66<1.96, so there is insufficient evidence of a difference at the 5%5\% level. For small samples this approximation is not reliable, and a different distribution would be needed, which is not required here. Always state that the samples are large.

Key termslarge samplessample variance
Common mistake

Using sx2s_x^2 and sy2s_y^2 with small samples as though the result were exact. Large samples are needed for this method.

Section 5

Conclusions and assumptions

Give the conclusion in context and at the stated level: 'there is evidence that method AA gives a shorter mean time than method BB', or 'there is insufficient evidence that the mean masses differ'. Never claim that H0H_0 is proved. Assumptions to state or check: the samples are random and independent; for small samples the populations are Normal (and the variances known); for large samples the Central Limit Theorem is used. A test about means says nothing about every individual: some members of the population with the smaller mean may still exceed some members of the population with the larger mean. A result can be significant at 5%5\% but not at 1%1\%, so the level matters. If z=−2.37z=-2.37, the test is significant in a one-tailed test at 5%5\% (−1.645-1.645) and at 1%1\% (−2.326-2.326).

Key termssignificant
Exam tip

When asked to evaluate a conclusion, comment on the population versus individuals, the assumptions, and the strength of the evidence.

That's the notes covered.

Carry on to the next subtopic.

Exam questions on Hypothesis tests for the difference between two means

  1. Two machines, XX and YY, fill bags with sugar. The masses, in grams, are Normally distributed, with known standard deviations of 44 for machine XX and 55 for machine YY. A random sample of 2020 bags from XX has a mean mass of 502.1502.1 and a random sample of 2525 bags from YY has a mean mass of 499.8499.8. A test of H0:μX=μYH_0:\mu_X=\mu_Y against H1:μX≠μYH_1:\mu_X\neq\mu_Y is carried out at the 5%5\% significance level.
    Complete the test and state your conclusion in context.2 marks
  2. Seedlings are grown using either fertiliser AA or fertiliser BB. The heights are Normally distributed, with known standard deviations of 2.12.1 cm for AA and 2.42.4 cm for BB. A random sample of 3030 seedlings grown with AA has a mean height of 14.614.6 cm and a random sample of 4040 seedlings grown with BB has a mean height of 13.813.8 cm. A gardener wants to test, at the 5%5\% significance level, whether fertiliser AA gives a greater mean height than fertiliser BB.
    Carry out the test and state your conclusion in context.2 marks
  3. A supermarket chain compares customer spending at two stores, PP and QQ. A random sample of 6060 customers at PP spent a mean of £42.50 with sample variance 8181, and a random sample of 5050 customers at QQ spent a mean of £39.80 with sample variance 6464. The distributions of spending are not assumed to be Normal. The chain tests H0:μP=μQH_0:\mu_P=\mu_Q against H1:μP≠μQH_1:\mu_P\neq\mu_Q at the 5%5\% significance level.
    State the approximate distribution of XˉP−XˉQ\bar X_P-\bar X_Q under H0H_0, and justify why this distribution may be used.3 marks
See the full worksheet

Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).