# Difference between Spearman and Kendall-Tau correlation test

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?

• Spearman's rho and Kendall's tau are calculated in different ways. Why do you believe that something is going wrong with the Kendall tau calculation (and not the Spearman one)? – S. Kolassa - Reinstate Monica Oct 25 '17 at 17:09
• Because I get a P-value of 1... Is not that suspicious? – Angela Oct 25 '17 at 18:42
• $p=1$ is a direct consequence of $\tau_b=0$, so the question is why $\tau_b=0$ and $\rho= -.13$ is a problem for you. – S. Kolassa - Reinstate Monica Oct 25 '17 at 18:46
• Then, I re-formulate my question: why according the Kendall-tau there is an exact no-correlation, while Spearman is less strict on that? – Angela Oct 25 '17 at 19:52
• Thank you. That clarification makes for a much better question. I took the liberty of editing it into your post (and upvoting) and answering. Hope my answer is helpful. – S. Kolassa - Reinstate Monica Oct 25 '17 at 20:43

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


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?