Kendall Tau Correlation Calculator
Statistics
- S statistic: 40 - 10 = 30.
- Tau-b denominator: sqrt((40 + 10 + 5) x (40 + 10 + 5)) = 55.0.
- Kendall tau-b: 30 / 55.0 = 0.545.
- Tau-a uses all 66 pairs: 30 / 66 = 0.455.
Kendall's tau asks the simplest possible question about two rankings: pick any two items - do they stand in the same order on both? Pairs that agree are concordant, pairs that disagree are discordant, and tau is built from the balance between them. It needs no assumption about distributions, works on raw ordinal data, and has a direct probability interpretation that Pearson's r cannot match.
This calculator starts from the pair counts - concordant, discordant, tied on X only, tied on Y only - plus the sample size, and returns tau-b (the tie-adjusted version most software reports), tau-a, the S statistic and the pairs tied on both variables, which it derives from the total pair count. If your software gives you S and the tie counts, this page converts them into the taus; if you are counting pairs by hand from a small table, it does the whole job.
Worked examples
Light ties, tau-b 0.545
(40 · 10 · 5 · 5 · 12)
| Kendall tau-b | 0.545 |
| S statistic | 30 |
| Tau-a | 0.455 |
| Pairs tied on both | 6 |
No association, 0.000
(25 · 25 · 0 · 0 · 11)
| Kendall tau-b | 0.000 |
| S statistic | 0 |
| Tau-a | 0.000 |
| Pairs tied on both | 5 |
Heavy ties, tau-b 0.626
(90 · 15 · 10 · 20 · 17)
| Kendall tau-b | 0.626 |
| S statistic | 75 |
| Tau-a | 0.551 |
| Pairs tied on both | 1 |
Concordant and discordant pairs
With n items there are n(n-1)/2 pairs. For each pair, compare the order on X with the order on Y: same direction is concordant, opposite is discordant, equal on one variable is a tie on that variable, equal on both is a double tie. S is simply concordant minus discordant. In the first worked example - 40 concordant, 10 discordant, 5 ties each way, n = 12 - there are 66 pairs in total, S is 30, and 6 pairs are tied on both variables, the remainder the formula leaves over.
Counting pairs by hand is feasible only for small n, but the counts are what software accumulates internally, and they are worth understanding because they expose what tau sees: nothing but order. Two datasets with identical pair counts have identical tau, however different their values - tau is blind to how far apart items are, only to which side of each other they stand.
The pair-counting view also explains tau's behaviour with sample size: each new observation creates pairs with every existing one, so information grows quadratically in a sense - going from n = 12 to n = 17 grows the pair count from 66 to 136, doubling the evidence base with five more subjects. That is why the third example's tau, built on 136 pairs, is a steadier estimate than the first example's on 66, quite apart from the tie correction.
- S = concordant - discordant
- Total pairs = n(n-1)/2
- Tau-a = S / total pairs
- Tau-b = S / sqrt((C + D + Tx)(C + D + Ty))
Tau-a versus tau-b and ties
Tau-a divides S by all pairs, ignoring ties in the denominator; it can only reach +/-1 when there are no ties at all. Tau-b corrects the denominator for ties on each variable separately, restoring the possibility of +/-1 for a perfectly ordered table with ties. In the first example the difference is visible: tau-a is 0.455 (30 over 66 pairs) while tau-b is 0.545 (30 over the tie-adjusted 55.0). Report tau-b whenever ties exist - which, with real rounded or ordinal data, is nearly always.
The third example shows heavier ties: 90 concordant, 15 discordant, 10 ties on X and 20 on Y out of 136 pairs (n = 17), leaving just 1 pair tied on both. Tau-b is 0.626 against tau-a's 0.551 - the tie correction is worth 0.075 here, and it grows with the tie burden. A tau quoted without saying which one it is, in tied data, is an ambiguous number.
Tau has a less obvious virtue in meta-analysis and replication: because it is a probability difference, taus from studies with different scales and instruments remain comparable in a way raw-score correlations are not. Two labs measuring 'agreement between two judges' with different rubrics can both report tau-b, and the numbers mean the same thing - the excess of concordant over discordant pairs, tie-adjusted. That comparability is one reason inter-rater studies so often quote it.
| Example | C / D | Tx / Ty | S | Tau-a | Tau-b |
|---|---|---|---|---|---|
| Light ties | 40 / 10 | 5 / 5 | 30 | 0.455 | 0.545 |
| No association | 25 / 25 | 0 / 0 | 0 | 0.000 | 0.000 |
| Heavy ties | 90 / 15 | 10 / 20 | 75 | 0.551 | 0.626 |
Worked examples: three pair tables
The no-association example is the calibration point: 25 concordant and 25 discordant pairs give S = 0 and both taus exactly 0.000, however large the counts. Tau measures the balance, not the volume - a million pairs split evenly are still zero association. Its 5 double-tied pairs (55 total pairs at n = 11, minus the 50 classified) show that ties alone do not move tau either; only the concordant-discordant imbalance does.
Reading the first example as a probability: tau-b of 0.545 means that, among pairs not tied on the relevant variable, concordance beats discordance by a margin of about 55 % of the pairs judged. That plain-language reading is tau's great advantage in reports to non-statisticians - no other common correlation coefficient can be said in one sentence without lying.
The heavy-ties example also shows why the double-tie count matters less than the single ties: only 1 of its 136 pairs is tied on both, while 30 pairs carry a single tie - it is the single ties, on X or on Y separately, that shrink the effective pair base and that tau-b's two denominator factors each correct for.
Reading tau as a probability difference
Formally, tau estimates P(concordant) - P(discordant) for a randomly drawn pair. A tau of 0.626 (third example) says a random pair is far more likely to agree than disagree; a tau of 0 says agreement and disagreement are equally likely, which is the definition of no monotone association. Negative tau reverses the story. This interpretation also explains tau's robustness: moving one observation changes only the pairs it belongs to, so a single wild value cannot dominate the statistic the way it can dominate Pearson's r.
The price of robustness is efficiency: with truly normal data, tau uses the information slightly less efficiently than Pearson, needing a somewhat larger sample for the same precision. With ordinal data, heavy tails or outliers - the data tau was built for - the trade reverses decisively in tau's favour.
Significance testing, briefly: under no association, S has a known variance that depends on n and the tie structure, and the ratio S/SE is approximately normal for moderate n - which is why software reports a z and a p beside the tau. The calculator deliberately stops at the coefficients themselves; if your pair counts come from a study, the SE and p-value belong with the study's own software run. What this page guarantees is that the tau those programs print can be reproduced from the counts, the audit trail closed.
Kendall versus Spearman
Spearman's rho is the other rank correlation, Pearson applied to ranks. The two usually agree in sign and rough size, with rho typically larger in magnitude (a tau of 0.545 corresponds to a rho around 0.75 under normality). Tau is preferred when the probability interpretation matters, when ties are heavy (its tie handling is cleaner), and in small samples, where its distribution is better behaved. Rho is preferred when the audience knows Pearson and wants the familiar scale.
Whichever you report, report the pair structure behind it when you can: the counts on this page - C, D, Tx, Ty and the double ties - are a complete audit trail from data to coefficient, something neither a bare tau nor a bare rho provides.
A note on what tau cannot see: non-monotone association. If Y rises with X and then falls - an inverted U - concordant and discordant pairs cancel and tau reports something near zero for a strongly structured relationship, exactly as the balanced 25/25 example reports 0.000 for noise. Tau is a measure of monotone trend, full stop; plot the data before trusting any single coefficient, rank-based or not. Where a U-shape is plausible, no correlation on this page or its cousins will rescue the analysis - model the curve instead.
FAQs
40 concordant, 10 discordant, 5 ties each way, n = 12: tau-b?
S is 30, the denominator 55.0, and tau-b is 0.545.
What is tau-a for the same data?
0.455: S = 30 over all 66 pairs.
How many pairs were tied on both variables in the first example?
6: 66 total pairs minus the 60 accounted for by concordant, discordant and single ties.
25 concordant and 25 discordant pairs - tau?
S = 0, so tau-a and tau-b are both 0.000.
The third example has S = 75 from 90 concordant and 15 discordant. Tau-b?
0.626, with a tie-adjusted denominator of 119.9, and tau-a 0.551 over 136 pairs.
Why does tau-b exceed tau-a in these examples?
Tau-b's denominator excludes pairs tied on both variables (6, 5 and 1 across the examples), so it is smaller than the full pair count.