Correlation calculator

Kendall's tau rank correlation calculator

Compute Kendall's τ-b (tau-b) rank correlation coefficient, z-score, and p-value based on concordant and discordant pair counts.

Run this test live in StatLab npm i @statlab/core

When to use it

Use for rank correlation in small sample sizes or data with many ties.

Required Inputs

  • X numeric/ordinal array
  • Y numeric/ordinal array

Mathematical Formula

τ = (C - D) / [ ½ n(n-1) ]

Reporting Cautions

  • Kendall’s tau value is generally smaller than Spearman’s rho on identical data.
  • Tau-b adjusts for ties in both X and Y.

Code Snippets (Python, R, TypeScript)

Python (SciPy / Statsmodels)
from scipy import stats
tau, p = stats.kendalltau(x_vals, y_vals)
print(f"tau={tau:.4f}, p={p:.4f}")
R Language
cor.test(x_vals, y_vals, method = "kendall")
TypeScript (@statlab/core)
import { kendallTau } from '@statlab/core';
const res = kendallTau(xVals, yVals);

Developer Use Cases & Production Integrations

  • Assessing rank correlation stability in small telemetry sample sizes.
  • Comparing ordinal benchmark ranking preferences across evaluators.

VoxelPulse Telemetry Control Plane

Continuous A/B testing, statistical telemetry analysis, and automated feedback loops for live backend services.

Explore VoxelPulse →

VoxelAssurance Release Readiness

Fixed-price AI release-readiness sprints, automated regression testing, and reliability statistical benchmarks.

Explore VoxelAssurance →

Related Statistical Test Calculators

Explore static calculators across the StatLab inference engine suite.