Spearman Rank Correlation (ρ)

Check relationships where one variable keeps rising (or falling) as the other increases, even if not in a straight line, with Spearman's rank correlation ρ. Because it uses ranks instead of values, it is less sensitive to outliers and skewed distributions.

1Data Table

Paste a table copied from Excel into a cell (Ctrl+V). Click a column header (A, B…) before pasting to use the first line as column names. Double-click a header to rename it, right-click to insert/delete rows and columns, and formulas such as =A1*2 work too.

2Spearman Rank Correlation Options

How to calculate Spearman's rank correlation

  1. Copy the two columns together with the header (ranks, scores or measurements all work).
  2. Select the two columns whose ranks to compare as Variable X and Variable Y.
  3. Press Analyze and check ρ, the p-value and the interpretation in the statistics panel.

Worked example with sample data

The sample data are 25 pairs of heating time (2-50 min, every 2 min) and hardness (HRC). Hardness rises quickly at first, then from about 22 minutes only fluctuates between 54.6 and 58.7 without rising further.

Spearman rank correlation of heating time and hardness (scatter plot, trendline, ρ, p-value)
Spearman rank correlation of heating time and hardness (scatter plot, trendline, ρ, p-value)

Spearman's ρ is 0.8419 (p=1.326e-07), a 'very strong positive monotonic relationship'. The Pearson r of the same data is 0.8069, smaller than ρ, because the relationship is not a straight line but a curve that bends and levels off.

The linear trendline in the statistics panel (R² = 0.6510) also fails to follow the points at the start and the end. For relationships that 'keep rising, but not in a straight line', the rank-based ρ describes the strength better.

The fact that hardness hardly rises beyond 25 minutes of heating does not show in the coefficient but is clear on the scatter plot. Look at the numbers and the chart together.

How it is calculated

X and Y are each converted to ranks from the smallest value (ties get the average rank), and ρ is the Pearson correlation of those ranks. The p-value is a two-sided test using the t distribution with n-2 degrees of freedom, the same as SciPy's spearmanr.

When does it differ from Pearson?

When the relationship is curved but keeps going in one direction, ρ comes out larger than r. A typical case is the heating time and hardness in the example, which rise quickly at first and then level off. ρ is also less affected when a few extreme values inflate r.

How to read Spearman's ρ

  • The strength scale is the same as for Pearson (|ρ| cut-offs 0.1, 0.3, 0.5, 0.7). A positive sign means the variables increase together; negative means opposite directions.
  • A p-value below 0.05 means the monotonic relationship is statistically significant.
  • Even a high ρ cannot capture relationships that change direction, like a U shape. Check the shape of the plot too.

Frequently asked questions

What happens with ties (equal values)?

Equal values get the average rank. For example, if 2nd and 3rd place are equal, both get rank 2.5.

Can I use it for ordinal data (1-5 satisfaction scores)?

Yes. It only uses ranks, so it suits ordinal data such as Likert scales better than Pearson.

How is it different from Kendall?

Both are rank correlations. Kendall's τ is defined by the share of concordant pairs, comes out smaller than ρ and is more stable for small samples.

Other chart tools