kendall_w: Kendall's Coefficient of Concordance

View source: R/garrett_rank.R

kendall_wR Documentation

Kendall's Coefficient of Concordance

Description

Computes Kendall's coefficient of concordance (W) for complete, untied ranking data.

Usage

kendall_w(data, respondent = NULL)

Arguments

data

A data.frame, matrix, CSV file path, or Excel file path containing ranking data.

respondent

Optional respondent ID column name or column position to exclude before analysis.

Details

Each row must represent one respondent and each column one factor. Each respondent must assign every rank from 1 to the number of factors exactly once. Tied ranks are not supported.

Value

An object of class "kendall_w", which is a list containing:

statistic

Kendall's coefficient of concordance (W), ranging from 0 to 1, where larger values indicate stronger agreement among respondents.

chisq

The chi-square statistic used to test the statistical significance of the concordance.

df

Degrees of freedom for the chi-square test.

p.value

The p-value associated with the chi-square test.

respondents

The number of respondents included in the analysis.

factors

The number of ranked factors.

rank_sum

A named numeric vector containing the sum of ranks assigned to each factor across respondents.

call

The matched function call.

Examples


data(garrett_example)
kw <- kendall_w(garrett_example,respondent = "Respondent")
kw
summary(kw)


GarrettRank documentation built on Oct. 6, 2026, 5:07 p.m.