Skip to main content

Spearman's rank correlation

Spearman's rank correlation measures the monotonic association between two variables by applying the Pearson formula to their ranks. It is robust to outliers, valid for ordinal data, and does not assume a linear relationship.

ByHoang TruongUpdated

FrameworkNon-parametric tests

See it move

Loading infographic...

Ten employees rank their satisfaction with autonomy and with pay from one to ten. Spearman's method replaces each raw score with its rank, then correlates the rank pairs. Plotting ranked autonomy against ranked pay, employees who rank one factor highly tend to rank the other highly too, producing an upward-sloping line and rₛ close to +1.

Where it fits
TopicDescriptive StatisticsAdvancedSubjectData Analysis & StatisticsAdvancedTopicCommon Significance TestsAdvanced

The formula

LaTeX
rs=16i=1ndi2n(n21)r_s = 1 - \frac{6\displaystyle\sum_{i=1}^{n} d_i^2}{n(n^2 - 1)}

Variables

Spearman rank correlation coefficient (dimensionless)
difference between the rank of observation i in variable X and its rank in variable Y (dimensionless)
number of paired observations (dimensionless)

Shortcut formula valid when there are no tied ranks; rₛ ∈ [−1, +1]. For tied ranks, apply the Pearson formula to the ranks directly.

Check yourself

PracticeCORE

A study measures study hours and exam scores for ten students and reports a Spearman rank correlation of r_s = 0.85. Which of the following correctly interprets this result?

Select an answer to check your understanding.