Skip to main content
ScotlandStatisticsSyllabus dot point

How do you test for a difference when the data are not normal or are ranks?

Carry out the main non-parametric tests, including the Mann-Whitney U test for two independent samples and the Wilcoxon signed-rank test for paired or single samples, explaining when a non-parametric test is preferred over a t-test.

A focused answer to the SQA Advanced Higher Statistics non-parametric test content: the Mann-Whitney U test for two independent samples and the Wilcoxon signed-rank test for paired data, how each ranks the data, the assumptions they relax, and when to prefer them over a t-test.

Generated by Claude Opus 4.813 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Why and when to go non-parametric
  3. The Mann-Whitney U test
  4. The Wilcoxon signed-rank test
  5. Try this

What this dot point is asking

T-tests need approximately normal data; when that fails, or when the data are ranks rather than measurements, the SQA wants you to use a non-parametric test instead. The two on the course are the Mann-Whitney U test for two independent samples and the Wilcoxon signed-rank test for paired (or single) samples. You must know how each ranks the data, what assumption it relaxes, and when it is the right choice.

Why and when to go non-parametric

Non-parametric tests trade a little power for far weaker assumptions.

The price is a modest loss of power when the data really are normal, so for genuinely normal data the t-test remains preferable; the strength of the non-parametric test is its robustness when they are not.

The Mann-Whitney U test

The Mann-Whitney U test is the non-parametric counterpart of the two-sample t-test, for two independent groups.

Its hypotheses are usually phrased as H0H_0: the two populations have the same distribution (equal medians) against H1H_1: one population tends to give larger values.

The Wilcoxon signed-rank test

The Wilcoxon signed-rank test is the non-parametric counterpart of the paired t-test, using matched pairs.

For large samples both tests have a normal approximation, so the rank-sum statistic is standardised and compared with zz-values, exactly as in the framework page.

Try this

Q1. State the parametric test that the Mann-Whitney U test replaces, and the assumption it avoids. [1 mark]

  • Cue. It replaces the two-sample (independent) t-test and avoids the assumption that the populations are normal, working on ranks instead.

Q2. In a Wilcoxon signed-rank test, two of the ten paired differences are zero. State the effective sample size used. [1 mark]

  • Cue. The two zero differences are discarded, so the effective sample size is 102=810 - 2 = 8.

Exam-style practice questions

Practice questions written in the style of SQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

AH style: choose test3 marksTwo independent groups give small samples of strongly skewed reaction times. Explain why a Mann-Whitney U test is preferred over a two-sample t-test, and state its hypotheses.
Show worked answer →

The t-test assumes the data are approximately normal, but the samples are small and strongly skewed, so that assumption fails and the t-test is unreliable here (1 mark).

The Mann-Whitney U test is non-parametric: it works on the ranks of the combined data rather than the raw values, so it does not require normality and is resistant to skew and outliers (1 mark).

Hypotheses: H0H_0 that the two populations have the same distribution (equal medians/locations) against H1H_1 that one tends to give larger values, tested via the rank-sum statistic UU (1 mark). Markers reward identifying the broken normality assumption, the rank-based nature of the test and appropriate hypotheses.

AH style: Wilcoxon3 marksA Wilcoxon signed-rank test is run on paired before-and-after data. Outline how the signed ranks are formed and what the test statistic is based on.
Show worked answer →

For each pair compute the difference d=afterbefored = \text{after} - \text{before}, discard any zero differences, and take the absolute values d|d| (1 mark).

Rank the d|d| from smallest to largest, then reattach the sign of each original difference to its rank, giving signed ranks (1 mark).

The test statistic is based on the sum of the positive ranks (and/or the sum of the negative ranks); under H0H_0 of no difference these sums are similar, and a small enough value of the smaller sum leads to rejection (1 mark). Markers reward forming the differences, ranking the absolute differences and basing the statistic on the rank sums.

Related dot points

Sources & how we know this