Compare the proportion of 'yes' across three or more related conditions measured on the same people.
Cochran's Q test compares three or more related proportions. Each participant contributes a yes/no outcome under every condition — for example whether each of 40 students solved an easy, a medium and a hard task, or whether patients reported a symptom at three visits. The question is whether the proportion of 'yes' differs between conditions.
It is the extension of McNemar's test to more than two conditions, and the binary counterpart of Friedman's test and the repeated-measures ANOVA. Because the same people appear in every condition, an ordinary chi-square test would be wrong: it assumes independent groups.
StatRyx reports Q with its degrees of freedom (k − 1) and p-value, the proportion of 'yes' in each condition, and Kendall's W as an effect size. When the overall test is significant, it runs pairwise McNemar tests between conditions with a Bonferroni correction, so you can see which conditions differ.
The data should be in wide format: one row per participant and one binary column per condition. Rows with a missing value in any condition are excluded. The test needs a reasonable number of participants whose answers differ across conditions; rows that are all 'yes' or all 'no' carry no information about the difference.
| Condition | Solved | N | Proportion |
|---|---|---|---|
| Easy task | 32 | 40 | .80 |
| Medium task | 27 | 40 | .68 |
| Hard task | 12 | 40 | .30 |
| Cochran's Q | Q(2) = 21.67 | p < .001 |
Cochran's Q test showed that the proportion of students who solved the task differed across the three difficulty levels, Q(2) = 21.67, p < .001, Kendall's W = .15. Bonferroni-corrected McNemar tests showed that the hard task (30%) was solved less often than the easy (80%, p < .001) and medium tasks (68%, p = .004); easy and medium did not differ (p = .905).
Yes. You can run it without an account (3 free analyses), and a free account adds 10 more — a one-time allowance, no payment needed. Every result includes the APA 7 write-up. Paid plans (Student from $9/month) add more analyses and Word, PDF and Excel export.
Give Q with its degrees of freedom and p, an effect size, and the proportion in each condition: "Q(2) = 21.67, p < .001, Kendall's W = .15." Then report the post-hoc comparisons with the correction you used.
Pairwise McNemar tests between conditions, with a correction for multiple comparisons. StatRyx uses the Bonferroni correction and reports both raw and corrected p-values.
McNemar's test compares two related binary conditions. Cochran's Q compares three or more; with exactly two conditions it gives the same result as McNemar's test without continuity correction.
Wide format: one row per participant and one column per condition, each coded 0/1 or yes/no.
Run a Cochran's Q Test on your data →