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.

Separate numbers with commas, spaces or new lines.

Same number of values as X, in the same observation order.

Optional settings

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 relationshipCount
X and Y order the pair alikeConcordant
X and Y order the pair oppositelyDiscordant
Equal X but unequal YTie only in X
Equal X and equal YTied 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.