Interactive module guide

Friedman Test Calculator — Repeated Measures

This Friedman test calculator evaluates three or more related treatments by ranking within blocks, the rank-based repeated-measures alternative to ANOVA.

Open calculator

Free · No sign-up · Calculations stay in your browser

The Friedman test compares three or more related treatments by ranking within each block—each subject, panel, or matched set ranks the treatments among themselves—and asking whether the treatment rank sums differ more than chance allows.

Its tie-corrected Q statistic is referred to a chi-square distribution with k − 1 degrees of freedom, making it the rank-based counterpart of a repeated-measures ANOVA.

Because ranking happens inside each block, differences in level or scale between blocks cancel out entirely.

This calculator reports Q, the per-treatment mean ranks, and Kendall’s W as an agreement-style effect size.

Use the Friedman test calculator when every block or subject is measured under at least three conditions; it ranks within blocks, so between-block scale differences do not matter.

When to use this Friedman test calculator

Use it when

  • Use it when every subject or block is measured under all treatments—tasters scoring recipes, patients tested under three protocols, users rating interface variants—and the values are ordinal or non-normal.
  • Use it when blocks differ wildly in their overall level: a harsh grader and a lenient grader can still agree on the ordering, and within-block ranking is exactly what isolates that ordering.
  • Use it as the honest omnibus before pairwise paired comparisons; a non-significant Q is a principled reason not to chase individual treatment contrasts.

Choose another method when

  • Avoid it with only two conditions—the design collapses to paired data, where the sign test or Wilcoxon signed-rank test answers directly with better-understood machinery.
  • Avoid it when observations within a block are not comparable—if treatments were measured on different scales or at incomparable times, within-block ranks are not meaningful.
  • Avoid it for independent groups; without blocking, the Kruskal-Wallis test is the design-appropriate rank test.

Interactive tool

The calculator loads as you approach this section so the guide remains fast on mobile connections.

Example preview

Six blocks under three treatments

Inputs
Each of six blocks ranks three treatments, ties allowed.
Representative result
Tie-corrected Q≈5.826 with df=2 and p≈0.054, just above the conventional 0.05 line.

Illustrative only. Load the interactive tool to enter your own values and review assumptions.

Watch the explanation

5:05 min

The player loads only after you press play. You can also watch on YouTube.

Read the complete transcript

The Friedman Test. The same subjects can experience several treatments while differing greatly in their raw levels. The Friedman test keeps each subject as a block and compares treatment orderings. Block alignment is the design. Row i in every treatment field must describe the same subject or matched set, with one comparable observation under every condition. Rank treatments separately inside each block from one through k. Never pool values across subjects, because a new rank scale begins on every row. Equal treatment values inside one block share their average rank. These midranks avoid arbitrary winners, while the tied group also enters the correction register. Sum each treatment's within-block ranks down its column. Dividing by the block count gives mean ranks that reveal which treatments repeatedly sit low or high. The uncorrected Q statistic increases as treatment rank sums separate. It scales the squared column sums and subtracts the common no-effect rank baseline. Ties reduce available ordering information. Divide Q by the standard tie factor; if every block is completely tied, that factor is zero and inference stops.

This page compares Q with the upper tail of a chi square distribution using treatment count minus one degrees of freedom. Larger Q is stronger evidence. That chi square reference is approximate. Fewer than ten blocks trigger a warning, but the calculator never switches automatically to exact tables or permutation inference. The omnibus null says there is no systematic treatment effect after blocking. Rejection means at least one treatment rank pattern differs, not that every pair differs. Blocks must be independent of one another. Observations within a block are intentionally related, but households, clusters, or repeated blocks need a design that represents that dependence. Meaningful within-block ordering is enough. Normality and equal raw spacing are not required, yet treatments must still be comparable inside every block. Adding the same constant to every treatment inside one block changes raw levels but not ranks. Between-block scale differences therefore cancel from the test. Kendall W equals Q divided by block count times treatment count minus one. It is a unitless rank-agreement effect, not raw variance explained or a confidence interval.

Now follow six blocks under three treatments at alpha point zero five. Five blocks rank treatment one highest, while the final block contains one tie. Rank each row independently. The first five rows use ordinary ranks, and block six gives treatments one and two the shared midrank one point five. That two-way tie contributes six to the tie register. The correction is one minus six over one hundred forty-four, or zero point nine five eight three. Treatment rank sums are sixteen point five, eight point five, and eleven. Their mean ranks are two point seven five, one point four two, and one point eight three. The uncorrected statistic is five point five eight three. After tie correction, Q is five point eight two six with two degrees of freedom. The upper-tail p-value is zero point zero five four three, narrowly above alpha. Fail to reject, while Kendall W is zero point four eight six and the small-block warning remains. This is not proof that all treatments are equivalent. The page provides no post hoc rows, so pairwise claims need separate paired tests and explicit multiplicity control.

