Home / A-Level Further Maths 9231 / Topic 4.4 / Revision notes
Download PDFQuestion bank →Topic 4.4 lessons

Non-parametric tests

A-Level Further Maths 9231 · Topic 4.4 revision notes

Everything from the 3 lessons of this topic on a few pages: the key idea of each lesson, the diagram to remember, the points to learn and the traps examiners set. Read it, cover it, test yourself.

  1. Sign tests
  2. Wilcoxon signed-rank tests
  3. Wilcoxon rank-sum test

1Sign tests

Syllabus 4.4

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.

0.05 0.10 0.15 0.20 0.25 0 1 2 3 4 5 6 7 8 9 10 x P(X = x) P(X ≤ 1) = 0.0107 P(X ≥ 9) = 0.0107 X = number of + signs, X ~ B(10, 0.5)
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%

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.
  1. Compare each time with 20: signs \(-,+,-,-,-,-,+,-,-,-\), so 2 + signs and 8 \(-\) signs.
  2. Under \(\mathrm{H}_0\), \(X\), the number of + signs, satisfies \(X \sim \mathrm{B}(10, 0.5)\).
  3. \[\begin{aligned} P(X \le 2) &= \left(\tbinom{10}{0} + \tbinom{10}{1} + \tbinom{10}{2}\right)\left(\tfrac{1}{2}\right)^{10} \\ &= \frac{1 + 10 + 45}{1024} = \frac{56}{1024} \end{aligned}\]
Answer: \(P(X \le 2) = 0.0547\) (3 s.f.)

Signs, binomial, tail, compare.

  • Hypotheses: \(\mathrm{H}_0\): median \(= m\) (or the paired populations are identical), with the median defined in context; one or two tails from the wording.
  • Signs: + above \(m\), \(-\) below; for paired data use the signs of the differences, all taken the same way round.
  • Distribution: under \(\mathrm{H}_0\) the number of + signs is \(X \sim \mathrm{B}(n, 0.5)\).
  • Tail: find \(P(X \ge x)\) or \(P(X \le x)\), the observed value and beyond, exactly with \(\binom{n}{r}\left(\frac{1}{2}\right)^{n}\).
  • Compare with the level, or with half the level for a two-tailed test.
  • Conclude in context: 'there is (in)sufficient evidence at the ...% level that ...'.

Watch out!

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%.

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.

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.

2Wilcoxon signed-rank tests

Syllabus 4.4

Subtract the hypothesised median \(m_0\) from each value (or take the differences of matched pairs), rank the absolute differences from 1 (smallest) to \(n\), and add the ranks of the positive differences to get \(P\) and of the negative ones to get \(Q\). Always \(P + Q = \tfrac{1}{2}n(n + 1)\). The test statistic is \(T = \min(P, Q)\) and you reject \(H_0\) if \(T \le\) the critical value. For large \(n\), \(T \approx N\!\left(\tfrac{n(n + 1)}{4},\ \tfrac{n(n + 1)(2n + 1)}{24}\right)\). The test is valid only if the population (of values or of differences) is symmetric.

0 5 10 15 20 25 30 35 0 5 10 sum of positive ranks, P (n = 8) ways (out of 256) E(P) = 18 P ≤ 5 10/256 ≈ 0.039 Symmetric about 18 P(P ≤ 6) = 14/256 ≈ 0.055 One-tailed 5%: reject if T ≤ 5
Fig. 1: the exact distribution of P, the sum of the positive ranks, for n = 8 when H0 is true. Each of the 2^8 = 256 sign patterns is equally likely, so the distribution is symmetric about E(P) = 18. P(P ≤ 5) = 10/256 ≈ 0.039 is within 5% but P(P ≤ 6) = 14/256 ≈ 0.055 is not, so the one-tailed 5% critical value for n = 8 is 5

Worked example: Ranking and the check P + Q

A machine is meant to fill bags with median mass 50 g. Eight bags have masses (g) 53.2, 47.9, 58.4, 55.1, 49.3, 61.0, 52.6, 56.8. Find \(P\) and \(Q\) for a test of \(m = 50\).
  1. Differences \(x - 50\): 3.2, -2.1, 8.4, 5.1, -0.7, 11.0, 2.6, 6.8.
  2. Order the absolute values: 0.7 (rank 1, negative), 2.1 (2, negative), 2.6 (3), 3.2 (4), 5.1 (5), 6.8 (6), 8.4 (7), 11.0 (8).
  3. \(Q = 1 + 2 = 3\) and \(P = 3 + 4 + 5 + 6 + 7 + 8 = 33\).
  4. Check: \(P + Q = 36 = \tfrac{1}{2}(8)(9)\).
Answer: \(P = 33,\ Q = 3\); for \(H_1: m > 50\), \(T = Q = 3 \le 5\) (one-tailed 5%), so there is evidence that the median exceeds 50 g

