Unit 5 · Categories and non-parametrics

How to run a Mann-Whitney U test in SPSS

Run a Mann-Whitney U test in SPSS, read mean ranks and report U, z and effect size r.

Free tutorialPro practiceAbout 5 minutes7 practice questions

Quick answer: How do you run a Mann-Whitney U test in SPSS?

  1. Click Analyze › Nonparametric Tests › Legacy Dialogs › 2 Independent Samples.
  2. Move the outcome into Test Variable List and the group variable into Grouping Variable.
  3. Define the two groups, keep Mann-Whitney U ticked and click OK.

Report it in APA style: Students with a part-time job reported higher anxiety (Mdn = 6) than those without (Mdn = 4), U = 206.50, z = −2.42, p = .015, r = .34.

Last updated November 2026 · Not sure this is the right test? Try the Which statistical test? tool.

What is the Mann-Whitney U test?

The Mann-Whitney U test is the non-parametric alternative to the independent-samples t-test. It compares two independent groups using ranks instead of raw scores, so it doesn’t assume normality.

When to use it

  • Two independent groups.
  • An ordinal outcome, or a Scale outcome that is clearly non-normal or has outliers, especially with small groups.

How it works

All scores are ranked together from lowest to highest, ignoring group. If one group tends to score higher, its ranks will be higher. U counts how often a score in one group beats a score in the other. SPSS converts U to a z-score for the p-value, and r = |z| ÷ √N gives an effect size (.1 small, .3 medium, .5 large).

Assumptions

  • Independent groups and observations.
  • Ordinal or Scale outcome.
  • To interpret it as a difference in medians, the two distributions should have a similar shape.

Worked example

Students with a part-time job reported higher anxiety (Mdn = 6) than those without (Mdn = 4), U = 206.50, z = −2.42, p = .015, r = .34.

Key terms

Mean rank
Average rank in a group; higher means higher scores.
Median
The middle score, reported instead of the mean.
Effect size r
|z| ÷ √N.

Common mistakes

  • Reporting means and SDs instead of medians.
  • Using it for paired data (use Wilcoxon).

How to do it in SPSS

Mann-Whitney U

The nonparametric version of the independent-samples t-test. It compares the ranks of two groups instead of their means.

Two-Independent-Samples Tests
Variables
Participant ID [id]
Age in years [age]
▶
Test Variable List:1
Anxiety score [anxiety]
▶
Grouping Variable:2
job(1 2)
Exact…Options…
Test Type:3
✓Mann-Whitney U
Kolmogorov-Smirnov Z
Moses extreme reactions
OKPasteResetCancelHelp
  1. 1
    Test Variable ListThe outcome, often a skewed score or a rating scale.
  2. 2
    Grouping VariableDefine Groups works just like the t-test: enter the two codes.
  3. 3
    Mann-Whitney UTicked by default. Found under Analyze › Nonparametric Tests › Legacy Dialogs › 2 Independent Samples.

Reading Mann-Whitney output

First the Ranks table shows which group scored higher, then the Test Statistics table tells you if the difference is significant.

Output1 [Document1] – SPSS Statistics Viewer
FileEditViewDataTransformAnalyzeGraphsUtilitiesExtensionsWindowHelp
Output
Log
NPar Tests
Mann-Whitney Test
Ranks
Test Statistics
Ranks · anxiety
jobNMean Rank1Sum of Ranks
Part-time job2531.74793.50
No job2721.65584.50
Total52
Test Statistics
anxiety
Mann-Whitney U206.5002
Wilcoxon W584.500
Z−2.4223
Asymp. Sig. (2-tailed).0154

Grouping Variable: job · Medians: Part-time job 6, No job 4

  1. 1
    Mean RankHigher mean rank means higher scores. Students with a part-time job ranked higher on anxiety.
  2. 2
    Mann-Whitney UThe test statistic to report.
  3. 3
    ZUsed to work out the effect size r = |Z| ÷ √N.
  4. 4
    Asymp. Sig..015 is below .05, so the groups differ significantly.

Describe nonparametric results with medians, not means.

The SPSS syntax

Prefer typing to clicking? Open File › New › Syntax, paste this in, select it and choose Run › Selection. Every dialog's Paste button writes the same kind of code.

NPAR TESTS
  /M-W=anxiety BY job(1 2)
  /STATISTICS=QUARTILES.

Practice data

Download the file used in this lesson and run it yourself in SPSS. Your results will closely match the screens above, though a few numbers may differ slightly.

  • job_anxiety.savAnxiety for students with and without a part-time job (N = 52)

Now practise it interactively →

Reading is only half of it. Tap through the real SPSS menus, read the output and pick the right write-up in 7 quick questions, with instant feedback on every answer.

Practice for this lesson is part of Pro, with every unit, unlimited hearts and saved progress.

More in Categories and non-parametrics