Friedman test
Compares a skewed measurement or an ordered score across three or more conditions in the same patients, using ranks.
Clinical example
A pain score from 0 to 10 recorded in the same patients under three different analgesic regimens in a crossover study.
When to use it
- The same patients are measured three or more times, or under three or more conditions.
- The outcome is an ordered score or a skewed measurement.
- Every patient has a value for every condition, and you don't need to adjust for other variables.
Assumptions to check
Related groups
The same patients, or matched sets, appear in every condition.
Complete data
Every patient needs a value in every condition. The Skillings–Mack test copes with missing values.
Check first
- With covariates or missing visits, use a GLMM or GEE instead
What to report
- Median (IQR) at each condition
Common mistakes
Kruskal–Wallis, which assumes independent groups
Alternatives
| If your situation is… | Use |
|---|---|
| The outcome is roughly normal | Linear mixed model |
| The outcome is yes or no in the same patients | Cochran's Q test |
| You need covariates, or visits are missing | GEE and mixed-effects logistic regression |
In your software
# R (long format: one row per patient and condition)
friedman.test(pain ~ regimen | patient_id, data = d_long)
* Wide format: one variable per condition.
NPTESTS
/RELATED TEST (pain_a pain_b pain_c) FRIEDMAN(COMPARE=PAIRWISE).