A-Level Further Maths 9231 / Topic 4.4 / AS & A Level
Only the signs count.
A t-test needs a normal population. When you cannot assume that, test the median instead: if the median really is \(m\), each observation is equally likely to fall above or below it, so the number of + signs follows \(\mathrm{B}(n, 0.5)\). That one idea gives the single-sample sign test for a median and the paired-sample sign test for comparing two populations.
A non-parametric test makes no assumption about the shape of the population (no normality needed). In a sign test of \(\mathrm{H}_0\): median \(= m\), replace each observation by + (above \(m\)) or \(-\) (below \(m\)). Under \(\mathrm{H}_0\) each sign is + with probability \(\frac{1}{2}\), independently, so the number of + signs is \(X \sim \mathrm{B}(n, 0.5)\). Find the probability of a result at least as extreme as the one observed, \(P(X \le x)\) or \(P(X \ge x)\), and compare it with the significance level (with HALF the level in each tail for a two-tailed test). For paired data, apply the same test to the signs of the differences.
Fig. 1: the distribution of the number of + signs in a sign test with n = 10. For a two-tailed test at the 5% level each tail may hold at most 2.5%, so the critical region (orange) is X ≤ 1 or X ≥ 9, with actual significance level 2 × 0.0107 = 2.15%
Section 01
Why go non-parametric?
The \(t\)-tests of Section 4.2 are parametric: they test a parameter (the mean \(\mu\)) of a population assumed to be normal. With a small sample from a skewed population, or one with outliers, that assumption may be false and the \(t\)-test can mislead. A non-parametric (distribution-free) test assumes nothing about the shape of the distribution. The price is that it usually tests the median and uses less of the information in the data.
Parametric (e.g. \(t\)-test)
Non-parametric (e.g. sign test)
Assumes
a normal population
only a random sample (continuous data)
Tests
the mean \(\mu\)
the median
Uses
the actual values
only whether each value is above or below
Power
higher, when its assumptions hold
lower, but valid for any population
The basis of the sign test: if the population median is \(m\), then \(P(\text{observation} > m) = P(\text{observation} < m) = \frac{1}{2}\). In a random sample of \(n\), with no value equal to \(m\), the number of + signs is \(X \sim \mathrm{B}(n, 0.5)\), and so is the number of \(-\) signs. Each probability is exact: \(P(X = r) = \dbinom{n}{r}\left(\dfrac{1}{2}\right)^{n}\).
Worked example From data to signs to a probability
The times, in minutes, taken by 10 randomly chosen students to finish a puzzle are 18, 23, 15, 17, 19, 14, 22, 16, 12, 19. Assuming the population median time is 20 minutes, find the probability of getting 2 or fewer + signs.
Compare each time with 20: signs \(-,+,-,-,-,-,+,-,-,-\), so 2 + signs and 8 \(-\) signs.
Under \(\mathrm{H}_0\), \(X\), the number of + signs, satisfies \(X \sim \mathrm{B}(10, 0.5)\).
A sign test uses a random sample of 12 with \(\mathrm{H}_0\): median \(= m\) and \(\mathrm{H}_1\): median \(< m\), at the 5% level. Find the critical region for \(X\), the number of + signs, and the actual significance level.
A median below \(m\) gives FEW + signs, so the critical region is a lower tail \(X \le c\). \(X \sim \mathrm{B}(12, 0.5)\), and \(2^{12} = 4096\).
\(P(X \le 3) = \dfrac{79 + 220}{4096} = \dfrac{299}{4096} = 0.0730 > 0.05\), so 3 is not included.
The critical region is the largest tail whose probability does not exceed 5%.
Answer: Critical region \(X \le 2\); actual significance level \(1.93\%\)
Examiner trap
The critical region is a TAIL, so add the probabilities: \(P(X \le 2)\), not \(P(X = 2)\). And it is the largest tail with probability at most the significance level, which is why the actual significance level (here 1.93%) is usually below the nominal 5%.
Section 02
The single-sample sign test for a median.
Follow the full structure every time. Define the median in context, count the signs, find the probability of the observed number of signs or a more extreme one under \(\mathrm{H}_0\), compare and conclude without certainty.
\(\mathrm{H}_0\): population median \(= m\); \(\mathrm{H}_1\): median \(> m\), \(< m\) or \(\ne m\), from the wording.
Count the + signs (values above \(m\)); under \(\mathrm{H}_0\), \(X \sim \mathrm{B}(n, 0.5)\).
\(\mathrm{H}_1\): median \(> m\) expects MANY + signs, so find \(P(X \ge x)\); median \(< m\) expects few, so find \(P(X \le x)\).
Two-tailed: find the probability in the tail the result lies in and compare it with HALF the significance level.
Worked example One-tailed: just not significant
A clinic claims that the median waiting time is 15 minutes. A patient suspects it is longer and records 10 randomly chosen waiting times, in minutes: 17, 22, 14, 19, 25, 16, 18, 13, 21, 20. Use a sign test at the 5% level to test the suspicion.
\(\mathrm{H}_0\): the population median waiting time is 15 minutes; \(\mathrm{H}_1\): it is greater than 15 minutes.
\(0.0547 > 0.05\), so do not reject \(\mathrm{H}_0\).
Answer: There is insufficient evidence at the 5% level that the median waiting time is greater than 15 minutes. (At the 10% level it would be significant.)
Worked example Two-tailed: compare with half the level
The median mark on a national test is believed to be 50. The marks of 12 randomly chosen students from one region are 44, 47, 52, 39, 45, 48, 41, 46, 55, 43, 49, 42. Test at the 5% level whether the median mark in this region differs from 50.
\(\mathrm{H}_0\): the population median mark in the region is 50; \(\mathrm{H}_1\): it is not 50.
Above 50: 52, 55, so 2 + signs and 10 \(-\) signs.
Under \(\mathrm{H}_0\), \(X \sim \mathrm{B}(12, 0.5)\). The result is in the lower tail: \[P(X \le 2) = \frac{1 + 12 + 66}{4096} = 0.0193\]
Two-tailed at 5%, so compare with 2.5%: \(0.0193 < 0.025\), reject \(\mathrm{H}_0\).
Answer: There is sufficient evidence at the 5% level that the median mark in the region differs from 50.
Your turn
In a random sample of 8 values, 7 are above 30 and 1 is below. Test \(\mathrm{H}_0\): median \(= 30\) against \(\mathrm{H}_1\): median \(> 30\) at the 5% level.
\(X \sim \mathrm{B}(8, 0.5)\): \(P(X \ge 7) = \dfrac{8 + 1}{256} = 0.0352 < 0.05\). Reject \(\mathrm{H}_0\): there is sufficient evidence at the 5% level that the median is greater than 30.
Examiner trap
In a two-tailed test, do not compare the tail probability with the full significance level: \(0.0193\) must be compared with \(0.025\), not \(0.05\). Equivalently, double the tail probability and compare with 5%. Never compare \(P(X = x)\) alone: you need the whole tail.
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
In a sign test of \(\mathrm{H}_0\): median \(= m\), using a random sample of 12 with no value equal to \(m\), what is the distribution of the number of + signs under \(\mathrm{H}_0\)?
Quick check+10 XP
In which situation is a non-parametric test most appropriate?
Quick check+10 XP
A sign test has \(n = 10\) and \(\mathrm{H}_1\): median \(> m\). There are 8 + signs. Find the probability used to make the decision.
Quick check+10 XP
What is the null hypothesis of a paired-sample sign test?
Section 03
Paired samples: signs of the differences.
When each item is measured twice (before and after, or by two methods), the two samples are paired. Work out each difference \(d = x - y\) and keep only its sign. If the two populations are identical, then \(x > y\) and \(x < y\) are equally likely, so the number of + differences is again \(\mathrm{B}(n, 0.5)\). The null hypothesis is that the populations are identical (the median difference is 0).
Limitations. The sign test throws away the sizes of the deviations: a difference of 0.1 and a difference of 30 each count as one sign. Because it uses less information it is less powerful than a test that uses the magnitudes (the Wilcoxon signed-rank test, next lesson, or a \(t\)-test when normality can be assumed), so it is more likely to miss a real effect. Its strength is that it is valid for any continuous population and is not affected by outliers.
Large samples (brief note). For large \(n\), \(\mathrm{B}(n, 0.5)\) can be approximated by \(\mathrm{N}\!\left(\frac{n}{2}, \frac{n}{4}\right)\) with a continuity correction. For example, with \(n = 40\) and 27 + signs, \(z = \dfrac{26.5 - 20}{\sqrt{10}} = 2.06\), a tail probability of about 0.0199, close to the exact \(P(X \ge 27) = 0.0192\). In this course the exact binomial calculation is the standard method.
Worked example Paired, one-tailed
Eleven tasters each score two recipes, \(A\) and \(B\), out of 10. Scores \(A\): 7, 8, 6, 9, 7, 5, 8, 6, 7, 9, 8; scores \(B\): 5, 6, 7, 6, 4, 6, 5, 4, 5, 7, 6 (same taster in each position). Test at the 5% level whether tasters tend to prefer recipe \(A\).
\(\mathrm{H}_0\): the score populations for the two recipes are identical (median of \(A - B\) is 0); \(\mathrm{H}_1\): scores for \(A\) tend to be higher (median of \(A - B\) is greater than 0).
Answer: There is sufficient evidence at the 5% level that tasters tend to prefer recipe \(A\).
Worked example Paired, two-tailed
Two thermometers \(P\) and \(Q\) record the temperature, in °C, at noon on 9 days. \(P\): 21.4, 19.8, 22.1, 20.5, 18.9, 23.0, 21.7, 20.2, 19.5. \(Q\): 21.9, 20.1, 21.8, 20.9, 19.6, 23.4, 21.5, 20.8, 19.9. Use a sign test at the 10% level to test whether the thermometers differ.
\(\mathrm{H}_0\): the populations of readings from \(P\) and \(Q\) are identical; \(\mathrm{H}_1\): they are not.
Two-tailed at 10%: compare with 5%. \(0.0898 > 0.05\), so do not reject \(\mathrm{H}_0\).
Answer: There is insufficient evidence at the 10% level that the two thermometers give different readings.
Examiner trap
Keep one direction for every difference (always \(P - Q\), never sometimes \(Q - P\)) and decide which sign \(\mathrm{H}_1\) predicts BEFORE you count. The paired sign test tests whether the populations are identical; it says nothing about the size of the difference.
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
A sign test uses a random sample of 12, with \(\mathrm{H}_0\): median \(= m\) and \(\mathrm{H}_1\): median \(< m\), at the 5% level. \(X\) is the number of + signs. Find the critical region.
Exam style+20 XP
In a sign test with \(n = 10\), \(\mathrm{H}_1\): median \(\ne m\) at the 10% level, there are 8 + signs. Which is the correct decision?
Exam style+20 XP
Fourteen people rate two films. Film \(A\) gets the higher rating from 11 people and film \(B\) from 3. Find the probability used to test \(\mathrm{H}_1\): people tend to rate film \(A\) higher.
Exam style+20 XP
Why is a sign test generally less powerful than a test that uses the actual values?
Skill unlocked
Medians tested with nothing but signs.
This skill is now recorded on your profile. Keep the chain going.