The Mann-Whitney U test (Wilcoxon rank-sum test) asks whether two samples come from the same distribution without assuming a normal shape — it works on ranks alone, so it survives skew and outliers that break the t-test.
Pool both samples (n1 + n2 values), rank them jointly
(tied values share the average of their ranks).
R_A = sum of ranks landing in Group A
U_A = R_A - n1(n1+1)/2
U_B = n1·n2 - U_A
U = min(U_A, U_B) range: 0 .. n1·n2
rank-biserial r = 1 - 2U / (n1·n2) (effect size, -1..1)
Unlike a rank-position track, the left panel here places every point at its real numeric value on a shared x-axis, then runs a beeswarm dodge algorithm: points are added in value order and pushed up/down away from any neighbour closer than one marker diameter until they clear, so overlap-free vertical spread reveals local density directly — a genuinely different geometric encoding of the same joint ranking the statistic is built from.
The p-value here is not read off a table — it is earned by permutation: the joint ranks are fixed, then group labels are reshuffled 2,000 times to build the true null distribution of U under "no difference between groups", shown as the gray histogram on the right. The p-value is the fraction of shuffles at least as extreme as the real split (highlighted bins).
- Sample size — more points per group sharpens the null distribution and makes small shifts easier to detect.
- Location shift — moves Group B's whole distribution; watch U shrink, the swarms separate along the x-axis, and the effect size grow as the shift increases.
- Distribution shape — Mann-Whitney's validity does not depend on this; try "skewed" to see a case where a t-test's normality assumption would be questionable but the rank test remains exact.