Unit 9 · Same people, several times
How to run a Wilcoxon signed-rank test in SPSS
Run a Wilcoxon signed-rank test in SPSS for related samples, read the ranks and report z, p, medians and effect size r.
Quick answer: How do you run a Wilcoxon signed-rank test in SPSS?
- Click Analyze › Nonparametric Tests › Legacy Dialogs › 2 Related Samples.
- Move the two related variables into the same pair.
- Keep Wilcoxon ticked and click OK.
Report it in APA style: Pain fell from before (Mdn = 6) to after treatment (Mdn = 4), z = −2.87, p = .004, r = .64.
What is the Wilcoxon signed-rank test?
The Wilcoxon signed-rank test is the non-parametric alternative to the paired t-test. It compares two related measurements, such as pain before and after treatment, using the ranks of the differences.
When to use it
- Two related measurements from the same people (or matched pairs).
- Ordinal data, or difference scores that are clearly non-normal.
How it works
SPSS works out each person’s difference, drops zero differences (ties), ranks the rest by size ignoring the sign, then compares the total of the positive ranks with the total of the negative ranks. If there were no real change, the two totals would be similar. The result is given as z, and r = |z| ÷ √N is a common effect size.
Assumptions
- Paired observations.
- Ordinal or Scale outcome.
- Differences roughly symmetrical around the median.
Worked example
Pain fell from Mdn = 6 to Mdn = 4 after treatment, z = −2.87, p = .004, r = .64. 15 of 20 patients improved.
Key terms
- Signed rank
- A difference’s rank, given the sign of the difference.
- Ties
- Pairs with no change; excluded from the test.
Common mistakes
- Using Mann-Whitney for paired data.
- Reporting means instead of medians.
How to do it in SPSS
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
/WILCOXON=pain_pre WITH pain_post (PAIRED)
/STATISTICS QUARTILES.Practice data
Download the file used in this lesson and run it yourself in SPSS: you should get the same results as the screens above.
- pain.savPain ratings before and after treatment (N = 20)
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 6 quick questions, with instant feedback on every answer.
Practice for this lesson is part of Pro, with every unit, unlimited hearts and saved progress.