Kendall Tau-b Correlation Calculator
Kendall tau-b is a nonparametric correlation coefficient that measures the agreement between two ordinal variables directly, through pairwise comparisons. Every pair of observations is examined one by one: if both variables rank the pair in the same direction the pair is concordant, and if they rank it in opposite directions the pair is discordant. The coefficient is the excess of concordant pairs expressed as a proportion of the comparable pairs, and it ranges from −1 to +1.
This calculator counts every pair to obtain C and D, the pairs that contain a tie, the statistic S = C − D, the tie-corrected tau-b coefficient, z and p from the normal approximation, and a confidence interval for tau. The pair count is summarized in a table, and the same data is also run through Spearman rho for comparison, so you can see in concrete numbers why tau-b is the more reliable choice in small samples with many ties.
Kendall Tau Formulas
Total pairs: n₀ = n(n − 1)/2
S = C − D (C: concordant pairs, D: discordant pairs)
Tau-a: τ_a = S / n₀
Tau-b: τ_b = S / √[(n₀ − n_x)(n₀ − n_y)]
n_x = Σ tᵢ(tᵢ − 1)/2 (tie groups in X), n_y likewise for Y
Var(S) = [n(n−1)(2n+5) − Σtᵢ(tᵢ−1)(2tᵢ+5) − Σuⱼ(uⱼ−1)(2uⱼ+5)] / 18
+ [Σtᵢ(tᵢ−1)(tᵢ−2)·Σuⱼ(uⱼ−1)(uⱼ−2)] / [9n(n−1)(n−2)]
+ [Σtᵢ(tᵢ−1)·Σuⱼ(uⱼ−1)] / [2n(n−1)]
z = S / √Var(S) , p = 2·[1 − Φ(|z|)]
Confidence interval: tanh( artanh(τ_b) ± z_(1−α/2)·√(0.437/(n − 4)) )The tie-corrected Var(S) formula is Kendall's classic derivation and produces the same z value as the Nonparametric Correlations output in SPSS. Concordant and discordant pairs are counted here by an exhaustive O(n²) scan; no approximation is used.
How to Calculate
- Paste the X and Y values into the two fields in the same order; both fields must hold the same number of values, and each row must belong to the same observation.
- Choose the significance level (α) and the confidence level.
- Study the pair count table: it shows how many pairs are concordant, discordant, and tied, and how the ties affect the tau-b denominator.
- Read tau-b, z, and p together; the decision line states directly whether the relationship is significant at your α.
- Compare with Spearman rho: it is normal for tau-b to come out numerically smaller, because the two coefficients are defined on different scales.
- Report τ_b, z, p, and the confidence interval together in your write-up.
Worked Examples
Two ordinal measurements (with tied values)
Of the 45 pairs, 42 are concordant and none are discordant; the remaining 3 are tied on Y. S = 42 and τ_b = 0.966 (τ_a = 0.933). With Var(S) = 122, z = 3.803 and the relationship is significant at p < 0.001; the 95% confidence interval runs from 0.905 to 0.988, and Spearman rho is 0.991.
Kendall tau-b (τ_b): 0.966 · Effect size label: strong (|τ_b| = 0.966) · Kendall tau-a (τ_a): 0.933
Negative but non-significant agreement
Of the 45 pairs, 13 are concordant and 32 are discordant: S = -19 and τ_b = -0.422 (τ_a is identical because there are no ties). Since z = -1.699 stays below the critical value of 1.960, p = 0.089 and the relationship is not statistically significant; the 95% confidence interval runs from -0.753 to 0.078 and contains zero.
Kendall tau-b (τ_b): -0.422 · Effect size label: strong (|τ_b| = 0.422) · Kendall tau-a (τ_a): -0.422
Likert-type data (heavily tied)
Of the 66 pairs, 48 are concordant, 1 is discordant, and 17 are tied. With the tie correction τ_b = 0.832, while the uncorrected τ_a stops at 0.712 — the gap is the effect of the dense ties. With z = 3.394 and p < 0.001 the agreement is significant; Spearman rho = 0.909 gives a larger value.
Kendall tau-b (τ_b): 0.832 · Effect size label: strong (|τ_b| = 0.832) · Kendall tau-a (τ_a): 0.712