Friedman Test Calculator
Enter one line per subject with a value for each condition and this Friedman test calculator returns the tie-corrected chi-square statistic, degrees of freedom, p-value, Kendall's W and a decision at your chosen significance level.
Compare Three or More Related Conditions from Their Ranks
Friedman Test
Where:
- \(n\) — number of subjects (blocks)
- \(k\) — number of related conditions (\(k \ge 3\))
- \(R_j\) — sum of ranks of condition \(j\); each subject's values are ranked from 1 (smallest) to \(k\), with tied values receiving average ranks
- \(t\) — size of each group of tied values within a subject
- \(W\) — Kendall's coefficient of concordance, the effect size
The statistic compares the observed rank sums with the value expected when all conditions are equal, \(nk(k+1)/4\cdot 2\); large departures produce large \(\chi^2\). The tie correction inflates the statistic when ties are present, and the p-value is obtained from the \(\chi^2\) distribution with \(k-1\) degrees of freedom.
Friedman Test – Calculation Example
Example: eight subjects each rate three products on a scale (the default data in the calculator). Within each subject the three scores are ranked 1–3; the rank sums come out as \(R_1 = 21.5\), \(R_2 = 14.5\), \(R_3 = 12\).
\[ \chi_F^2 = \frac{12}{8 \cdot 3 \cdot 4}\left(21.5^2 + 14.5^2 + 12^2\right) - 3 \cdot 8 \cdot 4 = 6.0625 \]
One subject gave two equal scores, so one tie group of size \(t=2\) contributes \(t^3 - t = 6\) to the correction:
\[ C = 1 - \frac{6}{8(27 - 4 + -3)} = 1 - \frac{6}{192} = 0.96875, \qquad \chi^2 = \frac{6.0625}{0.96875} = 6.2581 \]
With \(df = k - 1 = 2\), the \(\chi^2\) approximation gives \(p = 0.0438\), and Kendall's \(W = 6.2581 / (8 \cdot 2) = 0.3911\).
Result: \(\chi^2 = 6.2581\), \(df = 2\), \(p = 0.0438\). At \(\alpha = 0.05\), reject \(H_0\): the three products differ significantly in location, with moderate agreement among subjects (\(W \approx 0.39\)).
How to Use the Calculator
- Paste or type your data into Measurements (one subject per line). Each line must hold one subject's values, one per condition, separated by spaces or semicolons — for example
7 6 5or7; 6; 5. Every line must contain the same number of values, at least three. - If your numbers use decimal commas (e.g.
7,5), you can enter them as-is; the calculator converts them automatically. - Choose a Significance level (0.10, 0.05, 0.025, 0.01 or 0.001) — this is the threshold \(\alpha\) used for the reject / fail-to-reject decision.
- Read the results: the tie-corrected Friedman statistic \(\chi^2\), the degrees of freedom, the p-value, Kendall's \(W\), the decision at \(\alpha\), a rank-sum table per condition, and a short written explanation.
What the Friedman Test Is
The Friedman test is a nonparametric alternative to the one-way repeated-measures ANOVA. It compares three or more related conditions — typically the same subjects measured under each condition, or a randomized block design in which each block receives every treatment — to test whether the conditions differ in location (whether scores tend to be systematically higher under some conditions than others).
The test works purely on ranks. Each subject's values are ranked within that subject, which strips out all subject-to-subject differences: a subject who rates everything high contributes the same rank pattern as one who rates everything low. If the conditions are identical, each condition's ranks are a random permutation of \(1, \dots, k\), so every condition's expected rank sum is \(n \cdot k(k+1)/2\). The Friedman statistic measures how far the observed rank sums deviate from this expectation: if one condition is consistently ranked highest, its rank sum is large, another's is small, and \(\chi^2\) grows.
The p-value comes from comparing the statistic with the \(\chi^2_{k-1}\) distribution. If \(p \le \alpha\), you reject the null hypothesis and conclude that at least one condition tends to be ranked higher or lower than the others — but not which one. Kendall's \(W = \chi^2 / (n(k-1))\) quantifies how consistent the subjects' orderings are: 0 means no agreement, 1 means every subject ranks the conditions in exactly the same order, and values around 0.3–0.5 are usually described as moderate agreement.
A significant result is only the first step. To find which conditions differ, follow up with pairwise comparisons: the Nemenyi test (a critical difference of \(q_\alpha\sqrt{k(k+1)/(6n)}\) on the mean ranks) or Wilcoxon signed-rank tests with a Bonferroni-adjusted significance level. If your groups are independent rather than matched, the Friedman test is the wrong tool — use the Kruskal–Wallis test instead.
Assumptions and Practical Tips
- Matched data: every subject (block) must have a value under every condition. Missing values cannot be handled — either drop the subject or impute the value before entering the data.
- Independent subjects: subjects/blocks must not influence each other, while the repeated measurements within a subject are of course related — that is the point of the test.
- Ordinal scale or better: the values only need to be rankable within each subject, so Likert ratings, ranks and scores all qualify.
- The p-value is an approximation. The \(\chi^2\) reference distribution becomes accurate for larger \(nk\), but tends to be somewhat liberal (p-values too small) for small samples — for example fewer than about 13 subjects with \(k = 3\). In those cases, compare the statistic against exact Friedman critical values before trusting a borderline decision.
- Ties are handled, but many ties lose power. The calculator applies the standard tie correction \(C\); if every subject gives identical values across conditions, the statistic is zero by construction and no difference can be detected.
- Interpret W alongside p. With many subjects, even a tiny, practically irrelevant difference in rank sums can be statistically significant; Kendall's \(W\) tells you whether the agreement behind the result is actually substantial. For another view of rank agreement between raters, see the Kendall's tau calculator and the Spearman rank correlation calculator.
Direction of the effect is read from the rank-sum table: the condition with the largest mean rank tends to score highest, and the one with the smallest mean rank tends to score lowest. Comparing each condition's mean rank with the null expectation \(k(k+1)/2\) shows which conditions pull the result.
Frequently Asked Questions
How do I calculate the Friedman test by hand?
Rank each subject's values within that subject from 1 (smallest) to \(k\) (averaging ranks for ties), sum the ranks per condition to get \(R_j\), then compute \(\chi_F^2 = \frac{12}{nk(k+1)}\sum R_j^2 - 3n(k+1)\). If ties exist, divide by the correction \(C = 1 - \sum(t^3-t)/(n(k^3-k))\). Compare the result with the \(\chi^2\) distribution using \(df = k-1\) to get the p-value.
What is a good value for Kendall's W?
Kendall's W runs from 0 (subjects show no consistent ordering of the conditions) to 1 (every subject ranks the conditions identically). Common rules of thumb label roughly 0.1 as weak, 0.3–0.5 as moderate, and above 0.7 as strong agreement. A statistically significant Friedman test with a small W means the difference is real but subjects disagree considerably about the ordering, so treat the practical importance cautiously.
When should I use the Friedman test instead of ANOVA or Kruskal–Wallis?
Use the Friedman test when the same subjects (or matched blocks) are measured under three or more conditions and your data are ordinal or not normally distributed. Use a repeated-measures ANOVA when the data meet parametric assumptions and you need to model interactions. Use the Kruskal–Wallis test when the groups consist of different, independent subjects — that is a between-subjects design, and the Friedman test would be invalid.
Can I run the Friedman test with only two conditions?
No — the test requires at least three conditions. With two related conditions, the appropriate nonparametric test is the Wilcoxon signed-rank test, which the Friedman test reduces to when \(k = 2\). The calculator will reject input with fewer than three values per line. With two conditions, the chi-square approximation is also unreliable, so the signed-rank approach gives a better p-value.
Is the p-value from this calculator exact?
No, it is an asymptotic approximation based on the \(\chi^2\) distribution with \(k-1\) degrees of freedom. It becomes accurate as the number of subjects grows, but for small samples — for example, fewer than about 13 subjects with three conditions — it tends to give p-values that are slightly too small. If your decision is borderline with a small sample, check exact Friedman critical value tables or use statistical software that offers an exact or permutation version.
How should I report Friedman test results?
A typical APA-style report includes the statistic, degrees of freedom, p-value and effect size, for example: \(\chi^2(2) = 6.26, p = .044, W = .39\). State whether the null hypothesis was rejected at your chosen significance level, and note that the test only shows the conditions differ — follow up with Nemenyi or Bonferroni-corrected Wilcoxon comparisons to identify which specific conditions differ, and report those results too.
What happens if some subjects have missing values or ties?
Ties are handled automatically: tied values receive average ranks and the statistic is corrected by the factor \(C\), which slightly increases \(\chi^2\). Missing values, however, cannot be handled — the test needs a complete matrix of every subject under every condition. Either remove any subject with a missing measurement or impute the value beforehand, and mention which approach you took when reporting the results.