For contrast, six blocks with the same treatment order every time give Q equal to twelve, p equal to zero point zero zero two four eight, and W equal to one. Lift one subject's three raw values by one hundred. Its within-block ranks stay one, three, and two, so every Friedman result remains unchanged. Partial and complete row ties both receive midranks. In this diagnostic, the tie factor is zero point six eight seven five and Q becomes zero point five four five. Validation requires three to twelve treatments, at least two aligned blocks, and equal field lengths. If every row is tied, the calculator stops instead of reporting zero evidence. A significant omnibus still names no pair. Use a preplanned paired follow up with multiplicity adjustment, and never manufacture post hoc rows the page does not calculate. Report block and treatment counts, alignment, within-block midranks, tie correction, Q, degrees of freedom, chi square approximation, p, alpha, warning, and Kendall W. Turn repeated measurements into one honest blocked rank comparison, preserve every subject row, and run the Friedman Test calculator free at Distri Scope dot com.

How to read the result

The mean-rank table is the interpretable core: with k = 3, mean ranks near 2 for every treatment mean no ordering; a treatment pinned near 1 or 3 across blocks is what drives Q.

Kendall’s W separates strength from significance: many blocks can make a weak ordering (small W) highly significant, while few blocks can leave a strong ordering non-significant.

Because only within-block information is used, adding blocks with extreme overall levels changes nothing unless their internal orderings change—a useful sanity property to verify against intuition.

How to use the Friedman test calculator

Enter each treatment in its own field, in identical block order: the i-th value of every treatment field must belong to block i. All treatments therefore need the same number of values.

At least three treatments and two blocks are required; the add and remove controls manage the treatment count.

Ties within a block receive midranks, and the tie-corrected Q is used automatically—exact agreement between treatments inside a block is expected data, not an error.

Formula, hypotheses, and assumptions

Q=12nk(k+1)j=1kRj23n(k+1)Q = \frac{12}{nk(k+1)} \sum_{j=1}^{k} R_j^2 - 3n(k+1)

Conditions to review

  • One observation per block-and-treatment combination
  • Blocks (subjects) are independent of each other
  • At least an ordinal measurement scale within blocks
  • At least three treatments; with two, use a paired test

Calculator parameters

  • Significance Level (α): default 0.05.

What the method is doing

The calculator ranks within each block, sums ranks per treatment, and computes Q = 12/(nk(k+1)) · ΣRⱼ² − 3n(k+1), divided by the tie correction 1 − Σ(t³−t)/(nk(k²−1)); this matches scipy’s friedmanchisquare, so results are directly reproducible.

The reference distribution is χ²(k − 1); with fewer than ten blocks the calculator warns that the approximation is rough rather than pretending to exactness.

Kendall’s W = Q/(n(k − 1)) is reported: it reads as the agreement among blocks about the treatment ordering, from 0 (no agreement) to 1 (every block ranks the treatments identically).

Worked example: six blocks under three treatments

Six blocks are each measured under three treatments. Treatment 1: 7.0, 9.9, 8.5, 5.1, 10.3, 8.6. Treatment 2: 5.3, 5.7, 4.7, 3.5, 7.7, 8.6. Treatment 3: 4.9, 7.6, 5.5, 2.8, 8.4, 9.1. One block contains a tie between treatments 1 and 2. Run a Friedman test at α = 0.05.

  1. 1Rank within each block; in the tied block, treatments 1 and 2 share the midrank of the tied positions, contributing to the tie correction.
  2. 2Sum ranks per treatment across the six blocks and compute the uncorrected Q, then divide by the tie correction to get Q ≈ 5.826 with k − 1 = 2 degrees of freedom.
  3. 3The p-value is P(χ²₂ > 5.826) ≈ 0.054, just above α = 0.05, so the null of no treatment effect is narrowly not rejected.
  4. 4Kendall’s W = 5.826/(6×2) ≈ 0.49, a moderate agreement among blocks about the treatment ordering.

Interpretation

Treatment 1 tends to collect the highest within-block ranks and the agreement across blocks is moderate (W ≈ 0.49), yet with six blocks the evidence lands at p ≈ 0.054—just short of the conventional line. The honest report states the near-threshold result and the effect size together, and treats “collect more blocks” rather than “round down the p-value” as the way to resolve it.

Common mistakes

  • Do not enter treatments with mismatched lengths or scrambled block order; the whole test lives on the block alignment of the input fields.
  • Do not interpret a significant Q as any specific pairwise difference; it says the orderings are non-random overall, and pairwise claims need their own follow-up tests with multiplicity control.
  • Do not compare raw rank sums across studies with different block counts; Kendall’s W is the comparable, normalized quantity.

Limits and independent validation

The chi-square reference is approximate and weakest with few blocks; exact permutation p-values are not computed here, and the calculator warns below ten blocks.

No built-in post-hoc procedure is offered yet for Friedman; pairwise follow-up requires separate paired tests with explicit multiplicity adjustment.

The test uses only orderings, so it cannot distinguish a treatment that wins by a little in every block from one that wins by a lot—magnitude questions need the raw data alongside.

Before using the result

  • Verify block alignment by spot-checking one block: read the i-th value of each treatment field and confirm they belong together.
  • Recompute one block’s ranks by hand, including any midranks for ties, and check the mean-rank table’s direction against intuition.
  • When the values are approximately normal with similar within-block variances, cross-check against a repeated-measures analysis; agreement strengthens the conclusion, and disagreement localizes what the ranks discard.

See every option in the Statistical Hypothesis Test Calculator or review the DistriScope methodology. Educational information; last reviewed 2026-08-09. Verify consequential calculations independently.