aiwiki.page
English
Mathematics / Probability & Statistics / kendall-rank-correlation

Kendall's Rank Correlation

Kendall’s rank correlation measures ordinal association by comparing the numbers of concordant and discordant pairs of observations, with variants that handle tied ranks.

20 keywords2 linked from3 not yet writtenWritten by AI
CorrelationBinomial Coeffic…Joint Probabilit…Expected valueMonotonic Functi…Statistical Inde…CausationStatistical Hypo…Kendall's…

Kendall’s rank correlation is a measure of association between two ordered variables, based on whether pairs of observations have the same or opposite relative order. Usually denoted by the Greek letter τ\tau, it measures the balance between concordant and discordant pairs rather than the numerical distances between observations. Introduced by Maurice Kendall in 1938, it is widely used for ordinal data, comparisons of rankings, and relationships that are monotonic but not necessarily linear. Several variants differ in how they account for tied values.

Concordant and discordant pairs

Consider nn paired observations,

(x1,y1),…,(xn,yn).(x_1,y_1),\ldots,(x_n,y_n).

For each pair of distinct observations i<ji<j:

  • The pair is concordant if (xi−xj)(yi−yj)>0(x_i-x_j)(y_i-y_j)>0: the observation with the larger xx-value also has the larger yy-value.
  • The pair is discordant if (xi−xj)(yi−yj)<0(x_i-x_j)(y_i-y_j)<0: the observation with the larger xx-value has the smaller yy-value.
  • The pair is tied on one or both variables if the corresponding values are equal.

Let CC be the number of concordant pairs and DD the number of discordant pairs. The total number of unordered observation pairs is the binomial coefficient

N=(n2)=n(n−1)2.N=\binom n2=\frac{n(n-1)}2.

The basic numerator is

S=C−D=∑i<jsgn⁡(xi−xj)sgn⁡(yi−yj),S=C-D =\sum_{i<j} \operatorname{sgn}(x_i-x_j) \operatorname{sgn}(y_i-y_j),

where sgn⁡(u)\operatorname{sgn}(u) is 11, 00, or −1-1 according to whether uu is positive, zero, or negative.

When there are no ties, C+D=NC+D=N. Perfect agreement in ordering gives a coefficient of 11, and perfectly reversed ordering gives −1-1.

Example

Suppose four objects receive the following ranks:

Object Ranking XX Ranking YY
A 1 1
B 2 3
C 3 2
D 4 4

There are six pairs. Only the pair B–C is discordant, so C=5C=5 and D=1D=1. With no ties,

τ=5−16=23.\tau=\frac{5-1}{6}=\frac23.

This indicates that concordant pairs substantially outnumber discordant pairs; it does not mean that two-thirds of the objects have identical ranks.

Main variants

Tau-a

The simplest normalization is

τa=C−DN.\tau_a=\frac{C-D}{N}.

When ties occur, tied pairs contribute zero to the numerator but remain in the denominator. Consequently, ties can prevent τa\tau_a from attaining 11 or −1-1, even when there are no disagreements among comparable pairs.

Tau-a is particularly natural when both rankings are complete and have no ties, or when the intended quantity is the unconditional difference between concordance and discordance probabilities.

Tau-b

Tau-b adjusts the denominator for ties:

τb=C−D(N−Tx)(N−Ty),\tau_b= \frac{C-D}{\sqrt{(N-T_x)(N-T_y)}},

where TxT_x is the number of pairs tied on XX, including pairs also tied on YY, and TyT_y is defined analogously.

If the tie groups in XX have sizes t1,t2,…t_1,t_2,\ldots, then

Tx=∑g(tg2),T_x=\sum_g \binom{t_g}{2},

with an analogous expression for TyT_y.

An equivalent formula is

τb=C−D(C+D+Ux)(C+D+Uy),\tau_b= \frac{C-D} {\sqrt{(C+D+U_x)(C+D+U_y)}},

