Correlação Spearman (ρ)
Calcula correlação por postos (Spearman) — robusta a outliers e não-lineares monotônicas.
ρ
—
Spearman's rank correlation (ρ)
Spearman's ρ (rho) is just Pearson's r run on the ranks of the data rather than the values themselves, which turns it into a non-parametric measure of monotonic association. When nothing is tied, it collapses to the tidy form ρ = 1 − 6·Σdᵢ² / (n·(n²−1)), with dᵢ being the gap between the ranks of xᵢ and yᵢ. It ranges over [−1, 1]. Try X=[1,2,3,4,5], Y=[2,4,5,4,6] and you get ρ ≈ 0.82. Working off ranks is what makes ρ robust to outliers, and it catches any monotonic trend at all, whether linear, exponential or logarithmic. Once ties show up, the exact version is simply Pearson computed over the averaged ranks.
Applications
Think of ordinal data: Likert scales in surveys, scores from sports judging panels, economic rankings like GDP per capita against HDI, medical staging, customer satisfaction studies, bibliometric rankings. Wherever the order of things matters more than the absolute distances between them, ρ is at home.
FAQ
Spearman vs Pearson? Go with Spearman for ordinal data, for monotonic relationships that aren't linear, or when outliers are in the mix. Pearson fits linear relations between continuous variables that are roughly normal.
What about ties? When values tie, give them their average rank and run the full Pearson formula on those ranks. The shortcut Σd² formula introduces a small bias in that case.
And Kendall's τ? That's another rank-based correlation. τ is easier to interpret, since it reads as a probability of concordance, but it gets costly to compute as n grows. In day-to-day work ρ is the one you see more often.
Related Tools
Rent Adjustment Calculator
Compute annual rent adjustment by IGP-M or IPCA accumulated in the last 12 months (manually configurable).
Pregnancy Calculator
Compute estimated due date (EDD), gestational age and trimester from the last menstrual period (LMP).
Fertile Period Calculator
Compute fertile window and ovulation day from the first day of the last cycle and the average cycle length.