- The Friedman test compares three or more related conditions measured on the same subjects — it is the non-parametric alternative to repeated measures ANOVA.
- Use it when your outcome is ordinal, or when it's continuous but the differences between conditions aren't normally distributed.
- The test ranks each subject's own scores across conditions (1 to k, within-subject), then compares how those ranks are distributed across conditions overall.
- Unlike repeated measures ANOVA, the Friedman test carries no sphericity assumption — its rank-based structure sidesteps that requirement entirely.
- A significant result only shows at least one condition differs — pairwise post hoc comparisons, corrected for multiple testing, are needed to find out which ones.
What Is the Friedman Test?
The Friedman test is a non-parametric statistical test that compares three or more related measurements — the same outcome recorded under three or more conditions or time points on the same subjects. It was developed by economist Milton Friedman in 1937 as a rank-based method for detecting consistent differences across repeated conditions, without requiring the normality assumptions that repeated measures ANOVA depends on.
Mechanically, the test ranks each subject's own scores across the conditions being compared — for a subject measured under three conditions, their three scores are ranked 1, 2, and 3 relative to each other, regardless of the raw numeric values. These within-subject ranks are then summed for each condition across all subjects; if the conditions truly don't differ, each condition should accumulate roughly similar rank totals. A large imbalance between the conditions' rank totals produces the test's chi-square statistic and, from it, a p-value.
Instead of asking "do the condition means differ?" (repeated measures ANOVA's question), the Friedman test asks "if I rank each patient's own scores from lowest to highest across the conditions, does one condition consistently end up ranked higher or lower than the others?" — a question that doesn't require normally distributed differences to answer validly.
When Should You Use the Friedman Test?
The Friedman test is the correct choice when your study meets these conditions:
- The same subjects are measured under three or more related conditions or time points.
- Your outcome is ordinal — a severity grade, a pain rating, a similar ranked scale.
- Your outcome is continuous but the differences between conditions are not normally distributed, ruling out repeated measures ANOVA.
- Your sample is small, making the Central Limit Theorem an unreliable rescue for non-normal continuous data.
If your outcome is continuous and its differences across conditions are approximately normal, repeated measures ANOVA remains the more statistically powerful choice — the Friedman test is a fallback for when that assumption fails, not an automatically safer default regardless of your data.
Repeated or Matched Observations Across Three or More Conditions
The Friedman test requires a within-subject (or within-block) design: each subject, or each matched set of subjects, contributes exactly one score to every condition being compared. The most common version is literally the same patient measured three or more times — a crossover trial, or symptom scores tracked across three treatment phases. A less common but equally valid version uses matched blocks: sets of different subjects deliberately matched on key characteristics (age, disease stage, baseline severity), with one matched subject contributing to each condition.
What both versions share is the core requirement: every "block" (whether a single repeated subject or a matched set) has exactly one value per condition, allowing that block's own scores to be ranked against each other before any comparison is made across blocks.
Friedman Test vs Repeated Measures ANOVA
| Feature | Repeated Measures ANOVA | Friedman Test |
|---|---|---|
| Data type | Continuous, normally distributed differences | Continuous (non-normal) or ordinal |
| What is compared | Condition means | Condition mean ranks (within-subject) |
| Sphericity assumption | Required with 3+ conditions | Not required — rank-based structure avoids it |
| Test statistic | F | Chi-square (χ²) |
| Typical post hoc | Bonferroni-corrected pairwise t-tests | Pairwise Wilcoxon signed-rank tests, corrected |
Assumptions and Requirements
Three or more related conditions
The same subjects (or matched blocks) contribute a score to every condition being compared.
At least ordinal measurement
Scores must be capable of being ranked within each subject across conditions.
Independence between subjects (or blocks)
One subject's set of scores shouldn't influence another subject's.
Complete data
Every subject needs a value for every condition — the standard test cannot handle a subject missing one condition.
Adequate sample size
A commonly cited guideline is at least 10 subjects for the chi-square approximation to behave reasonably well, particularly with only three conditions.
Notice what's absent from this list: there is no normality requirement, and no sphericity requirement — this is exactly why the Friedman test exists as the non-parametric counterpart to repeated measures ANOVA.
How to Arrange Within-Subject Data
Like other repeated-measures tests, the Friedman test needs wide format: one row per subject, with one column for each condition.
| Patient ID | Placebo (NRS Pain) | Triptan (NRS Pain) | New Drug (NRS Pain) |
|---|---|---|---|
| 001 | 8 | 5 | 2 |
| 002 | 6 | 4 | 1 |
| 003 | 7 | 3 | 3 |
| ... | ... | ... | ... |
Confirm every subject has a value in every condition column before analysis — a subject missing any one condition must be excluded under the standard Friedman test, and the number of subjects excluded should be reported explicitly.
A Realistic Medical Example
A headache clinic runs a crossover study in 20 patients with chronic migraine, each patient trying three treatment phases in randomized order with a washout period between phases: placebo, a standard triptan, and a new preventive drug. Pain is rated on a 0–10 Numeric Rating Scale (NRS) at the end of each phase — an ordinal outcome, making the Friedman test the appropriate choice.
| Condition | Median NRS Pain | IQR |
|---|---|---|
| Placebo | 7 | 6–8 |
| Standard Triptan | 4 | 3–5 |
| New Preventive Drug | 2 | 1–3 |
Pain scores drop clearly from placebo to the standard triptan, and drop further still with the new drug — a consistent, stepwise pattern across the three phases that the Friedman test, followed by post hoc comparisons, will formally confirm.
Step-by-Step Analysis Using StatClinic
Enter your data in wide format
One row per patient, with a column for each of the three treatment phases.
Confirm your study design
Tell StatClinic these are repeated measurements on the same subjects across three related conditions.
Let StatClinic check the outcome and distribution
StatClinic recognizes ordinal data automatically, or checks normality of the differences for continuous outcomes.
Accept the recommended test
StatClinic recommends the Friedman test when the outcome is ordinal or normality is violated, or you can select it directly.
Review the full output
You'll get the chi-square statistic, degrees of freedom, p-value, medians for each condition, and Kendall's W effect size.
Run post hoc comparisons automatically
If the omnibus result is significant, StatClinic runs corrected pairwise comparisons and generates ready-to-use Methods and Results text.
You can also run the calculation directly with the Friedman Test Calculator once your condition data are ready.
Interpreting the Test Statistic, Degrees of Freedom, P Value, Ranks, Medians, and Effect Size
For the migraine example, StatClinic's output might read: χ²(2) = 32.1, N = 20, p < .001, Kendall's W = 0.80.
| Output | What It Tells You |
|---|---|
| Chi-square statistic (χ²) | A summary of how unevenly the within-subject ranks are distributed across conditions — larger values indicate a stronger pattern |
| Degrees of freedom (df) | Number of conditions minus 1 — here, 3 conditions − 1 = 2 |
| P-value | The probability of seeing this much rank imbalance (or more) if there were truly no systematic difference between conditions |
| Mean ranks / medians (each condition) | The actual clinical quantities of interest — always report medians alongside the p-value, never instead of it |
| Effect size (Kendall's W) | Ranges 0–1; roughly 0.1 small, 0.3 moderate, 0.5+ large — a different scale from eta-squared |
Put together: the p-value confirms the differences across the three phases are very unlikely to be due to chance; the medians (7 → 4 → 2) show a clear, stepwise reduction in pain; and Kendall's W = 0.80 confirms strong, consistent agreement across patients about the ranking of the three conditions — a large effect. What this omnibus result does not tell you is which specific pairs of conditions differ significantly, which is exactly what the post hoc step addresses next.
Appropriate Post Hoc Pairwise Comparisons
A significant Friedman test means at least one condition differs from the others — it does not specify which pair. The most common and accessible follow-up is a set of pairwise Wilcoxon signed-rank tests, comparing each pair of conditions using that pair's own ranked differences. A specialized alternative, the Nemenyi test, stays closer to the Friedman test's original combined rank structure and is also widely accepted, though less commonly available in standard software than pairwise Wilcoxon comparisons.
Placebo vs Triptan: p < .001. Placebo vs New Drug: p < .001. Triptan vs New Drug: p = .002. All three pairwise comparisons are significant after correction, confirming each treatment phase differs meaningfully from the others, with the new drug producing the greatest reduction.
Multiple-Comparison Correction
With three conditions, there are 3 possible pairwise comparisons, following k(k−1)/2; with four conditions there would be 6. Because several comparisons are drawn from the same dataset, a correction is required to control the overall false-positive rate. Bonferroni (dividing the significance threshold by the number of comparisons) is the most common and conservative choice; the Benjamini-Hochberg procedure is a widely accepted, less conservative alternative that controls the false discovery rate instead.
How to Report the Methods and Results
A complete report states the test used, why it was chosen, the descriptive statistics for every condition, and the full inferential result including post hoc comparisons.
"Pain scores (0–10 NRS) were compared across three treatment phases (placebo, standard triptan, and the new preventive drug) using the Friedman test, as the outcome was ordinal and the assumption of normally distributed differences required for repeated measures ANOVA was not appropriate."
"Pain scores differed significantly across the three treatment phases, χ²(2) = 32.1, N = 20, p < .001, Kendall's W = 0.80. Median pain score was highest during placebo (7, IQR 6–8), lower during triptan treatment (4, IQR 3–5), and lowest during the new drug phase (2, IQR 1–3). Wilcoxon signed-rank post hoc comparisons with Bonferroni correction showed significant differences between all three pairs of conditions (all p < .01)."
Common Mistakes
Mistake 1: Running Multiple Wilcoxon Tests Without an Omnibus Test First
Comparing every pair of conditions directly with Wilcoxon signed-rank tests, skipping the Friedman test entirely and inflating the false-positive rate.
Mistake 2: Using the Friedman Test for Independent Groups
Applying the Friedman test to three or more unrelated groups of different subjects rather than repeated measurements on the same subjects.
Mistake 3: Reporting Means and SDs With a Rank-Based Test
Presenting condition means and standard deviations alongside a test that is actually based on within-subject ranks.
Mistake 4: Skipping the Multiple-Comparison Correction
Reporting uncorrected pairwise p-values from post hoc testing, overstating confidence in the specific pairwise findings.
Mistake 5: Silently Dropping Subjects With Missing Conditions
Excluding subjects missing one condition without reporting how many were dropped, obscuring the actual analyzed sample size.
Mistake 6: Confusing Kendall's W With Eta-Squared Benchmarks
Applying the 0.01/0.06/0.14 eta-squared thresholds to Kendall's W, which uses a different 0–1 scale with different conventional cutoffs.
"Pain scores differed across treatment phases (p < .001), so every phase differs significantly from every other phase."
"χ²(2) = 32.1, p < .001; Wilcoxon post hoc comparisons with Bonferroni correction confirmed all three pairwise differences were significant (all p < .01)."
Frequently Asked Questions
Related Articles
Once your Friedman test is run, these guides take you through the surrounding decisions:
Ready to Run Your Friedman Test?
Let StatClinic's AI Statistical Assistant confirm the right test, run your analysis, and write your results sentence. Free, no registration required.
Try StatClinic Free →