Spearman Rank Correlation (rho)
The nonparametric companion to Pearson r that the correlation/regression family was missing.
Example
You enter
- X series (values separated by commas, spaces, or new lines) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Y series (same count as X) 3, 1, 4, 1, 5, 9, 2, 6, 5, 8
You get
- Spearman rho 0.62806
- P value 0.05184
Details, formula, and sources
Spearman's rho is Pearson's r computed on the RANKS of the two series (ties take the average rank), so it measures any monotonic relationship - not just a straight line - and shrugs off outliers and non-normal data. The right tool for ordinal ratings or a curved but steadily-rising trend. Paste an X series and a Y series (commas, spaces, or new lines); rho runs -1 (perfectly decreasing) to +1 (perfectly increasing). The two-sided p-value tests rho = 0 with t = rho sqrt((n-2)/(1-rho^2)) on n-2 df, the same approximation scipy.stats.spearmanr uses (approximate for very small n). Verified against scipy.stats.spearmanr. A statistics aid; the study design governs.
Spearman rho = Pearson r on the ranks of x and y (ties take the average rank). Two-sided test for rho = 0: t = rho * sqrt(n - 2) / sqrt(1 - rho^2) on n - 2 df; p = 2 * (1 - tcdf(|t|, n - 2)).
OpenIntro Statistics 4th ed. (nonparametric association / rank correlation) by name; the Student-t CDF via the regularized incomplete beta function per Numerical Recipes in C 2nd ed. §6.4. Verified against scipy.stats.spearmanr.
OpenIntro Statistics free at openintro.org; Numerical Recipes chapters free at numerical.recipes.
Estimate only. Readability formulas and similar metrics are derived from a representative population and have known edge-case noise. The classroom teacher governs final text selection, grade placement, and assessment decisions.
Field names used by the API: x_values, y_values, rho, p_value
- Rank transform rho = Pearson r on average-tied ranks of both seriesOpenIntro Statistics (rank correlation)
- Two-sided p-value t = rho sqrt((n-2)/(1-rho^2)) on n-2 df; p = 2(1 - tcdf(|t|, n-2))scipy.stats.spearmanr t-approximation
- Scope monotonic (not linear) association; small-n p-value is approximate; perfect fit flagged, not left non-finitescope of this tile