{
  "id": "kendall-rank-correlation",
  "title": "Kendall's Rank Correlation",
  "lang": "en",
  "source_lang": "en",
  "summary": "Kendall’s rank correlation measures ordinal association by comparing the numbers of concordant and discordant pairs of observations, with variants that handle tied ranks.",
  "category": "mathematics",
  "subcategory": "probability-statistics",
  "type": "concept",
  "aliases": [
    "Kendall’s tau",
    "Kendall rank correlation coefficient",
    "Kendall’s rank-order correlation"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/kendall-rank-correlation/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/kendall-rank-correlation/",
      "json": "https://aiwiki.page/zh/kendall-rank-correlation.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "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."
    },
    {
      "heading": "Concordant and discordant pairs",
      "text": "Consider \\(n\\) paired observations,\n\n\\[(x_1,y_1),\\ldots,(x_n,y_n).\\]\n\nFor each pair of distinct observations \\(i<j\\):\n\n- The pair is concordant if \\((x_i-x_j)(y_i-y_j)>0\\): the observation with the larger \\(x\\)-value also has the larger \\(y\\)-value.\n- The pair is discordant if \\((x_i-x_j)(y_i-y_j)<0\\): the observation with the larger \\(x\\)-value has the smaller \\(y\\)-value.\n- The pair is tied on one or both variables if the corresponding values are equal.\n\nLet \\(C\\) be the number of concordant pairs and \\(D\\) the number of discordant pairs. The total number of unordered observation pairs is the binomial coefficient\n\n\\[N=\\binom n2=\\frac{n(n-1)}2.\\]\n\nThe basic numerator is\n\n\\[S=C-D =\\sum_{i<j} \\operatorname{sgn}(x_i-x_j) \\operatorname{sgn}(y_i-y_j),\\]\n\nwhere \\(\\operatorname{sgn}(u)\\) is \\(1\\), \\(0\\), or \\(-1\\) according to whether \\(u\\) is positive, zero, or negative.\n\nWhen there are no ties, \\(C+D=N\\). Perfect agreement in ordering gives a coefficient of \\(1\\), and perfectly reversed ordering gives \\(-1\\).\n\nExample\n\nSuppose four objects receive the following ranks:\n\nObject | Ranking \\(X\\) | Ranking \\(Y\\)\nA | 1 | 1\nB | 2 | 3\nC | 3 | 2\nD | 4 | 4\n\nThere are six pairs. Only the pair B–C is discordant, so \\(C=5\\) and \\(D=1\\). With no ties,\n\n\\[\\tau=\\frac{5-1}{6}=\\frac23.\\]\n\nThis indicates that concordant pairs substantially outnumber discordant pairs; it does not mean that two-thirds of the objects have identical ranks."
    },
    {
      "heading": "Main variants",
      "text": "Tau-a\n\nThe simplest normalization is\n\n\\[\\tau_a=\\frac{C-D}{N}.\\]\n\nWhen ties occur, tied pairs contribute zero to the numerator but remain in the denominator. Consequently, ties can prevent \\(\\tau_a\\) from attaining \\(1\\) or \\(-1\\), even when there are no disagreements among comparable pairs.\n\nTau-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.\n\nTau-b\n\nTau-b adjusts the denominator for ties:\n\n\\[\\tau_b= \\frac{C-D}{\\sqrt{(N-T_x)(N-T_y)}},\\]\n\nwhere \\(T_x\\) is the number of pairs tied on \\(X\\), including pairs also tied on \\(Y\\), and \\(T_y\\) is defined analogously.\n\nIf the tie groups in \\(X\\) have sizes \\(t_1,t_2,\\ldots\\), then\n\n\\[T_x=\\sum_g \\binom{t_g}{2},\\]\n\nwith an analogous expression for \\(T_y\\).\n\nAn equivalent formula is\n\n\\[\\tau_b= \\frac{C-D} {\\sqrt{(C+D+U_x)(C+D+U_y)}},\\]\n\nwhere \\(U_x\\) counts pairs tied only on \\(X\\), and \\(U_y\\) counts pairs tied only on \\(Y\\). Pairs tied on both variables appear in neither factor.\n\nTau-b lies between \\(-1\\) and \\(1\\) 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]\\) for particular, incompatible patterns of ties in the two variables.\n\nTau-c\n\nTau-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\n\n\\[\\tau_c=\\frac{2m(C-D)}{n^2(m-1)},\\]\n\nwhere \\(m\\) is the smaller of the numbers of distinct observed categories of the two variables, and \\(m>1\\).\n\nIts 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=n\\), and the two formulas coincide."
    },
    {
      "heading": "Population interpretation",
      "text": "Let \\((X,Y)\\) and \\((X',Y')\\) be independent observations from the same joint distribution. The population counterpart of tau-a is\n\n\\[\\tau= \\mathbb{E}\\!\\left[ \\operatorname{sgn}(X-X') \\operatorname{sgn}(Y-Y') \\right],\\]\n\nwhere \\(\\mathbb{E}\\) denotes expected value. Equivalently,\n\n\\[\\tau= \\Pr\\bigl((X-X')(Y-Y')>0\\bigr) - \\Pr\\bigl((X-X')(Y-Y')<0\\bigr).\\]\n\nFor continuous marginal distributions, ties have probability zero. Thus,\n\n\\[\\Pr(\\text{concordance})=\\frac{1+\\tau}{2}.\\]\n\nFor example, a population value of \\(\\tau=0.6\\) means that two independently selected observations are concordant with probability \\(0.8\\), under the no-ties assumption.\n\nThe 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.\n\nWith discrete variables, a population version corresponding to tau-b is\n\n\\[\\tau_b= \\frac{ \\mathbb{E}[ \\operatorname{sgn}(X-X') \\operatorname{sgn}(Y-Y')] }{ \\sqrt{\\Pr(X\\ne X')\\Pr(Y\\ne Y')} },\\]\n\nprovided both denominator probabilities are positive."
    },
    {
      "heading": "Properties and interpretation",
      "text": "Invariance under order-preserving transformations\n\nKendall’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.\n\nA transformation that is not strictly monotonic may create ties and change the result.\n\nThis invariance makes Kendall’s correlation suitable for ordinal scales, where category order is meaningful but numerical differences need not be.\n\nAssociation is not independence\n\nIndependence implies zero population Kendall correlation when the coefficient is defined, but zero Kendall correlation does not generally imply independence.\n\nFor example, let \\(X\\) have a continuous distribution symmetric about zero and let \\(Y=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.\n\nLikewise, rank association alone does not establish causation.\n\nSensitivity to extreme observations\n\nMaking 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.\n\nIt is not immune to unusual or contaminated observations: a single observation participates in \\(n-1\\) pairs, and changing its position can change all of those pairwise comparisons."
    },
    {
      "heading": "Statistical inference",
      "text": "Kendall’s correlation is commonly used in hypothesis testing for association.\n\nExact testing\n\nUnder 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.\n\nFor 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.\n\nLarge-sample approximation\n\nFor independent observations with continuous marginal distributions, under independence,\n\n\\[\\mathbb{E}(S)=0, \\qquad \\operatorname{Var}(S)= \\frac{n(n-1)(2n+5)}{18}.\\]\n\nConsequently,\n\n\\[\\operatorname{Var}(\\tau_a) = \\frac{2(2n+5)}{9n(n-1)}.\\]\n\nFor sufficiently large samples,\n\n\\[Z= \\frac{S}{\\sqrt{\\operatorname{Var}(S)}}\\]\n\nhas an approximately standard normal distribution under the null. Some implementations apply a continuity correction.\n\nTies 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 \\(X\\) and \\(Y\\).\n\nA 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.\n\nTesting 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."
    },
    {
      "heading": "Relationship to other measures",
      "text": "Pearson and Spearman correlation\n\nPearson’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.\n\nSpearman’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.\n\nThe coefficients have different numerical scales. A Kendall coefficient and a Spearman coefficient of the same magnitude do not necessarily indicate equivalent association strength.\n\nFor a nondegenerate bivariate normal distribution with Pearson correlation \\(\\rho\\),\n\n\\[\\tau=\\frac{2}{\\pi}\\arcsin(\\rho).\\]\n\nThis identity depends on the distributional setting and is not a universal conversion formula.\n\nKendall distance\n\nFor two complete rankings without ties, the Kendall distance is the number of discordant pairs \\(D\\). The correlation and distance satisfy\n\n\\[\\tau=1-\\frac{2D}{N} =1-\\frac{4D}{n(n-1)}.\\]\n\nThus, correlation describes agreement, while the corresponding distance counts pairwise disagreements. Extensions to partial rankings and ties require additional conventions."
    },
    {
      "heading": "Computation and applications",
      "text": "Direct comparison of all pairs requires \\(O(n^2)\\) operations. Sorting observations by one variable and counting inversions in the other permits \\(O(n\\log n)\\) algorithms, with additional bookkeeping for ties. These bounds use big-O notation.\n\nCommon applications include:\n\n- Ordinal measurements: assessing association between ordered categories without assuming equal category spacing.\n- Ranking comparison: comparing rankings produced by judges, systems, or scoring methods.\n- Monotonic association analysis: describing relationships that need not be linear.\n- Trend detection: relating measurements to time order.\n\nThe 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.\n\nInterpretation 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."
    }
  ],
  "links": [
    "correlation",
    "binomial-coefficient",
    "joint-probability-distribution",
    "expected-value",
    "monotonic-function",
    "statistical-independence",
    "causation",
    "statistical-hypothesis-testing",
    "null-hypothesis",
    "p-value",
    "normal-distribution",
    "variance",
    "confidence-interval",
    "bootstrap-sampling",
    "spearman-rank-correlation",
    "multivariate-normal-distribution",
    "big-o-notation"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}