kendall.w {concord} | R Documentation |
calculates Kendall's W coefficient of concordance
kendall.w(x,lambda,descending=TRUE,ranks=FALSE)
x |
matrix of scores or ranks |
lambda |
optional contrast coefficient vector or matrix |
descending |
whether high (default) or low scores represent top ranks |
ranks |
whether the values in x are scores or ranks |
kendall.w
will accept either a matrix or data frame of scores or ranks
where the rows represent methods (usually raters) and the columns represent
data objects. It will handle ties, but not missing values. By default it
assumes that numerically higher scores represent numerically lower ranks. A
vector or matrix of contrast coefficients (which each must sum to zero) may
be supplied. A z-score approximation of the significance of each contrast will
be displayed if lambda
is present. The ranks
argument allows the
user to pass ranks directly to the function. If ranks are passed without
setting ranks
to TRUE and with descending
TRUE, the order of
the ranks will be reversed. For small values of k (methods), kendall.w
will try to lookup the tabled values for significance. For k
greater
than 7, a chi-squared approximation is returned. Only one of these values will
be returned.
W |
value of W |
p.table |
whether the obtained W exceeded the table value for small N |
p.chisq |
the probability of the obtained chi-squared value for larger N |
Kendall's W may not be appropriate for nominal class data.
Jim Lemon
Siegel, S. & Castellan, N.J.Jr. (1988) Nonparametric statistics for the behavioral sciences. Boston, MA: McGraw-Hill.
# fictional rankings of job applicants app.mat<-matrix(c(1,3,4,2,6,5,2,4,3,1,5,6,3,2,5,1,5,4),nrow=3,byrow=TRUE) # Test the hypothesis that the first three applicants are ranked higher # than the last three. lambda<-c(1,1,1,-1,-1,-1) print(kendall.w(app.mat,lambda))