Stats for

Nonparametric Group Comparisons

Mann-Whitney U Test

The Mann-Whitney U test compares ranked scores between two separate groups.

The Mann-Whitney U test takes ranked or skewed scores from two separate groups and tests whether scores in one group tend to be higher than in the other.

Example

Does listening to music make pain feel less intense? Sixty adults held one hand in ice water while listening to music or sitting in silence (30 each, randomly assigned), then rated the pain from 0 to 10.

Two Independent Groups + Ordinal Outcome → Mann-Whitney U Test
Tests
Probability that a score from one group beats a score from the other
Observations
Independent
Parametric
No
Headline Statistic
U
Effect Size
Rank-Biserial Correlation
Groups
2

The Basics

When to Use It

Use it when you have two separate groups of different people and an outcome that's ordered but not trustworthy as a measured amount, like a rating scale, or scores so skewed that averages mislead. It's also called the Wilcoxon rank-sum test. For example:

  • Does listening to music make pain on a 0-to-10 rating scale feel less intense?
  • Do patients in two clinics differ in how many days they wait for a first appointment?
  • Do people who keep their phone in another room overnight rate their morning tiredness lower on a 5-point scale than people who keep it by the bed?

Vocabulary You Need

Definition Rank

A score's position when all the scores are lined up from lowest to highest: 1 for the lowest, 2 for the next, and so on. Tied scores share the average of the positions they fill. Ranks keep the order of the scores but throw away the distances between them, so one extreme score counts only as the highest and can't dominate a rank-based test, and taking logs or square roots of the scores leaves the ranks unchanged. Glossary →

Definition Mann-Whitney U (U)

Pair every score in one group with every score in the other and count the pairs in which the first group's score is higher, with ties counting half. It runs from 0 to n₁ × n₂ (the two group sizes multiplied, which is the number of pairs), and half of that is what you'd expect if neither group tended to score higher. It's calculated from a rank sum. Software differs in which group's U it reports. Glossary →

Definition Common-Language Effect Size (CL)

The probability that a randomly chosen score from one group is higher than a randomly chosen score from the other, with ties counting half. .50 means neither group tends to score higher; 1 means every score in the first group beats every score in the second. Also called the probability of superiority. McGraw and Wong's original CL was estimated from the means and SDs assuming normal scores; counting pairs directly, with ties as half, is Vargha and Delaney's A. In two independent groups it equals U divided by n₁ × n₂. Glossary →

Assumptions and Inference

