A-Level Further Maths 9231 / Topic 4.2 / AS & A Level
Same subjects twice? Test the differences.
When every value in one sample is matched to a value in the other (the same people before and after, twins, the same plots with two fertilisers), the samples are not independent. Turn each pair into one difference and run a one-sample t-test on those differences. Then build confidence intervals for a difference of means, with a t-distribution for small samples and a normal distribution for large ones, and read off whether 0 or a claimed difference is plausible.
Paired data (two measurements on the same subject or on matched subjects) are analysed through the differences \(d\). With \(n\) pairs, \(\bar{d}\) and the unbiased variance \(s_{d}^{2}\) of the differences, test \(H_{0}: \mu_{d} = k\) with \[t = \dfrac{\bar{d} - k}{s_{d}/\sqrt{n}}, \quad n - 1 \text{ degrees of freedom},\] assuming the differences are normally distributed. For two independent samples, a confidence interval for \(\mu_{x} - \mu_{y}\) is \((\bar{x} - \bar{y}) \pm t\,s_{p}\sqrt{\tfrac{1}{n_{x}} + \tfrac{1}{n_{y}}}\) with \(n_{x} + n_{y} - 2\) degrees of freedom, or \((\bar{x} - \bar{y}) \pm z\sqrt{\tfrac{s_{x}^{2}}{n_{x}} + \tfrac{s_{y}^{2}}{n_{y}}}\) when both samples are large.
Fig. 1: eight students' scores before and after a revision course, each pair joined by a line (green for a rise, orange for a fall). The two columns overlap a lot because students differ, but almost every line rises. Working with the differences d = after - before removes the student-to-student variation: the eight differences have mean 3, and the 95% interval for the mean difference, 1.10 to 4.90, does not contain 0
Section 01
The paired sample t-test.
Two samples are paired when each value in one is naturally linked to exactly one value in the other: the same person measured before and after a treatment, the left and right hand of the same person, two methods applied to the same specimen, or twins split between two groups. Paired values are not independent (a strong student scores well both times), so the two-sample test does not apply. Instead, take the difference \(d\) for each pair, in the same order every time, and treat the \(n\) differences as ONE sample from a population with mean \(\mu_{d}\). The two samples must therefore be the same size.
The test is then exactly the one-sample t-test of the previous lessons, applied to the differences:
Usually \(k = 0\) (no change), but a claim such as 'the course raises scores by more than 2 marks on average' gives \(H_{0}: \mu_{d} = 2\), \(H_{1}: \mu_{d} \gt 2\). The assumption is that the population of DIFFERENCES is normal; the two original populations need not be. State the hypotheses with \(\mu_{d}\) defined in words, including which way round the difference is taken.
Worked example Before and after
Eight students sat a test before and after a revision course. Their scores were:
Student
A
B
C
D
E
F
G
H
Before
52
61
47
70
58
64
49
55
After
55
60
51
72
63
65
55
59
Test, at the 5% significance level, whether the course increases the mean score. State a necessary assumption.
With 7 degrees of freedom, the one-tailed 5% critical value is \(t_{7}(0.95) = 1.895\). Since \(3.742 \gt 1.895\), reject \(H_{0}\).
There is sufficient evidence at the 5% level that the course increases the mean score. Assumption: the differences in score are normally distributed.
Answer: \(t = 3.74 \gt 1.895\): sufficient evidence at the 5% level that the mean score increases; assume the differences are normal
Worked example Testing a claimed difference
A slimming plan claims that users lose more than 2 kg in a month on average. Ten users' weight losses \(d\) kg (start minus end) give \(\sum d = 31\) and \(\sum d^{2} = 129\). Test the claim at the 5% significance level.
\(t_{9}(0.95) = 1.833\). Since \(1.819 \lt 1.833\), do not reject \(H_{0}\).
There is insufficient evidence at the 5% level that the mean loss is more than 2 kg (assuming the losses are normally distributed). The sample mean of 3.1 kg is above 2, but with only ten users it is not far enough above to support the claim.
Answer: \(t = 1.82 \lt 1.833\): insufficient evidence at the 5% level that the mean loss exceeds 2 kg
Your turn
Sixteen pairs give differences with \(\bar{d} = 1.8\) and \(s_{d} = 2.4\). Test \(H_{0}: \mu_{d} = 0\) against \(H_{1}: \mu_{d} \ne 0\) at the 5% level.
\(t = \dfrac{1.8}{2.4/4} = 3.0\). With 15 degrees of freedom the two-tailed 5% critical value is \(t_{15}(0.975) = 2.131\). Since \(3.0 \gt 2.131\), reject \(H_{0}\): there is sufficient evidence at the 5% level that the population mean difference is not zero.
Examiner trap
Do not treat paired data as two independent samples. For the scores above, the before and after columns each vary by more than 20 marks between students, so a two-sample test sees a mean gap of 3 buried in that spread and finds nothing. Pairing removes the student-to-student variation, which is the whole point. Also use \(n - 1\) degrees of freedom where \(n\) is the number of PAIRS (7 here), not \(2n - 2\).
Stage 1 · Learn
Check your understanding
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
Which of these produces PAIRED data?
Quick check+10 XP
A paired sample t-test uses 12 pairs. How many degrees of freedom does the t-distribution have?
Quick check+10 XP
Nine pairs give \(\bar{d} = 2.5\) and \(s_{d} = 3\). What is the test statistic for \(H_{0}: \mu_{d} = 0\)?
Quick check+10 XP
A pooled two-sample t confidence interval uses samples of sizes 7 and 9. How many degrees of freedom are used?
Section 02
Confidence intervals for a difference.
A confidence interval answers 'how big is the difference?', not just 'is there one?'. For paired data it is the one-sample t interval for \(\mu_{d}\). For two independent samples from normal populations with a common (unknown) variance, pool the variances as in the two-sample t-test and use \(n_{x} + n_{y} - 2\) degrees of freedom.
For a 95% interval use the value that cuts off 2.5% in EACH tail, \(t(0.975)\); for 90%, \(t(0.95)\); for 99%, \(t(0.995)\). If the interval contains 0, the data are consistent with no difference (a two-tailed test at the matching level would not reject \(\mu_{x} = \mu_{y}\)); if it lies entirely above or below 0, they are not.
Worked example Interval from paired data
Using the eight students' differences from the first example (\(\bar{d} = 3\), \(s_{d} = 2.268\)), find a 95% confidence interval for the population mean increase in score.
7 degrees of freedom, two-tailed: \(t_{7}(0.975) = 2.365\).
Standard error \(\dfrac{s_{d}}{\sqrt{n}} = \dfrac{2.268}{\sqrt{8}} = 0.8018\).
\[3 \pm 2.365 \times 0.8018 = 3 \pm 1.896.\]
The interval is \(1.10 \lt \mu_{d} \lt 4.90\). It lies wholly above 0, consistent with the test that found an increase.
Answer: \((1.10,\ 4.90)\)
Worked example Pooled two-sample interval
Six plants grown with fertiliser A had mean height 24.5 cm with \(s_{x}^{2} = 4.3\); eight plants grown separately with fertiliser B had mean height 21.8 cm with \(s_{y}^{2} = 5.1\) (unbiased estimates). Assuming normal populations with a common variance, find a 95% confidence interval for \(\mu_{A} - \mu_{B}\) and comment.
These are two independent samples (different plants), so pool: \[s_{p}^{2} = \dfrac{5 \times 4.3 + 7 \times 5.1}{12} = \dfrac{57.2}{12} = 4.767, \quad s_{p} = 2.183.\]
\(\sqrt{\tfrac{1}{6} + \tfrac{1}{8}} = 0.5401\), so the standard error is \(2.183 \times 0.5401 = 1.179\).
Interval \(0.131 \lt \mu_{A} - \mu_{B} \lt 5.27\). It lies just above 0, so the data suggest A gives taller plants on average, but the difference could be as small as about 0.1 cm.
Answer: \((0.131,\ 5.27)\) cm; 0 lies just outside, so the data support a positive difference
Your turn
Ten pairs give \(\bar{d} = 2.6\) and \(s_{d} = 1.5\). Find a 99% confidence interval for \(\mu_{d}\).
Two slips cost marks here. First, the wrong tail: a 95% interval needs \(t(0.975)\), not the one-tailed 5% value \(t(0.95)\). Second, the wrong degrees of freedom: paired intervals use \(n - 1\) (pairs), pooled intervals use \(n_{x} + n_{y} - 2\). And a 95% interval does not mean 'a 95% probability that \(\mu\) lies in THIS interval': it means 95% of intervals built this way would contain \(\mu\).
Section 03
Large samples and choosing the right method.
When both samples are large (as a guide, each of size 30 or more), the Central Limit Theorem makes \(\bar{X} - \bar{Y}\) approximately normal whatever the populations, and the sample variances are reliable estimates of the population variances. Then no pooling and no normality assumption is needed, and the interval uses \(z\): \[(\bar{x} - \bar{y}) \pm z\sqrt{\dfrac{s_{x}^{2}}{n_{x}} + \dfrac{s_{y}^{2}}{n_{y}}}.\] The same formula with \(\sigma_{x}^{2}, \sigma_{y}^{2}\) applies whenever the population variances are KNOWN and the populations are normal.
Situation
Method
Assumptions
Same or matched subjects, small \(n\)
Paired t on the differences, \(n - 1\) df
Differences normal
Two independent small samples, variances unknown
Pooled two-sample t, \(n_{x} + n_{y} - 2\) df
Both populations normal, equal variances
Two independent large samples
Normal (\(z\)) with \(\tfrac{s_{x}^{2}}{n_{x}} + \tfrac{s_{y}^{2}}{n_{y}}\)
None needed (Central Limit Theorem)
Two independent samples, variances known
Normal (\(z\)) with \(\tfrac{\sigma_{x}^{2}}{n_{x}} + \tfrac{\sigma_{y}^{2}}{n_{y}}\)
Populations normal (or samples large)
To judge a claim, see where the claimed value lies: inside the interval means the data are consistent with it at that level; outside means there is evidence against it.
Worked example Large-sample normal interval
In a survey, 60 pupils from school P had mean reading score 72.4 with \(s^{2} = 90\), and 80 pupils from school Q had mean 68.9 with \(s^{2} = 110\). Find a 95% confidence interval for \(\mu_{P} - \mu_{Q}\). A newspaper claims that P's mean is at least 7 points higher than Q's. Comment.
Both samples are large and independent, so use the normal distribution with the separate sample variances.
0 lies outside, so the data support a higher mean at P. But 7 also lies outside (above the upper limit), so the data are not consistent with a difference of 7 or more at this level: there is evidence against the newspaper's claim.
Answer: \((0.177,\ 6.82)\); the claim of at least 7 is not supported
Worked example Which test, and why?
A sports scientist wants to know whether a new running shoe lowers 400 m times. Plan A: 10 athletes each run once in old shoes and once in new shoes. Plan B: 10 athletes run in old shoes and a different 10 run in new shoes. For each plan, state the appropriate test and its assumptions, and say which plan is better.
Plan A: each athlete gives two linked times, so the data are paired. Use a paired t-test on \(d = \text{old} - \text{new}\), with \(H_{0}: \mu_{d} = 0\), \(H_{1}: \mu_{d} \gt 0\) and 9 degrees of freedom. Assume the differences are normally distributed.
Plan B: the two groups are independent and small. Use a two-sample t-test with pooled variance and \(10 + 10 - 2 = 18\) degrees of freedom. Assume both populations of times are normal with a common variance.
Plan A is better: athletes differ in ability far more than one pair of shoes changes a time. Pairing cancels that ability difference, so a real shoe effect is much more likely to be detected.
Plan A should also randomise which shoe each athlete wears first, so that tiredness or practice does not bias the differences.
Answer: A: paired t (differences normal), 9 df. B: pooled two-sample t (normal, equal variances), 18 df. Plan A is better
Examiner trap
Do not pool the variances in the large-sample \(z\) interval: it uses \(\tfrac{s_{x}^{2}}{n_{x}} + \tfrac{s_{y}^{2}}{n_{y}}\) under ONE square root. Adding the two standard errors \(\tfrac{s_{x}}{\sqrt{n_{x}}} + \tfrac{s_{y}}{\sqrt{n_{y}}}\), or forgetting the square root, gives the wrong width. And use \(z\) only when the samples are large or the variances known; for small samples with estimated variances use \(t\).
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to AS & A Level Further Mathematics Paper 1 to 4 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
Ten pairs of measurements give differences with \(\bar{d} = 4.2\) and \(s_{d} = 2.5\). Assuming the differences are normal, find a 95% confidence interval for the population mean difference.
Exam style+20 XP
A 95% confidence interval for \(\mu_{1} - \mu_{2}\) is \((-0.8,\ 3.4)\). Which conclusion is correct?
Exam style+20 XP
Independent random samples of sizes 50 and 40 have \(\bar{x} - \bar{y} = 3.0\), \(s_{x}^{2} = 40\) and \(s_{y}^{2} = 36\). Find a 90% confidence interval for \(\mu_{x} - \mu_{y}\).
Exam style+20 XP
For eight pairs, a paired t-test of \(H_{0}: \mu_{d} = 0\) against \(H_{1}: \mu_{d} \ne 0\) gives \(t = 2.10\). What is the conclusion at the 5% level?
Skill unlocked
Pairs reduced to differences, intervals built and read: Section 4.2 complete.
This skill is now recorded on your profile. Keep the chain going.