Arte SheetsLearn. Try. Understand.

Statistical

Kendall's Tau (tau-a & tau-b) & Somers' D Rank Concordance formulas

Measure ordinal rating and credit-scorecard rank agreement from Concordant (C), Discordant (D), and Tied pairs via Tau-a, tie-adjusted Tau-b, and Somers' D.

Define mutually exclusive pair counts before calculating association

For every unordered pair, classify it as concordant C, discordant D, tied only on X (Tx), tied only on Y (Ty), or tied on both (Tboth). These five counts must sum to N(N-1)/2. This example starts with supplied counts; it does not calculate them from raw ratings.

Tau-a divides C-D by all pairs. Tau-b adjusts for ties using sqrt((C+D+Tx)(C+D+Ty)). Ties on both variables are excluded from Tx and Ty. Some monotonic data with unequal tie patterns have tau-b below one.

Somers D(Y|X) divides by pairs not tied on X, namely C+D+Ty. Swapping variables changes the denominator. The familiar binary AUC relation requires the correct orientation: with X the binary class and Y a score increasing toward class 1, D(Y|X)=2*AUC-1 using half credit for tied scores. Merely making Y binary does not establish that identity for the displayed orientation.

These are association statistics, not causation, calibration or model-validation certificates. The input checks enforce numeric nonnegative whole counts and total consistency; they cannot prove that arbitrary supplied counts came from a realizable set of rankings.

Ordinal Concordance MetricFormulaUntied (N=10, C=36, D=9)With Ties (C=30, D=6, Tx=5, Ty=4)
Total Pairs N*(N-1)/2(B2 * (B2 - 1)) / 245 pairs45 pairs
Kendall's Tau-a(B3 - B4) / TotalPairs(36 - 9) / 45 = 0.6000(30 - 6) / 45 = 0.5333
Kendall's Tie-Adjusted Tau-b(C-D) / SQRT((C+D+Tx)*(C+D+Ty))0.600024 / SQRT(41 * 40) = 0.5926
Asymmetric Somers' D_{Y|X}(C - D) / (C + D + T_y)27 / 45 = 0.600024 / 40 = 0.6000

Tie-adjusted Kendall's Tau-b = (C - D) / SQRT((C + D + Tx) * (C + D + Ty))

No comparable variation in either variable makes the denominator zero; report Undefined association instead of zero.

=IF(COUNT(B2:B7)<>6,"Invalid inputs",IF(OR(B2<2,B2<>INT(B2),B3<>INT(B3),B4<>INT(B4),B5<>INT(B5),B6<>INT(B6),B7<>INT(B7),MIN(B3:B7)<0,SUM(B3:B7)<>B2*(B2-1)/2),"Invalid inputs",IF((B3+B4+B5)*(B3+B4+B6)=0,"Undefined association",ROUND((B3 - B4) / SQRT((B3 + B4 + B5) * (B3 + B4 + B6)), 4))))

Somers D(Y|X): normalize by pairs not tied on X

Count Y-only ties in the denominator. This statistic need not equal D(X|Y).

=IF(COUNT(B2:B7)<>6,"Invalid inputs",IF(OR(B2<2,B2<>INT(B2),B3<>INT(B3),B4<>INT(B4),B5<>INT(B5),B6<>INT(B6),B7<>INT(B7),MIN(B3:B7)<0,SUM(B3:B7)<>B2*(B2-1)/2),"Invalid inputs",IF(B3+B4+B6=0,"Undefined association",ROUND((B3 - B4) / (B3 + B4 + B6), 4))))

Tau-a including tied pairs in the total

All unordered pairs are included in this denominator. Tau-a can be zero when all pairs are tied even though tau-b and Somers D are undefined.

=IF(COUNT(B2:B7)<>6,"Invalid inputs",IF(OR(B2<2,B2<>INT(B2),B3<>INT(B3),B4<>INT(B4),B5<>INT(B5),B6<>INT(B6),B7<>INT(B7),MIN(B3:B7)<0,SUM(B3:B7)<>B2*(B2-1)/2),"Invalid inputs",ROUND((B3-B4)/(B2*(B2-1)/2),4)))

Try the example

Use the original values or change them to test your understanding.

Further reading