Skip to content
AZ Tools

Mann–Whitney U & Wilcoxon Signed-Rank Test

Rank-based tests for two independent samples or paired data: W or V, an exact or corrected p-value, rank-biserial r and the Hodges–Lehmann estimate.

Values separated by spaces, commas or new lines. For paired data, the nth value of x goes with the nth of y.

p = 0.01953 is below α = 0.05: the samples are unlikely to come from distributions differing only by the hypothesised shift.

V (sum of positive ranks)
40
p-value
0.01953
n used
9
Rank-biserial correlation
0.7778
Hodges–Lehmann (pseudo)median of x − y
0.46
median x / median y
1.68 / 1.06

p is exact: no ties, and fewer than 50 observations — R's rule.

Calculated in the browser; exact p-values come from the full null distribution of the rank statistic. The data are kept in local storage.

How to use

  1. Choose two independent samples or paired data, and paste the values for x and y.
  2. For paired data, keep the pairs in the same order in both boxes — the first x goes with the first y.
  3. Set the alternative: any difference, or only x tending to be greater or smaller than y.
  4. Read W or V and the p-value, and the note that says whether it is exact or approximate.
  5. Use the rank-biserial correlation and the Hodges–Lehmann estimate to judge how large the difference is.

About this tool

Show

These are the tests to use when a t-test's assumption of normal data is doubtful — small samples, skewed measurements, outliers, or scores that are only ordered. For two independent samples the tool runs the Mann–Whitney U test (also called the Wilcoxon rank-sum test); for paired data, the Wilcoxon signed-rank test. It follows R's wilcox.test exactly, and the two examples from R's own documentation reproduce its printout: V = 40 with a one-sided p of 0.01953 for the paired depression scores, and W = 35 with p = 0.1272 for the permeability constants. Following R matters because implementations differ in three places, and the differences change p-values. Zero differences in paired data are dropped before ranking. The exact null distribution of the rank statistic is used when there are no ties or zeros and fewer than fifty observations, computed in full rather than approximated; otherwise the normal approximation is used with R's correction for ties and its continuity correction — scipy, by contrast, leaves the continuity correction off by default for the signed-rank test. The note under the result says which method applied and how many zeros were dropped. Besides the statistic and p-value, the tool reports the rank-biserial correlation as an effect size, and the Hodges–Lehmann estimate — the median of all pairwise differences for two samples, the median of the Walsh averages for paired data — which is the natural estimate of the shift these tests are about and the figure R prints when asked for a confidence interval. A hypothesised shift μ can be tested instead of zero. These tests compare distributions, not means: a significant result says one sample tends to produce larger values, and it only speaks of medians when the two distributions have the same shape.

Frequently asked questions

When should I use these instead of a t-test?

When the data are clearly not normal and the samples are too small for that not to matter, when there are outliers you cannot justify removing, or when the measurements are ranks or ratings. With normal data they lose little: their efficiency relative to the t-test is about 95%. With heavy tails they can be far more powerful.

Is Mann–Whitney the same as the Wilcoxon rank-sum test?

Yes. They are two formulations of the same test and give the same p-value. R reports the statistic as W, the Mann–Whitney U for the first sample, which is the sum of that sample's ranks minus n(n + 1)/2. The Wilcoxon signed-rank test is a different test, for paired data.

Why does the p-value say exact or approximate?

With no ties, no zero differences and fewer than fifty observations, the probability of every possible value of the statistic can be counted exactly, and it is. Otherwise the normal approximation is used, with a correction for ties and a continuity correction, as R does. Different programs switch at different points or skip the continuity correction, which is the usual reason two packages give slightly different p-values.

What happens to zero differences in paired data?

They are dropped before ranking, the convention R and Wilcoxon's original test use, and the number dropped is shown. Their presence also rules out the exact distribution. An alternative convention (Pratt's) keeps zeros in the ranking; results can differ when there are many of them.

Do these tests compare medians?

Only under an extra assumption. Mann–Whitney tests whether a value from one group tends to exceed a value from the other; if both distributions have the same shape and differ only by a shift, that is a statement about medians. With different shapes, two groups can have equal medians and still differ significantly. The Hodges–Lehmann estimate is the matching estimate of the shift.

Related tools