When to use it
Use when variables have monotonic relationships or non-normal ordinal distributions.
Required Inputs
- X numeric/ordinal array
- Y numeric/ordinal array
Calculate Spearman's rank correlation coefficient ρ (rho), t-statistic, and p-value for monotonic relationships between continuous or ordinal variables.
Run this test live in StatLab npm i @statlab/coreUse when variables have monotonic relationships or non-normal ordinal distributions.
ρ = 1 - [ 6 Σ d_i² / (n(n² - 1)) ]
from scipy import stats
rho, p = stats.spearmanr(x_vals, y_vals)
print(f"rho={rho:.4f}, p={p:.4f}")
cor.test(x_vals, y_vals, method = "spearman")
import { spearmanRho } from '@statlab/core';
const res = spearmanRho(xVals, yVals);
Continuous A/B testing, statistical telemetry analysis, and automated feedback loops for live backend services.
Explore VoxelPulse →Fixed-price AI release-readiness sprints, automated regression testing, and reliability statistical benchmarks.
Explore VoxelAssurance →Explore static calculators across the StatLab inference engine suite.