Statistics & probability

Friedman test calculator for repeated measures

Rank repeated conditions within matched blocks, apply tie correction and report Friedman chi-square inference with Kendall concordance.

Your numbers

Enter comma- or space-separated finite numbers. Values are limited to ±10¹²; missing observations are not silently removed. Use 2–100 complete rows and 3–8 consistently aligned columns.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The Friedman procedure compares repeated conditions by ranking measurements within each independent block. A block may be a subject, matched unit or another design-defined set of related observations. Column rank sums describe how consistently conditions receive high or low ranks. The calculator corrects the omnibus statistic for equal values within rows, then uses a chi-square reference distribution with k−1 degrees of freedom. Kendall W summarizes rank concordance.

THE FORMULAQ = [12ΣR_j²/(nk(k+1)) − 3n(k+1)] / C; C corrects within-block ties.

A worked example

For the four default blocks, the condition rank sums are 7,8 and 9. With three conditions and no ties, the correction factor is one and Q=0.5. The chi-square approximation uses two degrees of freedom, giving p≈0.7788008. This very small design is useful for checking the arithmetic, but its asymptotic p-value should not be mistaken for a well-calibrated small-sample exact test.

Good to know

Requires complete matched blocks, independent blocks and 3–8 conditions per row. The supported block count is 2–100. Inference is an approximation, not an exact within-block permutation calculation. SciPy notes reliability for more than ten blocks and more than six repeated samples. Completely tied blocks provide no contrast; all blocks completely tied make the test undefined.

Rows preserve matching while columns preserve conditions

Each row is ranked separately. A subject whose measurements are all larger than another subject’s can still contribute the same rank pattern. This removes the absolute level of a block from the rank comparison. It does not remove the need for matching: shuffling individual entries between rows changes the study design and can change both the statistic and its interpretation.

Equal measurements within a block receive their average available rank. Their reduction in rank variation enters the tie-correction factor. A completely tied row contributes the same rank to every condition and carries no directional contrast, although it remains part of the matched design. If every row is completely tied, the correction denominator vanishes and the calculator reports that no condition contrast can be tested.

Within-block ranks sum to seven eight and nine in the default designRanks inside four matched blocks123213321132789
Four matched blocks yield condition rank sums 7,8,9. With no ties, Q = 0.5 and Kendall W = 0.0625. Rows preserve subjects; columns preserve conditions.

The Kruskal Wallis ties calculator ranks independent groups. Friedman instead preserves the matched rows and ranks conditions within each block.

Concordance and omnibus inference have different roles

Kendall W is Q divided by n(k−1), using the tie-corrected statistic. Values near one indicate strong agreement among blocks about condition ordering; values near zero indicate little systematic ordering. It does not supply a pairwise difference, and the chi-square p-value still depends on the number of independent blocks. A descriptive concordance measure and an inferential probability should therefore be reported with their own labels.

A significant omnibus result does not locate the differing conditions. Planned comparisons or suitable rank-based post-hoc methods need their own multiplicity treatment. Missing observations cannot be repaired by shifting remaining row values left or inserting zeros: that would attach measurements to the wrong conditions. If matching is absent, use an independent-group method rather than forcing the values into a rectangular Friedman input.

A few questions, answered

Can I enter one condition per row?

Transpose such a worksheet first. Here each row is one matched block and each column is the same condition across blocks.

Is the displayed p-value exact for four subjects?

No. It is a chi-square approximation. Small designs may require an independently validated permutation procedure; this page labels that limitation explicitly.

Find your calculator

Start typing to explore the library.