Multi-Group Comparisons

Cochran's Q Test: McNemar for Three or More Conditions

A practical guide to Cochran's Q test for comparing binary outcomes across three or more related conditions. Learn when to use it, how to interpret results, and post-hoc follow-ups.

Share
Cochran's Q Test: McNemar for Three or More Conditions

Quick Hits

  • Cochran's Q generalizes the McNemar test to 3+ related conditions
  • Same subjects measured under each condition with a binary outcome
  • Q statistic follows a chi-square distribution with k-1 degrees of freedom
  • If significant, follow up with pairwise McNemar tests + Bonferroni correction
  • Common use: usability testing across multiple interface designs

Cochran's Q Test is the natural extension of the McNemar Test when you have three or more related conditions instead of just two. This guide covers the practical details.

When to Use Cochran's Q

The typical scenario: you have the same group of subjects tested under multiple conditions, and the outcome is binary (success/failure, pass/fail, yes/no).

Common applications:

  • Usability testing: Can users complete a task across three interface designs?
  • Content moderation: Do three different prompt templates correctly classify violations?
  • Clinical trials: Do patients respond to three different treatment protocols?
  • A/B/C testing with paired design: Does the same set of users succeed across three conditions?

Post-Hoc Comparisons

A significant Cochran's Q tells you that at least one condition differs, but not which ones. Follow up with:

  1. Pairwise McNemar tests for each pair of conditions
  2. Bonferroni correction: Divide your significance level by the number of comparisons. With 3 conditions, there are 3 pairs, so use α\alpha = 0.05/3 = 0.017.

Example: Three Onboarding Flows

50 new users each try all three onboarding flows (order randomized). Success = completed setup within 10 minutes.

Flow Success Rate
Flow A (video tutorial) 62%
Flow B (interactive wizard) 78%
Flow C (documentation only) 54%

Cochran's Q = 8.4, df = 2, p = 0.015. The flows differ significantly.

Pairwise McNemar tests with Bonferroni correction:

  • A vs. B: p = 0.012 (significant after correction at 0.017)
  • A vs. C: p = 0.34 (not significant)
  • B vs. C: p = 0.003 (significant)

Conclusion: The interactive wizard (Flow B) outperforms the documentation-only approach (Flow C), while the video tutorial (Flow A) falls in between.

See also: Comparing More Than Two Groups for an overview of multi-group comparison strategies.


References

  1. https://www.statisticshowto.com/cochrans-q-test/
  2. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3900058/

Frequently Asked Questions

What is the minimum sample size for Cochran's Q?
The chi-square approximation works well with at least 10 subjects and when the total number of successes is not too small. With fewer subjects, consider exact methods.
Can I use Cochran's Q with more than two outcome categories?
No. Cochran's Q requires a binary (0/1) outcome. For ordinal outcomes with repeated measures, use the Friedman test. For nominal outcomes with more than two categories, specialized extensions exist but are less commonly available in software.
How does Cochran's Q relate to the Friedman test?
Cochran's Q is the binary-outcome special case of the Friedman test. When the outcome is binary (0/1), both tests give equivalent results. The Friedman test is more general and works with any ordinal or continuous outcome.

Key Takeaway

Cochran's Q is the right test when you have the same subjects measured across three or more conditions with a binary outcome. It is the multi-condition generalization of McNemar. Always follow a significant result with pairwise McNemar tests to identify which conditions differ.

Send to a friend

Share this with someone who loves clean statistical work.