Ask Mallard

Nonparametric and rank-based tests

A nonparametric test replaces the observed values with their ranks, so the conclusion does not depend on the shape of the distribution.

What question does this help answer?

Whether one group tends to have larger values than another, when the outcome is ordinal or so skewed that a mean is a poor summary.

The common tests

  • Mann-Whitney U, equivalently the Wilcoxon rank-sum test: two independent groups.
  • Wilcoxon signed-rank: paired measurements.
  • Kruskal-Wallis: three or more independent groups.
  • Friedman: repeated measures across conditions.
  • Spearman's rank correlation: monotonic association between two continuous or ordinal variables.

What Mann-Whitney actually tests

It tests whether a randomly chosen observation from one group tends to exceed a randomly chosen observation from the other. That quantity has a name, the probabilistic index or concordance probability, and it is a perfectly good effect measure. It becomes a statement about medians only under the extra assumption that the two distributions differ by a shift and are otherwise the same shape, which is rarely checked and often false.

Same median, different shapes

Two outcome distributions with the same median marked by a vertical line: one narrow and symmetric, the other wide and skewed, so a rank test can detect a difference even though the medians are equal.The same median, different shapes: what a rank test is sensitive toOutcomeSame medianGroup AGroup BMann-Whitney is not a comparison of medians unless the shapes match. It can detect a difference here eventhough the medians are identical.
Conceptual diagram. It shows the structure of the idea, not data from any study.

Choose it in advance, for a reason

Deciding between a t-test and a rank test after inspecting the data, or after a normality test, makes the analysis conditional on the data. The honest routes are to prespecify the rank test because the outcome is ordinal or known to be skewed, or to prespecify the t-test and let its robustness in large samples do its job.

Why Mallard may recommend it

Mallard may name a rank-based test when the outcome is an ordinal scale, a score with a floor or ceiling, or a strongly skewed measurement such as length of stay.

What to watch out for

A rank test is not automatically the safe choice: it answers a different question from the t-test, and the Mann-Whitney statistic is not a comparison of medians unless the two distributions have the same shape. It also gives you a p-value and no effect estimate, which is the wrong trade for a clinical paper. Choosing it AFTER seeing a normality test fail turns the analysis into a data-dependent decision, and the resulting p-value no longer means what it claims.

Report an estimate too

Pair the test with something readable: a Hodges-Lehmann median difference with its confidence interval, or the probabilistic index. A rank test reported as a bare p-value tells a clinician that something differs and nothing about how much.

Clinical example

Question: Does length of stay differ between two discharge pathways? Analysis: Mann-Whitney for the test, reported with a Hodges-Lehmann median difference and confidence interval, since length of stay is right-skewed by a small number of very long stays.

Code for this method
Loading…
Recent studies that used this
Searching PubMed…
Related Learn pages
Sources & further reading
  1. Nonparametric statistical tests for the continuous data: the basic concept and the practical use (opens in a new tab) · Korean J Anesthesiol · doi 10.4097/kjae.2016.69.1.8
  2. T test as a parametric statistic (opens in a new tab) · Korean J Anesthesiol · doi 10.4097/kjae.2015.68.6.540
Last source review: 2026-09-06
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.