Cochran's Q Test (repeated binary)
VerifiedCategorical
Run this test straight away on a free built-in teaching dataset — no data of your own needed — or bring your own. Either opens the guided workspace: variable setup, assumption diagnostics, results with effect sizes and confidence intervals, figures, and APA-ready reporting.
Loading teaching datasets…
Or use your own dataset
Loading your datasets…
Tests whether the proportion of successes is the same across k ≥ 3 binary repeated measures on the same subjects.
Generalises McNemar's test from k = 2 to k ≥ 3 conditions. Computes Q = k(k−1)[Σ T_j² − T̄·Σ T_j] / [k Σ R_i − Σ R_i²] where T_j is the column-j success count and R_i the row-i success count, then refers Q to χ²(k−1). Constant rows (all 0 or all 1 across conditions) contribute zero to Q and effectively reduce the informative sample. Reports Q, df, p, and per-condition success proportions with 95% CIs.
Worked example
Do pass rates differ across three exam formats taken by the same students?
The same 40 students each attempted three formats (pass/fail); Cochran's Q tests whether the pass proportion differs across the repeated binary conditions.
Pass rates differed across formats, Q(2) = 9.5, p = .009 — the open-book format had the highest pass rate.
Cochran's Q test showed pass rates differed significantly across the three formats, Q(2) = 9.5, p = .009.
Try it yourself: Load this ready-made sample and follow the run above.
When to use it
- Paired binary outcome at ≥ 3 conditions50 patients are asked yes/no whether a specific symptom is present at three follow-up visits (baseline, 4 weeks, 12 weeks).
- Rater-panel binary agreement (k raters per subject)4 reviewers rate 80 manuscripts as accept/reject.
When NOT to — use instead
- Independent groupsCochran's Q requires paired / repeated measures. → Chi-Square Test of Independence
- Two paired binary measurementsCochran's Q at k = 2 reduces to McNemar's test — use it directly. → Exact McNemar's Test (small-sample binary paired)
- Multi-category paired outcome (not binary)Cochran's Q is binary by construction. → Stuart-Maxwell / Bowker (paired k-category)
- Need covariate adjustmentCochran's Q is unadjusted. → GLMM (binary) \u2014 logistic mixed-effects (random intercept)
Hypotheses
Parameter tested: set of conditional success probabilities {p_j} across the k conditions
Assumptions (and what to do if they fail)
Check: Report n·k and compare to 24.
If violated: With small n the χ²(k-1) approximation to Q is unreliable.
Check: Verify the same rule applies at every condition.
If violated: Inconsistent success definitions across conditions bias the conditional proportions and invalidate Q.
Ready to run a Cochran's Q Test (repeated binary) on your own data?
Guided setup, automatic assumption checks, effect sizes, figures and an APA write-up.
Run this test →