Kendall Tau-b Tied Pairs
Count concordance and distinguish single-axis ties from joint ties in rank association.
By Riano · Published · Updated · Report a correction
Kendall Tau-b Tied Pairs
Concept Overview
Kendall rank correlation coefficient, specifically Tau-b, is a non-parametric measure of strength and direction of association that exists between two variables measured on at least an ordinal scale. Unlike Tau-a, Tau-b makes adjustments for ties. It computes the concordance by distinguishing single-axis ties from joint ties in rank association.
Worked Example
Let us calculate Kendall Tau-b for a dataset with X ties, with prefix 4. The datasets are x = [1, 1, 2, 3] and y = [1, 2, 3, 4]. We compare all pairs of observations (i, j) where i < j.
- Pair (1, 1) and (1, 2): dx = 1 - 1 = 0, dy = 1 - 2 = -1. This is a tie in X (Tx).
- Pair (1, 1) and (2, 3): dx = 1 - 2 = -1, dy = 1 - 3 = -2. Signs match, so this is concordant (P).
- Pair (1, 1) and (3, 4): dx = 1 - 3 = -2, dy = 1 - 4 = -3. Signs match, concordant (P).
- Pair (1, 2) and (2, 3): dx = 1 - 2 = -1, dy = 2 - 3 = -1. Signs match, concordant (P).
- Pair (1, 2) and (3, 4): dx = 1 - 3 = -2, dy = 2 - 4 = -2. Signs match, concordant (P).
- Pair (2, 3) and (3, 4): dx = 2 - 3 = -1, dy = 3 - 4 = -1. Signs match, concordant (P).
Counting the pairs, we have P = 5 concordant pairs, Q = 0 discordant pairs, Tx = 1 tie in X, Ty = 0 ties in Y, and Tjoint = 0 joint ties. The total number of compared pairs is 6.
The formula for Tau-b is:
Plugging in the values:
Thus, the Kendall Tau-b is approximately 0.9128709291752769.
Experiment
You can interact with the Kendall Tau-b module to explore how different data configurations and dataset sizes affect the correlation coefficient.
- Locate the Data select control and choose Increasing.
- Set the Prefix control to 4. Observe that all 6 pairs are concordant and Tau-b is exactly 1.0.
- Change the Data select to Joint ties and see how it affects the counts of joint ties versus single-axis ties. Note that joint ties do not contribute to the denominator in the Tau-b calculation.
- Finally, select Constant for the Data control. Notice that all pairs become ties in X, resulting in a zero denominator. The module correctly displays "Unavailable" for Tau-b in this edge case.
Limitations
Kendall Tau-b is a measure of rank correlation, meaning it evaluates ordinal relationships and not linear associations like the Pearson correlation. It does not measure the rate of change or the scale of the relationship, only its monotonicity.
A significant limitation occurs when the denominator is zero. For example, if all values in one of the variables are identical (as seen in the "Constant" dataset), all pairs will be tied on that axis. In such cases, the correlation coefficient is mathematically undefined (division by zero), which we represent as "Unavailable".
References
For a complete definition and computational details, see the SciPy documentation on Kendall's Tau:
- scipy.stats.kendalltau - Primary reference for the Kendall Tau-b algorithm and tie adjustments.
Experience it interactively
Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Kendall Tau-b Tied Pairs module.
Try Kendall Tau-b Tied Pairs on Riano →