sorted version of . With these, the factors and used to compute are easily obtained in a single linear-time pass through the sorted arrays. Software Implementations R's statistics base-package implements the test cor.test(x, y, method = "kendall") in its "stats" package (also cor(x, y, method = "kendall") will work, but the latter does not return the p-value). For Python, the SciPy library implements the computation of in scipy.stats.kendalltau See also Correlation Kendall tau distance Kendall's W Spearman's rank correlation coefficient Goodman and Kruskal's gamma Theil–Sen estimator Mann–Whitney U test - it is equivalent to Kendall's tau correlation coefficient if one of the variables is binary. References Further reading External links Tied rank calculation Software for computing Kendall's tau on very large datasets Online software: computes Kendall's tau rank correlation Covariance and correlation Nonparametric statistics Statistical tests Independence (probability theory) de:Rangkorrelationskoeffizient#Kendalls Tau