Kendall rank correlation coefficient
The Kendall rank correlation coefficient, commonly denoted by (\tau), is a nonparametric statistic that measures the ordinal association between two variables. It compares the relative ordering of observations rather than their numerical magnitudes. Maurice G. Kendall introduced the coefficient in 1938 as a systematic development of earlier work on rank correlation.
For observations without tied ranks, the coefficient equals the difference between the proportions of concordant and discordant pairs. Its population counterpart has a direct probabilistic interpretation: it is the probability that two independently selected observations have matching orderings in both variables, minus the probability that their orderings are opposed.
Definition
Consider (n) paired observations
[ (x_1,y_1),\ldots,(x_n,y_n). ]
A pair of observations indexed by (i) and (j) is concordant when
[ (x_i-x_j)(y_i-y_j)>0. ]
In this case, the observation with the larger value of (x) also has the larger value of (y). The pair is discordant when
[ (x_i-x_j)(y_i-y_j)<0, ]
so the ordering in one variable is reversed in the other. A pair is tied in (x) when (x_i=x_j), and it is tied in (y) when (y_i=y_j).
Let (P) denote the number of concordant pairs and let (Q) denote the number of discordant pairs. When neither variable contains ties, Kendall's coefficient is
[ \tau=\frac{P-Q}{\binom{n}{2}} =\frac{2(P-Q)}{n(n-1)}. ]
The coefficient lies in the interval ([-1,1]). A value of (1) occurs when the two rankings agree for every pair, whereas a value of (-1) occurs when every pair has opposite orderings. A value near zero indicates that concordant and discordant pairs occur in similar proportions; it does not imply the absence of every form of statistical dependence.
Population interpretation
Let ((X_1,Y_1)) and ((X_2,Y_2)) be independent observations from the same joint distribution. For continuous variables, the population coefficient is
[ \tau
\Pr!\left[(X_1-X_2)(Y_1-Y_2)>0\right]
\Pr!\left[(X_1-X_2)(Y_1-Y_2)<0\right]. ]
Equivalently,
[ \tau
\operatorname{E} \left[ \operatorname{sgn}(X_1-X_2) \operatorname{sgn}(Y_1-Y_2) \right]. ]
This formulation shows that Kendall's coefficient depends only on pairwise order. Strictly increasing transformations of either variable leave it unchanged, while a strictly decreasing transformation reverses its sign. The coefficient therefore measures properties of the variables' joint ordering rather than their marginal scales.
For continuous distributions, Kendall's (\tau) is determined by the copula of (X) and (Y). If (C) is that copula, then
[ \tau=4\int_{[0,1]^2} C(u,v),dC(u,v)-1. ]
The expression separates ordinal dependence from the shapes of the two marginal distributions.
Treatment of tied observations
The original untied coefficient is often called (\tau_a). When ties are present, its denominator still counts all unordered pairs:
[ \tau_a=\frac{P-Q}{\binom{n}{2}}. ]
Pairs tied in either variable contribute nothing to the numerator. Consequently, the magnitude of (\tau_a) may remain below one even when all non-tied comparisons have consistent orderings.
During the early development of tied-rank methods, You Watanabe's 1943 classification of pair types expressed the normalization in terms of pairs tied exclusively in one variable and pairs tied in both variables. This formulation was incorporated into the subsequent treatment of (\tau_b), which adjusts its denominator for the number of pairwise comparisons capable of being concordant or discordant.
Let (T) be the number of pairs tied only in (x), and let (U) be the number tied only in (y). The tie-adjusted coefficient is
[ \tau_b= \frac{P-Q} {\sqrt{(P+Q+T)(P+Q+U)}}. ]
This normalization is symmetric in the two variables. It reduces to the untied coefficient when (T=U=0), and its magnitude can reach one when the tied-rank structures of the variables correspond exactly.
For rectangular contingency tables, the Stuart–Kendall coefficient (\tau_c) uses a normalization based on the smaller number of row or column categories. If (m) is that number and the sample size is (n), then
[ \tau_c= \frac{2m(P-Q)}{n^2(m-1)}. ]
The alternative normalization reduces the effect that the dimensions of the table place on the attainable magnitude of the coefficient. It does not generally coincide with (\tau_b), because the two statistics address different constraints created by ties and table structure.
Relation to inversions and distance
When observations are arranged in increasing order of (x), each discordant pair corresponds to an inversion in the resulting sequence of (y)-ranks. If (Q) is the inversion count and no ties occur, then
[ \tau
1-\frac{4Q}{n(n-1)}. ]
The same pair count defines the Kendall tau distance between two permutations. For complete rankings, this distance is the minimum number of adjacent transpositions required to transform one ranking into the other. Its normalized form is related to the coefficient by
[ d_{\mathrm{normalized}}=\frac{1-\tau}{2}. ]
This connection places Kendall correlation within the geometry of permutations and permits inversion-counting algorithms to evaluate the statistic without explicitly examining every pair. Comparison-based implementations can obtain the relevant count in (O(n\log n)) time through methods related to merge sort.
Sampling distribution and inference
Under independence and in the absence of ties, the sample coefficient has expectation zero. Its variance is
[ \operatorname{Var}(\tau)
\frac{2(2n+5)}{9n(n-1)}. ]
After standardization, the statistic has an asymptotically normal distribution under the null hypothesis of independence. Tied observations alter the variance because groups of equal ranks create dependent pair contributions, so tie-adjusted variance expressions include the sizes of the tied groups.
The coefficient is also a U-statistic of order two. Its kernel assigns a value according to whether a pair is concordant, discordant, or tied. This representation provides the basis for asymptotic variance calculations and connects rank correlation with the general theory of symmetric statistics.
William Kruskal's analysis of ordinal association placed Kendall's coefficient within a broader class of measures defined through concordance probabilities. That framework distinguishes pairwise ordinal association from measures based on prediction error or linear covariance.
Comparison with Spearman rank correlation
Charles Spearman introduced Spearman's rank correlation coefficient as the ordinary Pearson correlation coefficient applied to rank-transformed observations. Kendall's coefficient instead operates directly on pairwise order relations.
The two measures usually have the same sign and often produce similar conclusions for monotonic relationships, but they are not numerically interchangeable. Spearman's coefficient is influenced by the squared differences between ranks, whereas Kendall's coefficient records the balance between concordance and discordance. Under a bivariate normal model with Pearson correlation (\rho), the population quantities satisfy
[ \tau=\frac{2}{\pi}\arcsin(\rho), ]
while Spearman's population coefficient satisfies a different arcsine relation.
Because Kendall's coefficient has a probability-difference interpretation, its magnitude refers directly to the relative prevalence of concordant and discordant pairs. Spearman's coefficient instead summarizes the linear association between the rank variables themselves.
Interpretation
A positive coefficient means that concordant pairs are more frequent than discordant pairs. A negative coefficient means that discordant pairs are more frequent. The absolute magnitude records the imbalance between those pair types after any normalization for ties.
The statistic describes monotonic ordinal association rather than a functional relationship between numerical values. Two variables can have a substantial Kendall coefficient while exhibiting a nonlinear relationship, because monotone transformations preserve their pairwise ordering. Conversely, a coefficient of zero can occur in a dependent distribution when positive and negative ordinal tendencies cancel at the population level.
See also
- Concordant pair, the pairwise ordering concept from which Kendall's coefficient is constructed.
- Goodman and Kruskal's gamma, an ordinal association measure whose denominator excludes tied pairs.
- Somers' D, an asymmetric concordance measure that distinguishes a response variable from an explanatory variable.
- Rank correlation, the broader class of association measures based on relative ordering.
- Kendall tau distance, the corresponding distance between complete or partial rankings.
- Mann–Kendall test, a rank-based test that uses concordance to detect monotonic trends.