Cochran's Q Test (repeated binary)

Verified

Categorical

Independently verified. Every statistic this test reports has been re-derived against an independent reference — never the library the pipeline itself calls — the rendered output was read back in a browser, and the result is locked with a committed regression suite.

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.

Result

Pass rates differed across formats, Q(2) = 9.5, p = .009 — the open-book format had the highest pass rate.

How you'd report it (APA)

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 conditions
    50 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

Hypotheses

H₀: the probability of 'success' is the same across all k conditions.
Hₐ: at least one condition has a different probability of 'success'.

Parameter tested: set of conditional success probabilities {p_j} across the k conditions

Assumptions (and what to do if they fail)

Sample size guideline — n·k ≥ 24 (Cochran's original rule-of-thumb) for the χ² approximationmedium

Check: Report n·k and compare to 24.

If violated: With small n the χ²(k-1) approximation to Q is unreliable.

'Success' is coded identically across all conditions (same rule for every timepoint)medium

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 →