Cochran Q Test Calculator Formula
Understand the math behind the cochran q test calculator. Each variable explained with a worked example.
Formulas Used
Cochran Q
q_stat = (k - 1) * (k * ss_col - pow(grand_total, 2)) / (k * grand_total - ss_row)df
df = k - 1Variables
| Variable | Description | Default |
|---|---|---|
k | Treatments | 4 |
grand_total | Grand Total | 40 |
ss_col | Sum of Cj squared | 500 |
ss_row | Sum of Ri squared | 210 |
How It Works
Cochran Q Test
Q = (k-1)[k*Sum(Cj^2) - T^2] / [kT - Sum(Ri^2)]
Extension of McNemar to 3+ related groups with binary outcomes.
Worked Example
4 treatments, T=40.
k = 4grand_total = 40ss_col = 500ss_row = 210
- 01Q = 3*(2000-1600)/(160-210)
Ready to run the numbers?
Open Cochran Q Test Calculator