Friedman Test Calculator

Non-parametric repeated measures test.

Enter data for each condition. Each row should have one value per subject (same number of values in each condition).

Example:

Enter at least 3 conditions with equal number of values

Use the Friedman test when you want to compare three or more treatments or conditions, but the same people (or matched subjects) experience all of them. For example, if you had patients rate their pain after trying three different medications, or judges score the same set of products, this test tells you whether the conditions produce genuinely different resultsβ€”without requiring your data to follow a normal distribution.

What Is the Friedman Test?

The Friedman test is the non-parametric alternative to repeated measures ANOVA. It compares three or more related groups (same subjects measured under different conditions).

Question answered: "Do treatments/conditions have different effects when the same subjects experience all conditions?"

Examples:

  • Compare pain levels under 3 different medications (each patient tries all 3)
  • Rate 4 products by the same panel of judges
  • Measure performance at 5 time points for the same subjects

How It Works

Step 1: Arrange Data in Blocks

Each subject (block) experiences all conditions:

SubjectCondition ACondition BCondition C
1859088
2727875
39195100
4687074

Step 2: Rank Within Each Subject

Rank from 1 (lowest) to k (highest) within each row:

SubjectRank ARank BRank C
1132
2132
3123
4123

Step 3: Sum Ranks for Each Condition

  • RA=1+1+1+1=4R_A = 1 + 1 + 1 + 1 = 4
  • RB=3+2+2+2=9R_B = 3 + 2 + 2 + 2 = 9
  • RC=2+3+3+3=11R_C = 2 + 3 + 3 + 3 = 11

Step 4: Calculate Test Statistic

Ο‡F2=12nk(k+1)βˆ‘j=1kRj2βˆ’3n(k+1)\chi^2_F = \frac{12}{nk(k+1)} \sum_{j=1}^{k} R_j^2 - 3n(k+1)

Where:

  • n = number of subjects (blocks)
  • k = number of conditions
  • RjR_j = sum of ranks for condition j

Ο‡F2=124Γ—3Γ—4(16+81+121)βˆ’3Γ—4Γ—4\chi^2_F = \frac{12}{4 \times 3 \times 4}(16 + 81 + 121) - 3 \times 4 \times 4

=1248(218)βˆ’48=54.5βˆ’48=6.5= \frac{12}{48}(218) - 48 = 54.5 - 48 = 6.5

Step 5: Determine P-Value

Compare to chi-square distribution with kβˆ’1k - 1 degrees of freedom.

For Ο‡F2=6.5\chi^2_F = 6.5, df = 2: p=0.039p = 0.039

Conclusion: Significant difference between conditions (p=0.039p = 0.039).

Handling Ties

When values are tied within a subject, assign average ranks.

SubjectABCRank ARank BRank C
18080901.51.53

Apply tie correction to the test statistic if ties are common.

Post-Hoc Tests

A significant Friedman test indicates at least one condition differs, but not which ones.

Nemenyi Test

The most common post-hoc procedure:

Critical difference: CD=qΞ±k(k+1)6nCD = q_\alpha \sqrt{\frac{k(k+1)}{6n}}

Compare pairwise rank sum differences to CD.

Conover Test

More powerful alternative using t-distribution.

Wilcoxon Signed-Rank Tests with Bonferroni

Perform pairwise Wilcoxon tests, adjusting Ξ± for multiple comparisons.

Effect Size

Kendall's W (Coefficient of Concordance)

W=Ο‡F2n(kβˆ’1)W = \frac{\chi^2_F}{n(k-1)}

WInterpretation
0No agreement/effect
0.1Small
0.3Medium
0.5Large
1Perfect agreement

From our example: W=6.5/(4Γ—2)=0.81W = 6.5 / (4 \times 2) = 0.81 (large effect)

Comparison with Repeated Measures ANOVA

AspectRM ANOVAFriedman
AssumptionNormality, sphericityNone
Data typeContinuousOrdinal or continuous
AnalyzesMeansRanks (medians)
Power (normal data)Higher~90% of ANOVA
OutliersSensitiveRobust

Assumptions

Related Groups

Same subjects measured under all conditions (or matched subjects).

Independent Blocks

Different subjects are independent of each other.

Ordinal Scale (Minimum)

Data can be meaningfully ranked within each subject.

Similar Distribution Shape

Conditions should have similarly shaped distributions.

Example: Complete Analysis

Scenario: 8 judges rate 4 wines on a 0-100 scale.

JudgeWine AWine BWine CWine D
172857882
268907588
375828085
470887284
565807078
678928288
772857680
868877483

Rank within each judge:

JudgeRank ARank BRank CRank D
11423
21423
31324
41423
51423
61423
71423
81423

Rank sums: A = 8, B = 31, C = 16, D = 25

Ο‡F2=128Γ—4Γ—5(64+961+256+625)βˆ’3Γ—8Γ—5\chi^2_F = \frac{12}{8 \times 4 \times 5}(64 + 961 + 256 + 625) - 3 \times 8 \times 5

=12160(1906)βˆ’120=142.95βˆ’120=22.95= \frac{12}{160}(1906) - 120 = 142.95 - 120 = 22.95

P-value: p<0.0001p < 0.0001

Kendall's W: 22.95/(8Γ—3)=0.9622.95 / (8 \times 3) = 0.96

Conclusion: Highly significant difference in wine ratings (Ο‡F2=22.95\chi^2_F = 22.95, p<0.0001p < 0.0001). Very high agreement among judges (W=0.96W = 0.96).

Applications

Medical Research

  • Crossover drug trials
  • Repeated measures with ordinal outcomes
  • Quality of life assessments over time

Psychology

  • Within-subject experiments
  • Rating studies
  • Repeated testing

Sensory Evaluation

  • Panel testing of products
  • Taste tests
  • Quality comparisons

Education

  • Student performance across multiple tests
  • Course evaluation comparisons

Common Mistakes

Using for Independent Groups

Friedman is for related groups. Use Kruskal-Wallis for independent groups.

Ranking Across All Data

Ranks should be assigned within each subject, not across the entire dataset.

Ignoring Post-Hoc Tests

A significant result requires follow-up tests to identify which conditions differ.

Small Sample Sizes

With few subjects (n < 10), consider exact p-values rather than chi-square approximation.

Reporting Results

APA format:

"A Friedman test showed a significant difference in wine ratings across the four wines, χ²(3) = 22.95, p < .001, W = .96. Post-hoc Nemenyi tests indicated that Wine B was rated significantly higher than Wine A (p < .001) and Wine C (p = .02), while Wine D was rated higher than Wine A (p = .01)."

Historical Context

Milton Friedman (the economist, not to be confused with the test) developed this test in 1937 as part of his work on rank methods in statistics.

The test extended the Wilcoxon signed-rank concept to multiple related groups, providing a non-parametric alternative to repeated measures ANOVA.

Extensions

Page's Test

When conditions have a predicted order (e.g., dose-response), Page's test is more powerful than Friedman's.

Durbin Test

For incomplete block designs where not every subject experiences every condition.

Related Calculations

Summary

The Friedman test compares three or more related groups without assuming normality. Rank observations within each subject, sum ranks for each condition, and calculate the chi-square statistic. Significant results require post-hoc tests (Nemenyi or Conover) to identify which conditions differ. Report Kendall's W as the effect size. Use it for repeated measures with ordinal data or when normality is violated. The test is robust to outliers and works with any distribution shape.