kendall {tranSurv} | R Documentation |
Computes the Unconditional Kendall's Tau
kendall(x, y = NULL)
x |
a numeric vector. |
y |
a numeric vector with compatible length to |
This function computes the unconditional Kendall's tau (the Kendall rank correlation coefficient) for two variables.
The returned value is equivalent to that from cor
with method = "kendall"
, but kendall
is
implemented in C.
The output is a numeric value for the unconditional Kendall's tau.
Kendall, M. G. (1938), A new measure of rank correlation, Biometrika, 81–93.
library(MASS) set.seed(1) dat <- mvrnorm(5000, c(0, 0), matrix(c(1, .5, .5, 1), 2)) ## True kendall's tau is 2 * asin(.5) / pi system.time(print(kendall(dat))) system.time(print(cor(dat, method = "kendall")))