算法手册/ 实验/医学研究/ Kendall协调系数

Kendall协调系数

计算公式

符号

符号含义
m评价者数
n被评对象数
rij评价者 i 给对象 j 的秩
Rj对象 j 的秩和
Rj对象 j 的平均秩
WKendall 协调系数
χ2结校正后的 Friedman 检验统计量
χ20未校正的 Friedman 卡方值
C结校正因子
t某一秩次的并列个数

核心公式

公式 (1.1):秩和与 Kendall 协调系数
\[ R_j=\sum_{i=1}^{m}r_{ij},\qquad W=\frac{\chi^2}{m(n-1)} \]
公式 (1.2):Friedman 卡方值与结校正
\[ \chi^2_0=\frac{12}{mn(n+1)}\sum_{j=1}^{n}R_j^2-3m(n+1),\qquad C=1-\frac{\sum\left(t^3-t\right)}{m\left(n^3-n\right)},\qquad \chi^2=\frac{\chi^2_0}{C} \]
公式 (1.3):p 值与平均秩
\[ p=P\left(\chi^2_{n-1}\ge\chi^2\right),\qquad \bar R_j=\frac{R_j}{m} \]

参考文献

  1. Kendall, M. G., & Babington Smith, B. (1939). The problem of m rankings. The Annals of Mathematical Statistics, 10(3), 275–287.
  2. Friedman, M. (1937). The use of ranks to avoid the assumption of normality implicit in the analysis of variance. Journal of the American Statistical Association, 32(200), 675–701.

算法参数

参数取值默认影响
数据摆法 评价者在行 / 评价者在列 评价者在行 决定哪一维是评价者、哪一维是被评对象;有缺失时改变样本。

验证报告

数据与 R 包

数据文件 kendall_w.csv
样本与变量 N = 30;30 位评价者(行)× O1–O6 六个被评对象(列)
R 包 irr 0.85

提示词

用 Kendall 协调系数 W 检验 30 位评价者对 O1 到 O6 六个对象评分的一致性,数据一行一位评价者。

R 代码

library(irr)
options(digits = 15)
d <- read.csv("kendall_w.csv")
x <- as.matrix(d[, c("O1", "O2", "O3", "O4", "O5", "O6")])
r <- kendall(t(x), correct = TRUE)
print(r$value, digits = 15)
print(r$statistic, digits = 15)
print(r$p.value, digits = 15)
ranks <- t(apply(x, 1, rank))
rsum <- colSums(ranks)
print(rsum, digits = 15)
print(rsum / nrow(x), digits = 15)
print(rank(-rsum, ties.method = "average"), digits = 15)

对比结果

指标SPSSAUR差值
评价者数 M30300
被评对象数 N660
Kendall W0.75639553430.75639553439.73e−12
卡方值 χ²113.4593301435113.45933014354.07e−11
自由度550
p 值7.605547e−237.605547e−233.55e−15
O1 秩和155.5000000000155.50000000000
O2 秩和42.500000000042.50000000000
O3 秩和157.0000000000157.00000000000
O4 秩和79.000000000079.00000000000
O5 秩和129.0000000000129.00000000000
O6 秩和67.000000000067.00000000000

结论:W、χ²、自由度、p 值与六个对象的秩和均与 R 一致,最大差 4.1e−11;名次同为 O3 > O1 > O5 > O4 > O6 > O2。

操作手册 问题反馈

引用SPSSAU. Kendall协调系数:计算公式与参数[EB/OL]. SPSSAU算法手册, 2026-11-20. https://www.spssau.com/algorithm/general/kendall_w.html.