The Friedman test answers one question: when the same people are measured under three or more conditions, do they tend to score some conditions higher than others? This guide explains how it works in plain language, how it is calculated, and how to run it in AnalyZ Solutions.
The Friedman test answers a simple question: when the same people are measured under three or more conditions, do they tend to score some conditions higher than others?
Suppose 30 respondents each rate three kinds of service, a home visit, a phone call and a clinic visit, from 1 to 7. Home visits seem to get the highest ratings. Is that a real pattern, or could it be chance? The test gives you a way to tell.
The usual way to compare repeated measurements is to compare their averages, and the standard test for that is repeated-measures ANOVA. It works well when the scores spread evenly around the average in a roughly bell-shaped pattern, and when the differences between each pair of conditions vary by about the same amount from person to person. It works badly in three common situations.
Instead of the exact scores, the test uses order within each person. For each person, it ranks their own scores across the conditions, which means giving each condition a position number: the one they rated lowest gets position 1, the next lowest position 2, and so on. It then adds up the positions each condition received across everyone. If the conditions were rated equally, the totals would be about the same. If one condition tends to be rated highest, its total pulls ahead. Because each person is ranked against themselves, a generous rater and a harsh rater count equally. For background on this whole family of tests, see What are non-parametric tests?
Suppose 30 respondents each rate three service types on a scale from 1 to 7. You want to know three things. Are the services rated differently? Which ones? And do respondents agree about the order? The Friedman test answers all three.
Use it when each person has been measured under three or more conditions, or at three or more points in time, and at least one of these is true:
Examples include satisfaction with three service types rated by the same respondents, symptom scores at three follow-up visits, and preference ratings given to four versions of a leaflet.
For two measurements on the same people, use the Wilcoxon signed-rank test. For a roughly bell-shaped outcome with an adequate sample, repeated-measures ANOVA is stronger. For separate groups, use the Kruskal-Wallis test. Unlike repeated-measures ANOVA, the Friedman test does not need the differences between pairs of conditions to vary evenly, a condition called sphericity. For help choosing between this test and ANOVA, see What are non-parametric tests?
Three ideas make the test work: each person rates every condition, each person's own scores are ranked, and the rank totals show whether the conditions differ.
The same people rate every condition, so each person supplies a set of scores that belong together. The data are arranged with one row per person and one column per condition.
A rank is a position number. For each person, rank their own scores from lowest to highest across the conditions. Then add up the ranks each condition receives across all people. Because each person is ranked separately, a generous rater and a harsh rater contribute equally, so differences in general scoring level between people drop out of the comparison.
If the conditions were rated equally, each would collect about the same rank total. If people tend to rank the conditions in the same order, the totals pull apart. Kendall's W describes how consistently people agreed on the order, from 0 for no agreement to 1 for complete agreement.
The calculation has four steps. The formulas are there for readers who want to check the arithmetic, and the worked example below follows every step with real numbers.
In symbols, with n respondents, k conditions and rank sums Rⱼ across the respondents:
Software applies a correction when there are tied scores. Kendall's W rescales the statistic to run from 0, when respondents rank the conditions in unrelated orders, to 1, when they all rank them identically.
Six respondents rate three services. Each respondent's scores are ranked across the services.
| Respondent | Service 1 | Service 2 | Service 3 | Ranks (1, 2, 3) |
|---|---|---|---|---|
| 1 | 5.2 | 6.1 | 7.3 | 1, 2, 3 |
| 2 | 4.1 | 5 | 6.2 | 1, 2, 3 |
| 3 | 6 | 5.5 | 7.8 | 2, 1, 3 |
| 4 | 3.9 | 4.8 | 6.5 | 1, 2, 3 |
| 5 | 5.5 | 6.9 | 7.1 | 1, 2, 3 |
| 6 | 4.7 | 5.9 | 6.8 | 1, 2, 3 |
| Rank sum | 7, 11, 18 |
Repeated-measures ANOVA is the standard test for comparing the average scores of the same people under three or more conditions.
| Feature | Repeated-measures ANOVA | Friedman test |
|---|---|---|
| What it uses | The exact scores | Each person's own ranking of the conditions |
| What it compares | The average score of each condition | Whether some conditions tend to be ranked higher |
| What it needs from the data | Scores that spread evenly around the average in a bell shape | No particular shape |
| Sphericity (differences between pairs of conditions vary evenly across people) | Assumed, and checked with Mauchly's W | Not needed |
| Measure of how big the effect is | Partial eta-squared | Kendall's W |
| Best for | Measured numbers that are roughly bell-shaped | Ratings, skewed scores and small samples |
Every test gives trustworthy results only when some conditions hold. These are called assumptions. For this test they are modest.
Only people with a value for every selected condition are included, so check how many complete cases remain.
The descriptive table lists, for each condition, the number of people, the median and the mean. The median is the middle value, so half the people score above it and half below. The mean is the ordinary average.
The output shows the chi-square statistic, the degrees of freedom, the significance level and the number of people. A significant result says that the conditions are not all rated equally, and that at least one differs from another. "Significant at the 5% level" means that if the conditions were truly rated the same, a pattern this strong would appear by luck in fewer than 5 samples out of 100.
Kendall's W runs from 0 to 1 and shows how consistently people ranked the conditions in the same order. A value near 1 means nearly everyone agreed on which condition ranked highest and lowest. A value near 0 means the rankings were scattered. AnalyZ Solutions labels W below 0.1 as weak, 0.1 to 0.3 as moderate, and above 0.3 as strong agreement.
When the overall test is significant, the module compares every pair of conditions using Wilcoxon signed-rank tests, with a Bonferroni adjustment. The adjustment multiplies each p-value by the number of comparisons, because the more pairs you compare, the more likely it is that one looks significant by luck alone. The p-values you see already include it.
Open Inferential Analysis, choose Non-parametric Tests, then Friedman Test.
The figures below are invented to show the steps, and they follow the results tables in AnalyZ Solutions, with a few columns left out to save space. Suppose 30 respondents each rated three service types from 1 to 7.
| Variable | N | Median | Mean |
|---|---|---|---|
| Home visit | 30 | 5.0 | 5.07 |
| Phone call | 30 | 5.0 | 4.60 |
| Clinic visit | 30 | 4.0 | 4.27 |
| Chi-square | df | p-value | Sig | Kendall's W | N |
|---|---|---|---|---|---|
| 11.0575 | 2 | 0.0040 | ** | 0.1843 | 30 |
| Variable 1 | Variable 2 | W | p (adjusted) | Sig |
|---|---|---|---|---|
| Home visit | Phone call | 42.0 | 0.1538 | ns |
| Home visit | Clinic visit | 43.5 | 0.0082 | ** |
| Phone call | Clinic visit | 57.0 | 0.3250 | ns |
Respondents rated home visits higher than clinic visits, and the difference is significant at the 1% level after adjusting for multiple comparisons. Phone calls fell between the two and were not clearly different from either. The agreement across respondents was moderate.
Using data with one row per rating. The module needs one column per condition and one row per person.
Treating it as a test for separate groups. The same people must appear in every condition.
Ignoring missing data. A person missing one condition is dropped completely, so many missing values shrink the sample quickly.
Confusing agreement with size of difference. Kendall's W shows how consistently people ranked the conditions, and not how far apart the conditions are in the raw scores.
Open Non-parametric Tests in AnalyZ Solutions. Free to sign up, free to analyze.
Get started