kendallW: Kendall's W (coefficient of concordance)

View source: R/kendallW.R

kendallWR Documentation

Kendall's W (coefficient of concordance)

Description

Compute Kendall's W, also known as coefficient of concordance among observed rankings and those predicted by the Plackett-Luce model.

Usage

kendallW(x, ...)

## Default S3 method:
kendallW(x, y, ...)

## S3 method for class 'pltree'
kendallW(x, newdata = NULL, ...)

Arguments

x

an object of class pltree, or a matrix of predicted rankings for the default method

...

additional arguments passed to methods

y

a matrix of observed rankings, for the default method

newdata

data for predictions

Details

Kendall's W is computed for each ranking (row) between the observed and the predicted ranks, with the correction for ties, and then averaged across rankings. Only the items that the participant ranked are used. Items with a 0 (not ranked) or NA in the observed rankings, or NA in the predicted rankings, are dropped from that row, and rows with fewer than two items left are skipped.

Kendall's W values range from 0 (no agreement) to 1 (full agreement)

Value

Kendall's W (coefficient of concordance)

Author(s)

David Brown and Jacob van Etten

See Also

Other goodness-of-fit functions: kendallTau(), pseudoR2()

Examples

pred = matrix(c(1, 2, 3, 4,
                2, 1, 3, 4,
                1, 3, 2, 4), nrow = 3, byrow = TRUE)

# 0 marks items the participant did not rank
obs = matrix(c(1, 2, 3, 0,
               1, 2, 0, 3,
               0, 2, 1, 3), nrow = 3, byrow = TRUE)

kendallW(pred, obs)

gosset documentation built on Dec. 2, 2026, 1:08 a.m.