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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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 : the two populations have the same distribution (equal medians) against : 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 -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 .
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: that the two populations have the same distribution (equal medians/locations) against that one tends to give larger values, tested via the rank-sum statistic (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 , discard any zero differences, and take the absolute values (1 mark).
Rank the 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 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
- Set up null and alternative hypotheses, choose a significance level, compute and use a test statistic and p-value, decide between one- and two-tailed tests, identify the critical region, and distinguish Type I and Type II errors.
A focused answer to the SQA Advanced Higher Statistics hypothesis testing framework: forming null and alternative hypotheses, the significance level, the test statistic, the p-value and critical region, one- and two-tailed tests, and Type I and Type II errors.
- Carry out the one-sample, two-sample (independent) and paired t-tests for population means, stating the hypotheses, computing the test statistic, using degrees of freedom, and interpreting the result, while checking the normality assumption.
A focused answer to the SQA Advanced Higher Statistics t-test content: the one-sample t-test, the two-sample (independent) t-test and the paired t-test, with the test statistics, the degrees of freedom, the normality assumption and how to interpret the outcome.
- Carry out the chi-squared goodness-of-fit test and the chi-squared test for association in a contingency table, computing expected frequencies, the chi-squared statistic and degrees of freedom, and interpreting the result against the assumptions.
A focused answer to the SQA Advanced Higher Statistics chi-squared content: the goodness-of-fit test and the test for association in a contingency table, computing expected frequencies, the chi-squared statistic and degrees of freedom, the minimum expected frequency rule, and interpreting the outcome.
- Conduct a statistical investigation that draws together the skills of the course: pose a question, plan and collect data, select and apply appropriate analysis, and communicate justified conclusions with their limitations.
An overview of the statistical investigation in SQA Advanced Higher Statistics: how the skills of design, analysis and inference are combined to pose a question, collect and analyse data, and communicate justified conclusions with their limitations, as examined in the question papers.
Sources & how we know this
- SQA Advanced Higher Statistics Course Specification (C803 77) — SQA (2023)
- SQA Advanced Higher Statistics Data Booklet — SQA (2019)