Launch StatClinic →
Statistical Tests

How to Perform the Friedman Test in Clinical Research

📖 13 min read 🗓 July 2026 ✓ Updated July 2026
S
StatClinic Editorial Team Statistical content for medical researchers and clinicians
Crossover trials, symptom scores tracked across multiple treatment phases, and repeated ordinal ratings on the same patients are common in clinical research — but when the same subjects are measured under three or more related conditions and the outcome is ordinal or doesn't follow a normal distribution, repeated measures ANOVA isn't the right tool. The Friedman test is the non-parametric method built exactly for this situation. This guide is a complete, standalone walkthrough covering everything from the underlying logic to a full worked example, a StatClinic walkthrough, and exactly how to interpret and report your results — no other reading required first.
Key Takeaways
  • 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.

In Plain Terms

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:

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

FeatureRepeated Measures ANOVAFriedman Test
Data typeContinuous, normally distributed differencesContinuous (non-normal) or ordinal
What is comparedCondition meansCondition mean ranks (within-subject)
Sphericity assumptionRequired with 3+ conditionsNot required — rank-based structure avoids it
Test statisticFChi-square (χ²)
Typical post hocBonferroni-corrected pairwise t-testsPairwise Wilcoxon signed-rank tests, corrected
Take-Home Points When normality genuinely holds, repeated measures ANOVA has more statistical power and avoids the need to worry about sphericity corrections in the first place. When it doesn't, the Friedman test is the valid, sphericity-free alternative.

Assumptions and Requirements

1

Three or more related conditions

The same subjects (or matched blocks) contribute a score to every condition being compared.

2

At least ordinal measurement

Scores must be capable of being ranked within each subject across conditions.

3

Independence between subjects (or blocks)

One subject's set of scores shouldn't influence another subject's.

4

Complete data

Every subject needs a value for every condition — the standard test cannot handle a subject missing one condition.

5

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 IDPlacebo (NRS Pain)Triptan (NRS Pain)New Drug (NRS Pain)
001852
002641
003733
............

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.

ConditionMedian NRS PainIQR
Placebo76–8
Standard Triptan43–5
New Preventive Drug21–3
What This Pattern Suggests

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

1

Enter your data in wide format

One row per patient, with a column for each of the three treatment phases.

2

Confirm your study design

Tell StatClinic these are repeated measurements on the same subjects across three related conditions.

3

Let StatClinic check the outcome and distribution

StatClinic recognizes ordinal data automatically, or checks normality of the differences for continuous outcomes.

4

Accept the recommended test

StatClinic recommends the Friedman test when the outcome is ordinal or normality is violated, or you can select it directly.

5

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.

6

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.

OutputWhat 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-valueThe 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.

Post Hoc Results (Example)

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.

Caution Running pairwise Wilcoxon tests without any correction — treating each comparison as if it were the only test performed — inflates the overall chance of a false-positive finding across the full set of comparisons.

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.

Sample Methods Text

"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."

Sample Results Text

"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.

✓ Fix: Run the Friedman test first, and only follow up with pairwise comparisons if the omnibus result is significant.

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.

✓ Fix: For independent groups, use the Kruskal-Wallis test instead.

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.

✓ Fix: Report medians and IQRs for each condition to match what the test itself evaluated.

Mistake 4: Skipping the Multiple-Comparison Correction

Reporting uncorrected pairwise p-values from post hoc testing, overstating confidence in the specific pairwise findings.

✓ Fix: Apply and report a correction (Bonferroni or Benjamini-Hochberg) for every set of post hoc comparisons.

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.

✓ Fix: Report the number of subjects excluded for incomplete data across the conditions.

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.

✓ Fix: Use Kendall's W-specific benchmarks (roughly 0.1 small, 0.3 moderate, 0.5+ large) when interpreting this effect size.
❌ Incorrect

"Pain scores differed across treatment phases (p < .001), so every phase differs significantly from every other phase."

✅ Correct

"χ²(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

What is the null hypothesis of the Friedman test? +
The null hypothesis is that there's no systematic difference between the conditions — that ranks within each subject are distributed randomly across conditions. The alternative is that at least one condition systematically differs, though the omnibus test alone doesn't identify which one.
When should I use the Friedman test instead of repeated measures ANOVA? +
Use it when the same subjects are measured under three or more related conditions and either the outcome is ordinal, or the differences between conditions aren't normally distributed. If normality holds, repeated measures ANOVA remains more statistically powerful.
Can the Friedman test handle missing data? +
No, not directly. The standard test requires complete data — every subject needs a value for every condition. A subject missing even one condition is typically excluded entirely, and this should be reported explicitly.
What is the difference between the Friedman test and the Kruskal-Wallis test? +
Friedman compares three or more related conditions on the same subjects, ranking each subject's own scores. Kruskal-Wallis compares three or more independent groups, ranking all observations across the combined sample. Using the wrong one mismatches the actual study design.
What effect size should I report for the Friedman test? +
Kendall's W (coefficient of concordance), ranging 0 to 1. Rough benchmarks treat around 0.1 as small, 0.3 as moderate, and 0.5 or above as large — a different scale from eta-squared, so don't compare the two directly.
What post hoc test should I use after a significant Friedman test? +
Pairwise Wilcoxon signed-rank tests with a correction (commonly Bonferroni) are the most accessible approach. The Nemenyi test is a specialized alternative that stays closer to the Friedman test's combined rank structure.
How many time points or conditions do I need for the Friedman test? +
A minimum of three related conditions. With only two, the analysis reduces to a Wilcoxon signed-rank test. There's no strict upper limit, though more conditions mean more post hoc comparisons and greater subject burden.
Does the Friedman test require sphericity? +
No. Sphericity is specific to repeated measures ANOVA. Because the Friedman test works entirely on within-subject ranks rather than raw differences, it doesn't carry a sphericity assumption at all — one of its main practical advantages.
Can the Friedman test be used for ordinal data? +
Yes, and this is one of its most common uses. It only requires the outcome can be ranked within each subject across conditions, making it well suited to ordinal scales like symptom severity or pain ratings.
How do I report the Friedman test in APA format? +
A typical report includes chi-square, degrees of freedom, sample size, p-value, and effect size, written as: χ²(2) = 32.1, N = 20, p < .001, Kendall's W = 0.80 — paired with the median and IQR for each condition in the surrounding sentence.

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 →