Are there any R packages for the calculation of Kendall\'s tau-b and tau-c, and their associated standard errors? My searches on Google and Rseek have turned up nothing, but su
Just to expand of Stedy's answer... cor(x,y,method="kendall")
will give you the correlation, cor.test(x,y,method="kendall")
will give you a p-value and CI.
Also, take a look at the Kendall package, which provides a function which claims a better approximation.
> library(Kendall)
> Kendall(x,y)
There is also the cor.matrix function in the Deducer package for nice printing:
> library(Deducer)
> cor.matrix(variables=d(mpg,hp,wt),,
+ data=mtcars,
+ test=cor.test,
+ method='kendall',
+ alternative="two.sided",exact=F)
Kendall's rank correlation tau
mpg hp wt
mpg cor 1 -0.7428 -0.7278
N 32 32 32
stat** -5.871 -5.798
p-value 0.0000 0.0000
----------
hp cor -0.7428 1 0.6113
N 32 32 32
stat** -5.871 4.845
p-value 0.0000 0.0000
----------
wt cor -0.7278 0.6113 1
N 32 32 32
stat** -5.798 4.845
p-value 0.0000 0.0000
----------
** z
HA: two.sided