Calculate Kendall tau rank correlation from paired X and Y observations or ranks, using tau-b to adjust for ties or tau-a over all pairs.
- Statistics Calculators
- Kendall Coefficient of Concordance Calculator
- Spearman Rank Correlation Calculator
Formula and pair counts
τb = (P − Q) / √[(P + Q + Tx)(P + Q + Ty)]. Here P is concordant pairs, Q is discordant pairs, Tx is pairs tied only in X, and Ty is pairs tied only in Y. Tau-a is (P − Q) / [n(n − 1)/2].
| Pair relationship | Count |
|---|---|
| X and Y order the pair alike | Concordant |
| X and Y order the pair oppositely | Discordant |
| Equal X but unequal Y | Tie only in X |
| Equal X and equal Y | Tied in both; excluded from Tx and Ty |
Example
For X = 1, 2, 3 and Y = 1, 3, 2, there are two concordant pairs and one discordant pair. With no ties, tau-a and tau-b both equal (2 − 1)/3 = 0.33333333.
Frequently asked questions
Should I enter ranks or original observations?
Either works when the observations have a meaningful order. Keep corresponding observations in the same position in both lists.
What happens when one list is constant?
Tau-b is undefined because its denominator is zero. Tau-a can be zero because every pair is tied in that variable.
Is the result a significance test?
No. This calculator reports the coefficient and pair counts. A p-value requires a specified statistical test and assumptions.
Reference: SciPy Kendall tau definitions and tie treatment.
