STA 113 2.0 Descriptive Statistics

Spearman’s rank correlation

Dr. Thiyanga S. Talagala
Department of Statistics, Faculty of Applied Sciences
University of Sri Jayewardenepura, Sri Lanka

Spearman’s rank correlation

  • Pearson’s correlation coefficient: at least interval level of measurement for the data

  • Spearman’s rank correlation: at least ordinal-level or ranked data

\(r = 1 - \frac{6\sum_{i=1}^nd^2}{n(n^2-1)}\)

where

\(n = \text{number of pairs being correlated.}\)

\(d = \text{the difference in the ranks of each pair}\)

Example

Compute Spearman’s rank correlation for the following variables to determine the degree of association between the two variables.

x y
10 3.0
10 3.0
4 1.0
20 2.0
30 3.0
40 4.5
40 5.0
30 6.0
20 7.0
10 1.0

Important

  • Pearson’s correlation determines the strength and direction of the linear relationship between two variables.

  • Spearman’s correlation determines the strength and direction of the monotonic relationship.

  • The Spearman’s rank correlation formula is derived from the Pearson product moment formula and utilises the ranks of the \(n\) pairs instead of the raw data.

In-class demonstration

  • Monotonic vs Non-monotonic

  • Monotonic & Non-linear vs Monotonic & Linear