Compute Kendall's tau for each of the variables specified by the input arguments.
For matrices, each row is an observation and each column a variable; vectors are always observations and may be row or column vectors.
kendall (
x)
is equivalent tokendall (
x,
x)
.For two data vectors x, y of common length n, Kendall's tau is the correlation of the signs of all rank differences of x and y; i.e., if both x and y have distinct entries, then
in which the are the ranks of x and y, respectively.
If x and y are drawn from independent distributions, Kendall's tau is asymptotically normal with mean 0 and variance
(2 * (2
n+5)) / (9 *
n* (
n-1))
.