Cochran's Q tests whether the success rate stays constant across k ≥ 3 repeated binary measurements on the same subjects — McNemar's test extended beyond two.
Cochran's Q generalises McNemar (k = 2) to arbitrary k. The statistic Q = k(k − 1) · Σ_j (T_j − T̄)² / [k · Σᵢ Lᵢ − Σᵢ Lᵢ²] follows χ²(k − 1) under H₀ (all treatments have equal success rate), where T_j is the success total in column j and Lᵢ is the row total.
Friedman is the equivalent test for ordered or continuous rank data on the same blocks; Cochran's Q is specifically for binary 0/1 outcomes.
≥ 3 binary 0/1 columns (subjects × conditions).
Q statistic, df = k − 1, p, success rate per condition.
If Q is significant, follow up with pairwise McNemar tests with Bonferroni / Holm adjustment to identify which conditions differ.