Cochran Q Test Calculator
Compare three or more paired binary conditions across complete subject rows using Cochran’s Q.
YOUR CALCULATION
Result
—
Calculation steps
Work through one step at a time or reveal the complete calculation. The steps use your current inputs.
How to calculate
Use within-subject binary outcomes rather than treating the repeated conditions as independent groups.
Q=(k−1)(kΣcolumn totals²−grand total²)/(k grand total−Σrow totals²)
Worked example
The default four subjects and three conditions give Q=8/3 with asymptotic chi-square degrees of freedom two.
Assumptions and input details
Complete matched rows, 3–12 conditions and at most 6000 binary cells. Rows are independent subjects; asymptotic p-values may be poor for small or sparse designs. No exact permutation, post-hoc comparison or no-discordance arbitrary result.
Using this calculator
Can I enter my own problem?
Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.
Are the results exact?
Results use floating-point arithmetic and displayed rounding. Read the formula, assumptions and any stated data precision before interpreting the result.
Is my input uploaded?
The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.
Analyze matched binary outcomes using an exact discordant-pair binomial test and two chi-square approximation conventions.
Calculate a tie-corrected Friedman omnibus statistic, asymptotic p-value and Kendall concordance from complete repeated-condition rows.
Compute Pearson chi-square, expected counts, an approximate p-value and Cramer’s V for a contingency table.
Reserved advertising space.