SPSS command: SPSS NPAR TESTS /FRIEDMAN

Friedman test in your browser

The Friedman test ranks each case's values across several related variables and checks whether some variables are ranked consistently higher.

Free · No account · Files stay on your device · Updated 18 October 2026

What it tells you

Crosstabs runs SPSS NPAR TESTS /FRIEDMAN with the tie-corrected chi-square, Kendall's coefficient of concordance W and Cochran's Q for yes/no items, plus Bonferroni-adjusted pairwise comparisons.

  • The mean rank of every variable within cases, which orders the conditions or items.
  • Whether the related variables differ in distribution (Friedman chi-square, df = k − 1).
  • How strongly cases agree on the ordering, as Kendall's W from 0 (no agreement) to 1 (identical rankings).
  • For 0/1 items, whether the proportion of successes differs across items (Cochran's Q), and which pairs differ after Bonferroni adjustment.

When to use it

Use it when

  • The same respondents rate three or more products, concepts or ads on an ordinal scale.
  • A skewed outcome measured at three or more time points on the same cases.
  • Judges rank the same set of items and you want to quantify their agreement (Kendall's W).
  • Several yes/no items answered by the same people, such as awareness of three brands (Cochran's Q).

Use something else when

  • Independent groups of different people: use the Kruskal-Wallis test.
  • Roughly normal repeated measures where you also need between-subject factors or contrasts: use repeated-measures ANOVA.
  • Agreement between raters assigning categories rather than ranks: use Fleiss' kappa.

How to run it in Crosstabs

  1. 01

    Choose K related samples

    In Statistics mode open Nonparametric tests → K related samples (NPAR TESTS /FRIEDMAN).

  2. 02

    Tick the related variables

    Under Test variables tick the columns that hold the repeated measurements (Related variables, two or more). Each row must be one case.

  3. 03

    Choose the tests

    Tick Friedman, Kendall's W and/or Cochran's Q under Test type. Cochran's Q needs exactly two values across the variables.

  4. 04

    Keep pairwise comparisons and run

    Leave Pairwise comparisons (Bonferroni-adjusted) ticked for a post hoc table when there are three or more variables, then click Run test. Cases missing any selected variable are excluded listwise.

Worked example

Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.

Try with example data

Data

14 synthetic tasters each score three recipes on a 1–7 scale. Every taster has a personal leniency shared across the three scores, which is exactly the within-person dependence the Friedman test is built for.

Ranks
ItemMean Rank
recipe_a1.64
recipe_b1.96
recipe_c2.39
Test Statistics — Friedman Test and Kendall's W
ItemValue
N14
Chi-Square5.415
df2
Asymp. Sig..067
Kendall's W0.193

The chi-square is corrected for ties within cases.

Pairwise Comparisons — Friedman Test
Sample 1-Sample 2Test StatisticStd. ErrorStd. Test StatisticSig.Adj. Sig.
recipe_a-recipe_b−0.3210.378−0.850.3951.000
recipe_a-recipe_c−0.7500.378−1.984.047.142
recipe_b-recipe_c−0.4290.378−1.134.257.771

Significance values adjusted by the Bonferroni correction.

How to read it

Mean ranks rise from 1.64 (recipe_a) to 2.39 (recipe_c). The Friedman test gives χ²(2) = 5.41, p = .067, so with 14 tasters the difference is not significant at .05, and Kendall's W = 0.193 measures how consistently tasters order the three recipes (0 = no agreement, 1 = everyone ranks them the same way).

Output tables explained

Ranks
The mean within-case rank of every variable; higher means the variable tends to score higher than the others for the same case.
Test Statistics — Friedman Test
N, the chi-square corrected for ties within cases, df = k − 1 and asymptotic significance.
Test Statistics — Kendall's W
Kendall's coefficient of concordance W = χ² / (N(k − 1)), with the same chi-square test.
Test Statistics — Cochran's Q
N, Cochran's Q, df and significance, after a Frequencies — Cochran's Q table that counts successes per variable; the first value encountered is counted as a success.
Pairwise Comparisons
For Friedman, differences in mean ranks; for Cochran's Q, differences in proportions; each with standard error, standardized statistic, raw and Bonferroni-adjusted significance.

Assumptions and notes

  • Cases (rows) are independent; the variables within a row are related measurements of the same case.
  • Values can be ranked within each case, so the variables must be on a comparable scale.
  • Significance is asymptotic (chi-square); with very few cases or variables, treat borderline results cautiously.

How the results are validated

The related-samples engines are tested against independent reference values computed with SciPy 1.18.1, statsmodels 0.15.0, pingouin 0.7.0 and scikit-posthocs 0.17.1: Friedman chi-square, p and Kendall's W match scipy.stats.friedmanchisquare, Friedman pairwise comparisons match scikit-posthocs (Siegel-Castellan), and Cochran's Q matches statsmodels cochrans_q, with its pairwise comparisons also checked, all within 1e-9 (relative to the larger of 1 and the reference value). Validation evidence

Questions

My data are in long format (one row per measurement). Can I still run Friedman?

The panel expects wide format: one row per case and one column per condition. Restructure the file so each condition is its own variable first.

Is Kendall's W an effect size for the Friedman test?

Yes. W rescales the Friedman chi-square to 0–1, so it is commonly reported as the effect size; around .1 is small, .3 moderate and .5 or more strong agreement.

Can I run it with only two related variables?

The panel accepts two or more variables, but with two the Wilcoxon signed-rank test uses the size of the differences and is more powerful. Pairwise comparisons are shown only for three or more.

Which value counts as a success in Cochran's Q?

The first value encountered in the data, as in SPSS. The frequencies table footnote names it, so check it before reading the proportions.

How are missing values handled?

Listwise: a case with a blank or user-missing value on any selected variable is excluded, and the footnote reports how many cases were dropped.

Run Friedman Test on your own data

Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.

Open the workspace

SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.