Solved – Difference between Spearman and Kendall-Tau correlation test

correlationkendall-tauspearman-rho

My question is not about the definition of the two rank correlation methods, but it is a more practical question: I have two variables, X and Y, and I calculate the rank correlation coefficient with the two approaches. With the Kendall-tau-b (which accounts for ties) I get tau = 0 and p-value = 1; with Spearman I get rho = -0.13 and p-value = 0.44.

Why does Kendall tell me there is exactly no correlation, while Spearman does see a nonzero correlation?

Best Answer

Spearman's $\rho$ and Kendall's $\tau$ are calculated differently. That is, they have different notions of "correlation". (As does Pearson's $r$.) Thus, they will output different correlation coefficients.

I don't see anything surprising about having one type of correlation zero and one nonzero.

Here is a fun little dataset with $\rho<0$, $r=0$ and $\tau>0$:

> xx <- 1:6
> yy <- c(-0.2,2.5,1,2,3.5,-1)
> plot(xx,yy,pch=19)
> cor(xx,yy,method="spearman")
[1] -0.02857143
> cor(xx,yy,method="kendall")
[1] 0.06666667
> cor(xx,yy,method="pearson")
[1] 1.748437e-18

correlation example

So different measures of correlation will output different results. Your next question probably is which coefficient you should use. Happily enough, we already have a question on this: Kendall Tau or Spearman's rho?