Analyses Cochran’s Q
Minimal Working Example
We feed the cochrans.q() function a 6 by 4 matrix of binomial values. The
first column represents our dependent, binomial variable. The remaining
columns represent our independent variable on three levels expressed as
binomial values.
CochranMatrix <- matrix(c(1, 1, 1, 1, 1, 1, 1, 1, 0,
1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1), 6,
4)
cochrans.q(CochranMatrix)
##
## Cochran's Q Test
##
## H0: There is no difference in the effectiveness of treatments.
## HA: There is a difference in the effectiveness of treatments.
##
## Q = 9.31578947368421
##
## Degrees of Freedom = 3
##
## Significance Level = 0.05
## The p-value is 0.0253739987887868
## There is enough evidence to conclude that the effectiveness of at least two treatments differ.
##
Aarhus University Biostatistics - Why? What? How? 12 / 19