1. Independent Observations (for the p-Value and Interval) The people (or other units) in your study don't influence each other.
What It Means
Each person's data comes from a separate, unconnected source, so knowing one person's scores tells you nothing about anyone else's. In designs that measure people more than once, their own scores are meant to be related; it's different people who must be independent. Methods built for clustered data, such as multilevel models and GEE, also allow members of the same group to be related, as long as the analysis names the grouping; then it's the groups that must be independent.
Applies To
Observations
How to Check
By design, not by a test. Did each person contribute their own data, with no clusters such as roommates, couples, therapy groups or classrooms whose members influence each other? If there are clusters, does the analysis model every one of them?
How Much It Matters
A lot. Scores that share a cluster (classmates, couples, one therapist's clients), or people who appear in both groups, make U look more surprising than it is, so p comes out too small.

What to Do

  • Alternative Test Wilcoxon Signed-Rank Test. If the same people are in both conditions, use the paired version of this test.
  • Alternative Test Multilevel Regression (HLM). A multilevel model that accounts for the clustering, ideally an ordinal (cumulative-link) one, since ratings aren't trustworthy as amounts. Rank tests built for clustered data also exist.
  • Design Change Make sure each person contributes one score, to one group only.
2. Similar Shapes (for Reading It as a Shift) The test's usual null is that the two populations' distributions are identical; it needs no particular shape. Reading a difference as a simple shift in scores or medians needs similar shapes and spreads. If they differ a lot and your question is whether one group tends to score higher, consider the Brunner–Munzel test.
What It Means
Strictly, a rank test's null hypothesis is that the groups' scores come from identical distributions. It's built to detect one group tending to score higher, but if the groups have clearly different spreads or shapes, a significant result can reflect that difference instead, and p can be off even when no group tends to score higher, especially with unequal group sizes (Fagerland & Sandvik, 2009). Reading the result as a difference in medians, or as one distribution slid along the scale, also needs the same shape and spread.
Applies To
Outcome
How to Check
Put the groups side by side in dot plots, histograms or box plots. Do they have similar skew and similar spread? Don't use a test for equal variances as a gatekeeper.
How Much It Matters
For p and for the description. If the spreads or shapes clearly differ, a significant result can come from that difference rather than from one group tending to score higher, and p can be off, especially when the groups are different sizes (Fagerland & Sandvik, 2009). Differences in spread or shape can make the test significant even when the medians are similar (Hart, 2001), and the medians can differ while the test finds nothing, or the reverse (Divine et al., 2018). In the music-and-pain study the groups are the same size and their spreads differ only somewhat (the middle half of the ratings runs from 3 to 6 for music and from 5 to 7 for silence; SDs 2.1 and 1.7), so the page reads the result as music listeners tending to rate lower, not as a difference in medians.

What to Do

  • Proceed with Caveat Report the result as one group tending to score higher, with the common-language effect size, and give the medians as description rather than as the thing tested.
  • Alternative Test If the spreads clearly differ, the Brunner-Munzel test asks whether one group tends to score higher, P(X₁ > X₂) + ½P(X₁ = X₂) = .50, without assuming equal shapes or spreads (Brunner & Munzel, 2000). It's scipy.stats.brunnermunzel in Python and the brunnermunzel package in R.
  • Alternative Test Independent-Samples t-Test. Only if your real question is about means, not about one group tending to score higher, and the scores are roughly continuous: Welch's t-test compares the means without assuming equal spreads.

Limitations

This Is Not Your Test If…

What It Doesn't Tell You

  • By how much. The test says music listeners tended to rate lower, not that music lowers pain by one point; the medians differ by one, but the two groups' ratings are also spread differently (the middle half runs from 3 to 6 for music and from 5 to 7 for silence).
  • Why. Random assignment lets us credit the music condition rather than differences between people, but not which part helped: distraction, mood, having something to do, or simply expecting music to help, since people knew which condition they were in.
  • Whether it matters. Significance doesn't make one point on a 0-to-10 scale, in a minute of ice water, meaningful for people in real pain.
  • That there's no difference, if p had been above .05. A non-significant result would have meant the data were inconclusive, not that music does nothing.

Common Mistakes

  • Don'tReport a significant result as "the medians differed" without checking the shapes.

    InsteadSay one group tended to score higher, and give the medians as description.

  • Don'tSwitch to this test because a normality test came back significant.

    InsteadChoose it for the question and the scale, like ratings, ranks or badly skewed scores.

  • Don'tReport U without saying which group it counts.

    InsteadName the group, or report the rank-biserial correlation, whose sign shows the direction.

  • Don'tSwitch to a one-sided p because the result went the way you hoped.

    InsteadUse a one-sided test only if you specified the direction before collecting data and have a defensible reason why an effect in the opposite direction wouldn't count toward your claim. Otherwise use a two-sided test, as here: music making the pain worse would matter too.

  • Don'tClaim the grouping caused the difference when people weren't randomly assigned.

    InsteadSave causal language for randomized groups. Otherwise, describe how the groups differ.

  • Don'tRead a p-value as the chance that the null hypothesis is true.

    InsteadRead it as: if the null were true, how often data at least this extreme would turn up.

Result Decoder

Significance and Effect Size Guidelines

Benchmarks Significance (p Value)
  • p < .001

    Very strong evidence against the null hypothesis.

  • .001 ≤ p < .01

    Strong evidence against the null hypothesis.

  • .01 ≤ p < .05

    Statistically significant at α = .05. Moderate evidence against the null hypothesis.

  • .05 ≤ p < .10

    Not significant. Weak evidence; sometimes called a “trend.” Treat it as inconclusive.

  • p ≥ .10

    Not significant. Little evidence against the null, which is not the same as evidence of no effect.

These evidence labels are one common convention for describing p in graded language rather than as significant or not; the boundaries are rough guides, not rules, and other authors draw them differently. Muff et al. (2022) argue for this kind of language of evidence over a single cutoff. α is chosen before the analysis, and p never says how big or important an effect is.

More about statistical significance ↓

Benchmarks Effect Size (Rank-Biserial Correlation)
  • |r| < .10 Below Small

    Smaller than the conventional small benchmark. Whether an effect this size matters depends on the setting.

  • .10 ≤ |r| < .30 Small

    A small difference in pairwise dominance, by convention. One group wins a few more of the pairwise comparisons than it loses.

  • .30 ≤ |r| < .50 Medium

    A moderate difference in pairwise dominance, by convention. One group wins roughly two comparisons for every one it loses.

  • |r| ≥ .50 Large

    A large difference in pairwise dominance, by convention. One group wins at least three comparisons for every one it loses.

The sign shows direction; the benchmarks apply to its size. They are Cohen's (1988) benchmarks for a correlation, borrowed by convention; the rank-biserial correlation isn't a Pearson r, and other conventions put the cutoffs a little lower. The win-to-loss ratios in the meanings assume no tied pairs; with ties, the same value means a more lopsided split of the untied ones. Not measures of practical importance.

More about effect size ↓

How It's Reported

Equation Form

Example

CL = .325, rrb = −.35, 95% CI [−.58, −.07], U = 292.5, z = −2.37, p = .018

Full Text (APA Style)

Example

Participants who listened to music rated the ice water as less painful (Mdn = 5, n = 30) than participants who sat in silence (Mdn = 6, n = 30). A music listener rated the pain higher than a silent sitter in only 32.5% of pairings (ties counting half), rrb = −.35, 95% CI [−.58, −.07]. A Mann-Whitney U test showed the difference was statistically significant, U = 292.5 (counting the music group's wins), z = −2.37, p = .018.

  • Say which group's U you're reporting (here, music's), or report rrb, whose sign shows the direction.
  • Give each group's median and n as description, but describe the result as one group tending to score higher, not as a difference in medians.
  • Give the effect size with its confidence interval, and say how the interval was computed (here, the normal approximation on Fisher's z scale that R's effectsize package uses).
  • Say whether p comes from the normal approximation (with the tie correction) or an exact test, and whether a continuity correction was used.
  • Italicize statistical symbols (Mdn, U, z, r, p) and report exact p to three decimals.

Reading Each Piece

The equation form above, piece by piece, in this order: how big, then how surprising.

CL = .325 Pick one music listener and one silent sitter at random. The music listener reports more pain 25% of the time, the silent sitter 60%, and 15% of the time they tie. Counting each tie as half a win, that's 32.5% for music.
rrb = −.35 Music listeners rated lower in 35 percentage points more of the pairings than they rated higher. That's a medium effect by the benchmarks above; whether one point on a 0-to-10 pain scale matters is a judgment about pain, not statistics. Benchmarks ↑
95% CI [−.58, −.07] With 30 people per group the interval is wide: the true effect could be anywhere from large to below small, so “medium” is only the best guess. It excludes 0, matching the significant p. It's an approximate interval, not an exact one.
U = 292.5 Of the 900 possible pairings of one music listener with one silent sitter, the music listener rated the pain higher in 292.5 (ties counting half). No difference would give about 450.
z = −2.37 The music group's win count is 2.37 standard errors below what no difference would give.
p = .018 If music made no difference to pain ratings, a U at least this far from 450, in either direction, would turn up about 2% of the time. That's below .05, so the result is statistically significant. Benchmarks ↑

Calculations

The Running Example

Example

The music-and-pain study: 60 adults randomly assigned to music (30) or silence (30) during an ice-water task, compared on their 0-to-10 pain ratings.

Null Hypothesis:
F_1 = F_2
Alternative (Two-Sided):
P(X_1 > X_2) + \tfrac{1}{2}P(X_1 = X_2) \neq .50

X_1 is the pain rating of a randomly chosen person from the population who'd get music, and X_2 of one who'd sit in silence; F_1 and F_2 are those two populations' whole distributions of ratings. Strictly, the null says the two distributions are identical. The test is built to detect the alternative, that a music listener is more (or less) likely to rate the pain higher than lower, ties split evenly; .50 would mean neither group tends to score higher. The sample's estimate is .325. The two aren't exact opposites; distributions can differ in other ways and still give .50 (two symmetric distributions with the same center but different spreads, say), so the test can't detect every possible difference between the groups.

What Your Data Should Look Like

One row per person, with a column saying which group they're in and a column for the outcome, which can be whole-number ratings with plenty of ties. Each person appears once, in one group only.

Example
participantconditionpain
1silence7
2music9
3music6
4silence6
5silence6
6music7
… 54 more rows
nMdnQ1–Q3Mean Rank
Silence3065–735.75
Music3053–625.25

Q1–Q3 is where the middle half of the scores lies, from the 25th to the 75th percentile (R's default quantile definition).

Simulated data.

Download all 60 rows (data.csv)

Napkin Math

The whole test, one idea at a time. Under each heading, a line says why the step matters, and the green note reads the equation in plain English with the music-and-pain study's numbers. Collapse all to read just the headings: they tell the whole story on their own.

  1. 1. Put Everyone in One Line and Rank Them

    The test ignores which group people are in at first. Line up all 60 ratings from lowest to highest and replace each with its position. Tied ratings share the average of the positions they fill.

    \text{tied rank} = \dfrac{\text{first position} + \text{last position}}{2} =\dfrac{27 + 43}{2}

    = 35

    Seventeen people rated the pain 6, and they fill positions 27 to 43 in the line-up. So each of them gets rank (27 + 43) / 2 = 35.

  2. 2. Add Up Each Group's Ranks

    If neither group tends to rate higher, the average rank should be about the same in both groups (here, 30.5, the middle of 1 to 60). A group that tends to rate higher collects the bigger ranks.

    R_1 = \sum \text{ranks in group 1}

    = 757.5

    R_2 = 1072.5

    \bar{R}_1 = 25.25

    \bar{R}_2 = 35.75

    R_1 is the music group's 30 ranks added up, 757.5; the silence group's come to R_2 = 1,072.5. Per person, that's an average rank of 25.25 for music and 35.75 for silence.

  3. 3. Turn the Rank Sum into a Count of Wins

    Each music listener's rank counts everyone at or below them in the line-up. That's the silent sitters they beat plus members of their own group. The own-group part always adds up to 1 + 2 + … + 30 = 465, whatever the scores. Subtract it, and what's left is U, the number of music–silence pairs in which the music listener rated higher, ties counting half.

    U_1 = R_1 - \dfrac{n_1(n_1 + 1)}{2} =757.5 - \dfrac{30 \times 31}{2}

    = 292.5

    R_1 is the music group's 757.5, and n_1 is its 30 people, whose ranks could add up to no less than 30 × 31 ÷ 2 = 465. 757.5 − 465 = 292.5 wins out of 900 pairs.

  4. 4. Work Out What U Would Be If Neither Group Tended to Rate Higher

    With no real difference, each group would win half the pairs. That's the value U is judged against.

    \mu_U = \dfrac{n_1 n_2}{2} =\dfrac{30 \times 30}{2}

    \mu_U = 450

    n_1 and n_2 are the 30 people in each group, so there are 900 pairs, and half of them is 450.

  5. 5. Figure Out How Much U Would Bounce Around by Chance

    Even with no real difference, U wouldn't land exactly on 450. Its standard error says how far it typically strays. Ties make it a little smaller, and the bracket adjusts for them.

    \sigma_U = \sqrt{\dfrac{n_1 n_2}{12}\left[(N + 1) - \dfrac{\sum (t^3 - t)}{N(N - 1)}\right]} =\sqrt{\dfrac{900}{12}\left[61 - \dfrac{6786}{60 \times 59}\right]}

    = 66.57

    N is all 60 people. Each tied rating adds t^3 - t, where t is how many people share it (17 people at 6 add 4,896), for 6,786 in all. 61 − 1.92 = 59.08, times 75 is 4,431, and its square root is 66.57.

  6. 6. Compare U with What No Difference Would Give

    The gap between U and 450 only means something relative to that chance variation. z says how many standard errors the gap is. Unless the groups are tiny, U's chance values pile up in a bell shape around 450, so z can be judged against the standard normal curve, the bell curve with mean 0 and standard deviation 1.

    z = \dfrac{U_1 - \mu_U}{\sigma_U} =\dfrac{292.5 - 450}{66.57}

    = −2.37

    Our U_1 of 292.5 is 157.5 below the \mu_U of 450. Divided by the 66.57 standard error \sigma_U, that's 2.37 standard errors below.

  7. 7. Turn U into the Chance That One Person Rates Higher than Another

    Dividing the wins by the number of pairs gives a probability anyone can read. It's the quantity the test is really about.

    CL = \dfrac{U_1}{n_1 n_2} =\dfrac{292.5}{30 \times 30}

    = .325

    U_1 is the music group's 292.5 wins, out of n_1 n_2 = 900 pairs. 292.5 ÷ 900 = .325.

  8. 8. Measure How Big the Difference Is

    The rank-biserial correlation turns that probability into the share of pairs music wins minus the share it loses, on the familiar −1 to 1 scale of a correlation.

    r_{rb} = 2 \times CL - 1 =2 \times .325 - 1

    = −.35

    95\%\ \text{CI} = [−.58, −.07]

    CL is the .325 chance from the last step. 2 × .325 = .65, and .65 − 1 = −.35. Negative means the music group tended to rate lower.

  9. 9. Ask How Surprising the Result Would Be If There Were No Real Difference

    Finally, ask how often chance alone would put U this far from 450, in either direction, if the two populations had identical distributions of pain ratings.

    p = 2 \times P(Z \ge |z|) =2 \times P(Z \le -2.37)

    = .018

    P(Z \le -2.37) is the chance that a standard normal lands at or below −2.37, about .009. Doubling it counts both directions, .018, about 1 in 56.

Run It in Software

The code below reads the running example's data from data.csv; save it in the same folder you run the code from.

SPSS (version 30, as documented by IBM)
  1. SPSS's classic Mann-Whitney dialog needs a numeric grouping variable. Transform → Automatic Recode: move condition across, type condition_n as the new name, click Add New Name, then OK. Music becomes 1 and silence 2, and the labels are kept.
  2. Analyze → Nonparametric Tests → Legacy Dialogs → 2 Independent Samples.
  3. Move pain into Test Variable List and condition_n into Grouping Variable.
  4. Click Define Groups and enter 1 for Group 1 and 2 for Group 2.
  5. Leave Mann-Whitney U checked, and click OK.

Or paste this syntax:

AUTORECODE VARIABLES=condition /INTO condition_n.

NPAR TESTS
  /M-W= pain BY condition_n(1 2)
  /MISSING ANALYSIS.

Reading the Output

SPSS prints two tables. Read the Mean Rank column first to see which group tended to score higher, then Mann-Whitney U, Z and Asymp. Sig. (2-tailed). SPSS doesn't print an effect size; work out the rank-biserial correlation from U, as below.

Ranks

condition_n N Mean Rank Sum of Ranks
music 30 25.25 757.50
silence 30 35.75 1072.50
Total 60

Test Statistics (pain)

Mann-Whitney U 292.500
Wilcoxon W 757.500
Z -2.366
Asymp. Sig. (2-tailed) .018

SPSS reports the smaller of the two groups' U values, here the music group's. Wilcoxon W is a rank sum, here the music group's (757.5). Its Z uses the tie correction and no continuity correction, the same as this page.

Rank-biserial correlation: 2 × 292.5 ÷ (30 × 30) − 1 = −.35. Because SPSS always reports the smaller U, check the mean ranks to get the sign right: the group with the lower mean rank is the one that tended to score lower.

Output laid out from this page's computed results, not captured from a live run; labels and layout may differ slightly in your version.

R
pain_study <- read.csv("data.csv")

res <- wilcox.test(pain ~ condition, data = pain_study,
                   exact = FALSE, correct = FALSE)
res

# Effect sizes from W, which is the music group's U
n <- table(pain_study$condition)
cl <- unname(res$statistic) / prod(n)
cl          # common-language effect size
2 * cl - 1  # rank-biserial correlation

# Rank-biserial correlation with a 95% CI (install.packages("effectsize") once)
effectsize::rank_biserial(pain ~ condition, data = pain_study)
	Wilcoxon rank sum test

data:  pain by condition
W = 292.5, p-value = 0.01798
alternative hypothesis: true location shift is not equal to 0

[1] 0.325
[1] -0.35
r (rank biserial) |         95% CI
----------------------------------
-0.35             | [-0.58, -0.07]

R calls U “W” and counts the first group's wins (alphabetically, music). exact = FALSE, correct = FALSE asks for the same test as SPSS and this page. What you get if you leave them out depends on your R version. Since R 4.6.0, wilcox.test computes an exact p that allows for ties (the conditional, or permutation, test), here p = .01739, “Wilcoxon rank sum exact test.” Older versions warn that they can't compute an exact p with ties and use the normal approximation with a continuity correction (p = .01835). The exact p is a good choice for small samples; say which one you report. effectsize::rank_biserial gives the rank-biserial correlation with a 95% CI, computed on Fisher's z scale. The “location shift” wording in the output assumes both groups have the same shape; read the result as one group tending to score higher.

Output from a real run: R 4.6.1 (effectsize 1.0.3), run 2026-10-03.

Python
import pandas as pd
from scipy import stats

pain_study = pd.read_csv("data.csv")

music = pain_study.loc[pain_study["condition"] == "music", "pain"]
silence = pain_study.loc[pain_study["condition"] == "silence", "pain"]

result = stats.mannwhitneyu(music, silence, method="asymptotic", use_continuity=False)
result.statistic  # 292.5, the music group's U
result.pvalue     # 0.01798

cl = result.statistic / (len(music) * len(silence))
cl                # 0.325, common-language effect size
2 * cl - 1        # -0.35, rank-biserial correlation

# If the spreads clearly differ: the Brunner-Munzel test
stats.brunnermunzel(music, silence)   # statistic 2.551, p 0.0136

SciPy's statistic is the U of the first group you pass in. method="asymptotic", use_continuity=False matches SPSS and this page; SciPy's default, with ties like these, uses the normal approximation with a continuity correction (p = .01835). Neither R nor SciPy prints z; it's −2.37, as in the Napkin Math. stats.brunnermunzel is the Brunner-Munzel test from Similar Distribution Shapes; its statistic is positive here because it counts the second group (silence) scoring higher.

Output from a real run: Python 3.9.6 (scipy 1.12.0, pandas 2.3.3), run 2026-10-03.

Impact

Effect Size

The rank-biserial correlation compares every person in one group with every person in the other, and gives the share of those comparisons one group wins minus the share it loses (Kerby, 2014). It uses only the order of the scores, so it has no units and can be compared across scales, but it still depends on the design and the sample, and coarse scales with many ties pull it toward 0. It runs from −1 to 1 like any correlation.

r_{rb} = 2 \times CL - 1 = 2 \times \dfrac{292.5}{30 \times 30} - 1 = -.35

Music listeners rated the pain higher than a silent sitter in 25% of pairings, lower in 60%, and the same in 15%. Counting ties as half a win gives the music group a common-language effect size of .325. That lopsidedness (25% won minus 60% lost), −.35, is a medium effect by convention. Its 95% confidence interval, [−.58, −.07], runs from large to negligible, so 30 people per group pin the size down only loosely.

Report the interval with the estimate. R's effectsize::rank_biserial computes it on Fisher's z scale, as the Napkin Math does; neither SPSS's Mann-Whitney procedure nor SciPy prints one. It's a normal approximation, not an exact interval: its standard error depends on the group sizes and the estimate, not on the pattern of ties, so with heavily tied scores like these 0–10 ratings, or small samples, its coverage may be imperfect. A bootstrap that resamples participants is another option, provided the observations are independent.

The common-language effect size (.325 here) carries the same information as a probability, and is often the easier one to explain: pick one person from each group, and how often does the music listener report more pain? Report either or both; they convert with r_{rb} = 2 \times CL - 1.

R's wilcox.test(..., conf.int = TRUE) adds a Hodges-Lehmann estimate, the median of all music-minus-silence differences (−1 point here), with a CI. It's a fair "by how much" only when the two groups have the same shape and spread, which is the shift model this page warns about.

Some texts report r = z / \sqrt{N} instead (.31 here). It's a different quantity that depends on the test's approximation; the rank-biserial correlation describes the data directly.

Benchmarks are conventions, borrowed from correlations. Whether one point less on a 0-to-10 pain scale matters is a question about pain, not statistics.

Benchmarks Rank-Biserial Correlation at a Glance
Below Small
|r| < .10
Small
.10 ≤ |r| < .30
Medium
.30 ≤ |r| < .50
Large
|r| ≥ .50

Full benchmarks and caveats ↑

Statistical Significance

p answers one narrow question: if the two populations had identical distributions, how often would two samples this size give a U at least this far from its expected value of 450 (half the pairs), in either direction? Below the conventional α = .05, the result is called statistically significant.

If music made no difference to pain ratings, a U at least this far from 450, in either direction, would turn up about 1.8% of the time, roughly 1 in 56. That's below .05, so it's significant.

This page's p comes from the normal approximation with the tie correction and no continuity correction, which is what SPSS reports and what the R and Python code below asks for. Software defaults differ. Since version 4.6.0, R computes an exact p that allows for ties by default in samples this size (.017 here); older R, and SciPy with ties like these, use the normal approximation with a continuity correction (.018). An exact *p* skips the bell curve: it reshuffles the group labels every possible way and counts how often U lands at least this far from 450. A continuity correction moves U half a step toward 450 before computing z, because U moves in steps but the curve is smooth. With 30 per group the three agree closely; in small samples (roughly under 20 per group) prefer the exact p. Whichever you use, say so.

Strictly, the test's null hypothesis is that the two groups' scores come from identical distributions. It's built to detect one group tending to score higher, not a difference in medians. When the two groups' spreads and shapes are similar, a significant result says one group tends to score higher; when they clearly differ, the difference in spread alone can make the test significant (Fagerland & Sandvik, 2009). And it's a difference in medians only if the distributions have the same shape and spread (Divine et al., 2018).

p is not the probability that the null hypothesis is true, and it says nothing about how large or important the difference is. That's what the effect size is for.

Benchmarks p at a Glance
Very Strong
p < .001
Strong
.001 ≤ p < .01
Significant
.01 ≤ p < .05
Weak
.05 ≤ p < .10
Little
p ≥ .10

Strength of evidence against the null hypothesis.

Full benchmarks and caveats ↑

Power and Sample Size

Power is the chance that a study detects an effect that's really there. A real effect doesn't guarantee a significant result: with too few people, it can easily come out non-significant. Power depends on four things: how big the true effect is, how many people you have in each group, α, and whether the test is one- or two-sided.

Suppose, before collecting any data, we thought music listeners would report more pain in only 35% of pairings (a rank-biserial correlation of −.30). Noether's (1987) formula says we'd need about 118 people, 59 per group, for 80% power. With the 30 per group we actually had, power would have been about 52%, a coin flip.

When the scores are roughly normal, this test needs only about 5% more people than a t-test for the same power, and for continuous scores it never needs more than about 16% more (Hodges & Lehmann, 1956); with heavy tails or outliers it can need far fewer. So a rough plan is to size the study as for a t-test and add about 16%. Ratings with many ties can lose a little more, so round up.

Researchers usually aim for at least 80% power. Plan it before collecting data, using the smallest effect that would matter. The calculator below does that sizing for you: set Cohen's d as if the scores were normal, and it assumes the worst-case efficiency, so for roughly normal scores its answer runs a few people high. Under normal scores, the rrb of −.30 above is about d = 0.55, and the calculator gives about 62 per group for it, a little more than Noether's 59. Try it:

Other Info

Follow-Up and Post Hoc Tests

None needed. This test answers a single question, so there are no planned contrasts or post hoc tests to run.

References

  • Mann, H. B., & Whitney, D. R. (1947). On a test of whether one of two random variables is stochastically larger than the other. The Annals of Mathematical Statistics, 18(1), 50–60. https://doi.org/10.1214/aoms/1177730491
    “A statistic U depending on the relative ranks of the x's and y's is proposed for testing the hypothesis f = g.” (Abstract)
  • Divine, G. W., Norton, H. J., Barón, A. E., & Juarez-Colunga, E. (2018). The Wilcoxon–Mann–Whitney procedure fails as a test of medians. The American Statistician, 72(3), 278–286. https://doi.org/10.1080/00031305.2017.1305291
    “Several counter-examples (real and constructed) are presented, all demonstrating that the WMW procedure fails to be a test of medians.” (Abstract)
  • Hart, A. (2001). Mann-Whitney test is not just a test of medians: Differences in spread can be important. BMJ, 323(7309), 391–393. https://doi.org/10.1136/bmj.323.7309.391
    “The test can detect differences in shape and spread as well as just differences in medians.” (Summary points)
  • Fagerland, M. W., & Sandvik, L. (2009). The Wilcoxon–Mann–Whitney test under scrutiny. Statistics in Medicine, 28(10), 1487–1497. https://doi.org/10.1002/sim.3561
    “small differences in variances and moderate degrees of skewness can produce large deviations from the nominal type I error rate” (Abstract)
  • Brunner, E., & Munzel, U. (2000). The nonparametric Behrens-Fisher problem: Asymptotic theory and a small-sample approximation. Biometrical Journal, 42(1), 17–25. https://doi.org/10.1002/(SICI)1521-4036(200001)42:1<17::AID-BIMJ17>3.0.CO;2-U
  • Hodges, J. L., Jr., & Lehmann, E. L. (1956). The efficiency of some nonparametric competitors of the t-test. The Annals of Mathematical Statistics, 27(2), 324–335. https://doi.org/10.1214/aoms/1177728261
    “its asymptotic Pitman efficiency, relative to the t-test, never falls below 0.864” (Abstract)
  • Noether, G. E. (1987). Sample size determination for some common nonparametric tests. Journal of the American Statistical Association, 82(398), 645–647. https://doi.org/10.1080/01621459.1987.10478478
  • McGraw, K. O., & Wong, S. P. (1992). A common language effect size statistic. Psychological Bulletin, 111(2), 361–365. https://doi.org/10.1037/0033-2909.111.2.361
  • Vargha, A., & Delaney, H. D. (2000). A critique and improvement of the CL common language effect size statistics of McGraw and Wong. Journal of Educational and Behavioral Statistics, 25(2), 101–132. https://doi.org/10.3102/10769986025002101
  • Kerby, D. S. (2014). The simple difference formula: An approach to teaching nonparametric correlation. Comprehensive Psychology, 3, Article 11.IT.3.1. https://doi.org/10.2466/11.IT.3.1
  • Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.
  • Muff, S., Nilsen, E. B., O'Hara, R. B., & Nater, C. R. (2022). Rewriting results sections in the language of evidence. Trends in Ecology & Evolution, 37(3), 203–210. https://doi.org/10.1016/j.tree.2021.10.009
    “we suggest language of evidence that allows for a more nuanced approach to communicate scientific findings as a simple and intuitive alternative to statistical significance testing” (Abstract)
  • Kruskal, W. H., & Wallis, W. A. (1952). Use of ranks in one-criterion variance analysis. Journal of the American Statistical Association, 47(260), 583–621. https://doi.org/10.1080/01621459.1952.10483441
    “The only assumptions underlying the use of ranks made in this paper are that the observations are all independent, that all those within a given sample come from a single population, and that the C populations are of approximately the same form.” (p. 585)

Spot an error? Something still confusing? Tell us at support@statsforpsychology.com.