Friedman test
Ranks (nonparametric) · Three or more repeated measures · reference distribution: χ²(k−1)
When to use it
Compare three or more conditions measured on the same individuals without assuming normality.
Null hypothesis
The conditions have the same distribution.
Assumptions
- Independent blocks (individuals)
- At least ordinal variable
Test statistic
\chi^2_F = \dfrac{12}{nk(k+1)} \sum_j R_j^2 - 3n(k+1)Effect size
Kendall’s W: the agreement among blocks, from 0 to 1.
W = \dfrac{\chi^2_F}{n(k - 1)}How to report it
χ²F(2) = 9.10, p = .011, Kendall’s W = .23
In R and Python
friedman.test(y ~ time | id, data = df)
stats.friedmanchisquare(t1, t2, t3)
In Python, stats is scipy.stats and np is numpy.
Variants and alternatives
- Nemenyi or Conover post hoc test
- Parametric version: Repeated measures ANOVA
Where it sits in the catalog
Ranks (nonparametric). Nonparametric tests assume no distribution for the data. They replace each value by its rank, its position in order (1st, 2nd, 3rd…), which protects them from extreme values and makes them fit ordinal data.
Three or more repeated measures. The same individuals measured under three or more conditions or time points: the paired design with more than two measurements.
In the decision tree
- What do you want to do? Compare groups, or one group with a reference value
- What kind of response did you measure? Numeric: a measurement, such as weight, time or score
- How many groups or measurements? Three or more groups
- Are the groups made of different individuals or the same individuals? The same individuals, under several conditions or time points
- Are the residuals approximately normal? No, or the response is ordinal