cohen.kappa {concord} | R Documentation |
calculates the kappa coefficient of reliability for nominal data
cohen.kappa(classif, type=c("count","score"))
classif |
matrix of classification counts or scores |
type |
whether classif is an object by category matrix of counts or an object by classifier matrix of scores |
cohen.kappa
will accept either an object by category matrix of counts
in which the numbers represent how many classifiers have placed the object
in each category, or an object by classifier matrix of categories in which
the numbers represent each classifier's categorization of that object. The
default is to assume counts and the operator must specify if scores
are used.
kappa |
value of kappa |
Z |
the Z-score approximation |
p |
the probability of Z |
This is sometimes called Cohen's kappa. The name also avoids confusion
with the kappa estimate of the conditioning number of a matrix. For a
contingency table version of this statistic, see classAgreement
in package e1071
Jim Lemon
Siegel, S. & Castellan, N.J.Jr. (1988) Nonparametric statistics for the behavioral sciences. Boston, MA: McGraw-Hill.
# the "C" data from Krippendorff nmm<-matrix(c(1,1,NA,1,2,2,3,2,3,3,3,3,3,3,3,3,2,2,2,2,1,2,3,4,4,4,4,4, 1,1,2,1,2,2,2,2,NA,5,5,5,NA,NA,1,1,NA,NA,3,NA),nrow=4) # first show the score to count transformation, remembering that # Krippendorff's data is classifier by object and must be transposed scores.to.counts(t(nmm)) # now calculate kappa cohen.kappa(t(nmm),"score")