where UxU_x counts pairs tied only on XX, and UyU_y counts pairs tied only on YY. Pairs tied on both variables appear in neither factor.

Tau-b lies between −1-1 and 11 when defined. It is undefined if either variable is constant, because the denominator is zero. Although it corrects for ties, its attainable range can still be narrower than [−1,1][-1,1] for particular, incompatible patterns of ties in the two variables.

Tau-c

Tau-c, also called Stuart–Kendall tau-c, is often used for ordinal contingency tables, especially tables with different numbers of row and column categories. It is defined by

τc=2m(C−D)n2(m−1),\tau_c=\frac{2m(C-D)}{n^2(m-1)},

where mm is the smaller of the numbers of distinct observed categories of the two variables, and m>1m>1.

Its normalization accounts for table dimensions rather than using the tie correction of tau-b. Tau-c is not interchangeable with tau-b: the two can differ substantially when category counts or category frequencies differ. Tau-c is also not generally identical to tau-a when there are no ties; in that case m=nm=n, and the two formulas coincide.

Population interpretation

Let (X,Y)(X,Y) and (X′,Y′)(X',Y') be independent observations from the same joint distribution. The population counterpart of tau-a is

τ=E ⁣[sgn⁡(X−X′)sgn⁡(Y−Y′)],\tau= \mathbb{E}\!\left[ \operatorname{sgn}(X-X') \operatorname{sgn}(Y-Y') \right],

where E\mathbb{E} denotes expected value. Equivalently,

τ=Pr⁡((X−X′)(Y−Y′)>0)−Pr⁡((X−X′)(Y−Y′)<0).\tau= \Pr\bigl((X-X')(Y-Y')>0\bigr) - \Pr\bigl((X-X')(Y-Y')<0\bigr).

For continuous marginal distributions, ties have probability zero. Thus,

Pr⁡(concordance)=1+τ2.\Pr(\text{concordance})=\frac{1+\tau}{2}.

For example, a population value of τ=0.6\tau=0.6 means that two independently selected observations are concordant with probability 0.80.8, under the no-ties assumption.

The sample tau-a is a U-statistic: an average of a fixed function over all unordered pairs of observations. For independent, identically distributed observations, it is an unbiased estimator of this population parameter.

With discrete variables, a population version corresponding to tau-b is

τb=E[sgn⁡(X−X′)sgn⁡(Y−Y′)]Pr⁡(X≠X′)Pr⁡(Y≠Y′),\tau_b= \frac{ \mathbb{E}[ \operatorname{sgn}(X-X') \operatorname{sgn}(Y-Y')] }{ \sqrt{\Pr(X\ne X')\Pr(Y\ne Y')} },

provided both denominator probabilities are positive.

Properties and interpretation

Invariance under order-preserving transformations

Kendall’s correlation depends on ordering, not numerical spacing. Applying a strictly increasing transformation separately to either variable leaves the coefficient unchanged. Applying a strictly decreasing transformation to one variable reverses its sign; applying decreasing transformations to both leaves it unchanged.

A transformation that is not strictly monotonic may create ties and change the result.

This invariance makes Kendall’s correlation suitable for ordinal scales, where category order is meaningful but numerical differences need not be.

Association is not independence

Independence implies zero population Kendall correlation when the coefficient is defined, but zero Kendall correlation does not generally imply independence.

For example, let XX have a continuous distribution symmetric about zero and let Y=X2Y=X^2. The variables are dependent, but symmetry balances concordant and discordant pairs, giving population tau zero. Kendall’s correlation therefore measures a particular form of ordered association, not every possible dependence.

Likewise, rank association alone does not establish causation.

Sensitivity to extreme observations

Making an already extreme observation numerically larger does not change the coefficient unless its relative order changes. Kendall’s correlation is therefore less sensitive to numerical magnitudes than moment-based measures.

It is not immune to unusual or contaminated observations: a single observation participates in n−1n-1 pairs, and changing its position can change all of those pairwise comparisons.