Differences, ranks, \(T\), table.

  • Hypotheses: \(H_0: m = m_0\) (or the median difference is 0), with \(m\) defined in context; state symmetry as the assumption.
  • Differences: \(x - m_0\), or within each pair; rank the absolute values 1 to \(n\).
  • Sums: \(P\) (positive ranks), \(Q\) (negative ranks), check \(P + Q = \tfrac{1}{2}n(n + 1)\).
  • Statistic: \(T = \min(P, Q)\) two-tailed; the sum \(H_1\) predicts small, one-tailed. Reject if \(T \le\) critical value.
  • Large \(n\): \(z = \dfrac{T + 0.5 - n(n + 1)/4}{\sqrt{n(n + 1)(2n + 1)/24}}\), compared with the normal critical value.

Watch out!

Rank the ABSOLUTE differences, but add up the ranks, not the differences. Summing the positive differences themselves (for example 3.2 + 8.4 + ...) is a common slip that produces a number the table knows nothing about.

Do not treat the before and after scores as two separate samples. Matched pairs are tested through their differences; the rank-sum test of the next lesson is for two INDEPENDENT samples.

The continuity correction moves \(T\) TOWARDS the mean: use \(T + 0.5\) because \(T\) is below \(E(T)\). Using \(T - 0.5\), or none at all, can flip a borderline decision, and dividing by the variance instead of its square root gives a tiny, meaningless \(z\).

3Wilcoxon rank-sum test

Syllabus 4.4

Combine the two samples (sizes \(m \le n\)) and rank all \(m + n\) values from smallest. \(R_m\) is the sum of the ranks of the smaller sample. The test statistic is \(W\), the smaller of \(R_m\) and \(m(n + m + 1) - R_m\). Reject \(H_0\) (the two populations are identical) if \(W \le\) the table critical value for \((m, n)\). Beyond the table, use \[W \approx N\!\left(\tfrac{1}{2}m(m + n + 1),\ \tfrac{1}{12}mn(m + n + 1)\right)\] with a continuity correction.

Fertiliser P (m = 4) Fertiliser Q (n = 6) height (cm) rank 19.8 23.1 24.2 25.6 26.9 27.4 28.3 29.0 30.5 31.2 1 2 3 4 5 6 7 8 9 10 Rm = 1 + 2 + 4 + 6 = 13 m(n + m + 1) − Rm = 4 × 11 − 13 = 31, so W = 13
Fig. 1: the heights of 4 plants given fertiliser P and 6 given fertiliser Q, combined into one ranking. The P plants (circles) take four of the lowest six ranks, so their rank sum is small

Worked example: Rank sum for two fertilisers

Heights (cm) of plants: fertiliser P: 23.1, 27.4, 19.8, 25.6; fertiliser Q: 28.3, 24.2, 30.5, 26.9, 31.2, 29.0. Find \(R_m\) and \(W\).
  1. \(m = 4\) (P is the smaller sample), \(n = 6\).
  2. Combined order: 19.8 (P), 23.1 (P), 24.2 (Q), 25.6 (P), 26.9 (Q), 27.4 (P), 28.3 (Q), 29.0 (Q), 30.5 (Q), 31.2 (Q).
  3. The P values have ranks 1, 2, 4 and 6 (Fig. 1).
  4. \[ R_m = 1 + 2 + 4 + 6 = 13 \]
  5. \[ m(n + m + 1) - R_m = 4 \times 11 - 13 = 31 \]
Answer: \(R_m = 13\), and \(W = 13\) (the smaller of 13 and 31)

Combine, rank, sum, take the smaller.

  • State \(H_0\): the populations are identical, and \(H_1\) (one- or two-tailed) in context.
  • Rank all \(m + n\) values together, smallest first; \(m\) is the SMALLER sample size.
  • Sum the ranks of the smaller sample to get \(R_m\), then find \(m(n + m + 1) - R_m\); \(W\) is the smaller.
  • Compare with the table value for \((m, n)\) at the right level: reject \(H_0\) if \(W \le\) it.
  • Large samples: \(z = \dfrac{W + 0.5 - \frac{1}{2}m(m + n + 1)}{\sqrt{\frac{1}{12}mn(m + n + 1)}}\).
  • Conclude in context: 'there is (in)sufficient evidence at the ...% level that ...'.

Watch out!

Rank the two samples TOGETHER, not each one separately (ranking within a sample always gives \(1 + 2 + \dots\) and tells you nothing). And \(R_m\) is the rank sum of the SMALLER sample, whatever order the question lists them in.

The decision rule runs the opposite way to a \(t\) or \(z\) test: SMALL \(W\) means significant, and \(W\) equal to the critical value counts as significant. Also, a two-tailed 5% test uses the one-tailed 0.025 column; in the battery example the one-tailed 0.05 value is 21, which would have wrongly given a significant result.

The variance is \(\tfrac{1}{12}mn(m + n + 1)\), with \(mn\), not \(m^{2}\). The continuity correction moves \(W\) TOWARDS the mean: use \(W + 0.5\), not \(W - 0.5\). And never use the rank-sum test on paired data: pairing is information the rank-sum test throws away.

Back to A-Level Further Maths 9231 contents · (c) 2026 TheLucidSTEM · thelucidstem.com