Kendall's Tau-b

From Q
Jump to navigation Jump to search

The correlation between two variables, x and y, is:

τb=ncnd(ntnx)(ntny)

where

nc=i=1nj=1nwi(Ixi>xj,yi>yj+Ixi>xj,yi>yj),
nd=i=1nj=1nwi(Ixi<xj,yi>yj+Ixi>xj,yi<yj),
nw=i=1nwi,
nt=nw(nw1)2,
nx=j=1ti=nnwiIxi=j,
ny=j=1ri=nnwiIyi=j,
wi is the Calibrated Weight for the ith of n is the number of observations,
x is a variable with t unique values, categorised in the range 1,2,..,t,
y is a variable with r unique values, categorised in the range 1,2,..,r,

The tests statistic is:

z=ncndv

where

v=(v0vxvy)/18+v1+v2,
v0=n(n1)(2n+5),
vx=jtxj(txj1)(2txj+5),
vy=jtyjtyj1)(2tyj+5),
v1=j=1rtxj(txj1)(txj2),
v2=j=1ttyj(tyj1)(tyj2),
v3=(v1v2)/(9nw(nw1)(nw2)),
v4=j=1rtxj(txj1),
v5=j=1ttyj(tyj1),
v6=(v4v5)/(2nw(nw1)),
σ^=(v0vxvy)/18+v3+v6,
z=ncndσ^,
p2(1Φ(|z|))

See also

Correlations - Comparing Two Numeric Variables