cochranQ {cata} | R Documentation |
Cochran's Q test
Description
Conduct Cochran's Q test assuming equal columns proportions for matched binary responses versus the alternative hypothesis of unequal column proportions.
Usage
cochranQ(X, quiet = FALSE, digits = getOption("digits"))
Arguments
X |
matrix of |
quiet |
if |
digits |
for rounding |
Details
Method returns test statistic, degrees of freedom, and p value from Cochran's Q test.
Value
Cochran's Q test results (statistic, degrees of freedom, p-value)
Author(s)
J.C. Castura
References
Cochran, W.G. (1950). The comparison of percentages in matched samples. Biometrika, 37, 256-266, doi:10.2307/2332378
Meyners, M., Castura, J.C., & Carr, B.T. (2013). Existing and new approaches for the analysis of CATA data. Food Quality and Preference, 30, 309-319, doi:10.1016/j.foodqual.2013.06.010
See Also
Examples
data(bread)
# Cochran's Q test on the first 50 consumers on the first attribute ("Fresh")
cochranQ(bread$cata[1:50, , 1], digits=3)
# Same, returning only test statistics for the first 4 attributes
t(res <- apply(bread$cata[1:50, , 1:4], 3, cochranQ, quiet=TRUE, digits=3))