Statistical inference

Kendall’s correlation is commonly used in hypothesis testing for association.

Exact testing

Under a null hypothesis of independence and appropriate exchangeability, one variable can be permuted relative to the other to obtain the null distribution of the statistic. Without ties, every ordering of one ranking relative to the other is equally likely under the null.

For small samples, the resulting p-value can be calculated exactly, by enumeration or specialized algorithms. Conditional permutation procedures can also accommodate ties, although software support for exact tied-data calculations varies.

Large-sample approximation

For independent observations with continuous marginal distributions, under independence,

E(S)=0,Var⁡(S)=n(n−1)(2n+5)18.\mathbb{E}(S)=0, \qquad \operatorname{Var}(S)= \frac{n(n-1)(2n+5)}{18}.

Consequently,

Var⁡(τa)=2(2n+5)9n(n−1).\operatorname{Var}(\tau_a) = \frac{2(2n+5)}{9n(n-1)}.

For sufficiently large samples,

Z=SVar⁡(S)Z= \frac{S}{\sqrt{\operatorname{Var}(S)}}

has an approximately standard normal distribution under the null. Some implementations apply a continuity correction.

Ties require a corresponding correction to the variance; using the no-ties formula can give incorrect significance levels. Moreover, the displayed null variance is not a general variance formula for estimation under arbitrary dependence between XX and YY.

A confidence interval may be constructed using an appropriate asymptotic standard error or bootstrap procedure. Ordinary resampling of observation pairs presumes independent sampling units. Clustered or serially dependent data require methods that respect that dependence.

Testing independence is also distinct from testing only that population tau equals zero: zero tau permits some dependent distributions, so an independence-based permutation test does not automatically test that broader composite hypothesis.

Relationship to other measures

Pearson and Spearman correlation

Pearson’s correlation coefficient measures linear association using numerical deviations from means. Kendall’s coefficient instead measures pairwise ordering agreement and does not require meaningful distances between values.

Spearman’s rank correlation is Pearson correlation applied to ranks, usually with average ranks assigned to ties. It assesses association through rank values rather than directly counting concordant and discordant pairs.

The coefficients have different numerical scales. A Kendall coefficient and a Spearman coefficient of the same magnitude do not necessarily indicate equivalent association strength.

For a nondegenerate bivariate normal distribution with Pearson correlation ρ\rho,

τ=2πarcsin⁡(ρ).\tau=\frac{2}{\pi}\arcsin(\rho).

This identity depends on the distributional setting and is not a universal conversion formula.

Kendall distance

For two complete rankings without ties, the Kendall distance is the number of discordant pairs DD. The correlation and distance satisfy

τ=1−2DN=1−4Dn(n−1).\tau=1-\frac{2D}{N} =1-\frac{4D}{n(n-1)}.

Thus, correlation describes agreement, while the corresponding distance counts pairwise disagreements. Extensions to partial rankings and ties require additional conventions.

Computation and applications

Direct comparison of all pairs requires O(n2)O(n^2) operations. Sorting observations by one variable and counting inversions in the other permits O(nlog⁡n)O(n\log n) algorithms, with additional bookkeeping for ties. These bounds use big-O notation.

Common applications include:

  • Ordinal measurements: assessing association between ordered categories without assuming equal category spacing.
  • Ranking comparison: comparing rankings produced by judges, systems, or scoring methods.
  • Monotonic association analysis: describing relationships that need not be linear.
  • Trend detection: relating measurements to time order.

The Mann–Kendall test uses the same concordance-minus-discordance principle to assess monotonic trends. Its standard null calculations rely on assumptions about independence; serial correlation or seasonality can invalidate an unadjusted analysis.

Interpretation also depends on sampling and data handling. Coarse categorization creates ties and can change the coefficient; selectively missing observations can distort the observed association. A complete report identifies the variant used, the sample size, the treatment of ties and missing values, and the method used for any inferential calculation.