Cochran's Q test
Compares a yes/no outcome across three or more conditions in the same patients, as an extension of McNemar's test.
Clinical example
Whether the proportion of patients who tolerate a drug differs between three dose levels, each given to the same patients.
When to use it
- The outcome is yes or no and measured under three or more conditions in the same patients.
- Every patient has a value for every condition.
- You don't need to adjust for other variables.
Assumptions to check
Related groups
The same patients, or matched sets, appear in every condition.
Complete data
With covariates or missing visits, use a GLMM or GEE instead.
Check first
- With covariates or missing visits, use a GLMM or GEE instead
What to report
- Proportion at each condition
Alternatives
| If your situation is… | Use |
|---|---|
| Only two related groups | McNemar test |
| You need covariates, or visits are missing | GEE and mixed-effects logistic regression |
In your software
# R (long format: one row per patient and condition; outcome 0/1)
library(rstatix)
cochran_qtest(d_long, response ~ condition | patient_id)
* Wide format: one 0/1 variable per condition.
NPAR TESTS
/COCHRAN=dose_a dose_b dose_c.