Friedman, Kendall's W and Cochran's Q
Compares three or more related measurements: Friedman for ordinal/scale data, Kendall's W as the agreement version, Cochran's Q for yes/no outcomes.
Menu: Analyze → Nonparametric Tests → Legacy Dialogs → K Related Samples…
When should I use it?
- Ratings of the same people at three time points.
- Agreement of judges ranking the same items (Kendall's W).
- Pass/fail on three related tasks (Cochran's Q).
What are the assumptions?
- Each row is one subject measured under every condition (listwise deletion).
How do I run it in StatLab?
- Move the related variables (columns) to the test list and tick the tests.
- Choose Significance = Exact or Monte Carlo for small samples or sparse data.
How do I read the output?
| Output | Meaning |
|---|---|
| Mean Rank | Average within-subject rank of each condition. |
| Chi-Square / Cochran's Q, df, Sig. | Overall test. |
| Kendall's W | 0 = no agreement, 1 = complete agreement. |
| Exact Sig. / Point Probability | Permutation p-value using every possible arrangement of the data. |
| Monte Carlo Sig. (99% CI) | Estimated from 10,000 random arrangements (seed 2000000); the interval shows its precision. |
Worked example
On the practice survey dataset (File → Sample dataset), this command — which the dialog's Paste button also produces — runs the procedure:
PROC npKRelated /vars=(score age) /friedman=YES /kendall=NO /cochran=NO /sig=asymp.
Output tables: Ranks · Test Statistics.
How would I report it in APA style?
A Friedman test gave χ²(1, N = 150) = 146.03, p < .001, Kendall's W = .97.
Computed by StatLab's validated procedure code when this page was built. The example only illustrates the steps; choose variables that fit your own research question.
What are common mistakes?
- Entering the data in long format (one row per measurement) — the conditions must be separate columns.