cochranQ: Cochran's Q test

View source: R/cata.R

cochranQR 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 I assessors (rows) and J products (columns) where values are 0 (not checked) or 1 (checked)

quiet

if FALSE (default) then it prints information related to the test; if TRUE it returns only the test statistic (Q)

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, \Sexpr[results=rd]{tools:::Rd_expr_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, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.foodqual.2013.06.010")}

See Also

mcnemarQ

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))

cata documentation built on April 4, 2025, 5:17 a.m.

Related to cochranQ in cata...