Biostatistics Study NotesFrom concepts and derivations to interpretation

CHAPTER 07 · TOPIC 04

Spearman Rank Correlation

Measure monotonic association with ranks and understand ties, inference methods, and differences from Pearson correlation.

On this page
  1. When to Consider Spearman Correlation
  2. Step 1: Convert Original Values to Ranks
  3. Step 2: Find the Pearson correlation of ranks
  4. Simplified formula when there are no ties
  5. Interpreting direction and size
  6. Inference for the Population Rank Correlation
  7. Can Fisher Z be used directly on Spearman rₛ?

Spearman's rank correlation coefficient rₛ evaluates the monotonic relationship between two variables by converting the raw values ​​into ranks and then calculating the Pearson correlation. Even if it is not a straight line, you can capture relationships that increase or decrease in one direction.

When to Consider Spearman Correlation#

  • Handling ordinal scale data
  • The relationship is monotonic but not linear.
  • Pearson r is strongly influenced by outliers
  • The distribution is strongly skewed, and rank-based summarization is appropriate.
  • The ordering is more meaningful than the numerical spacing between values

Step 1: Convert Original Values to Ranks#

Rank X and Y separately from 1 to n. Assign the average rank to tied values. Rank transformation discards interval information, leaving only the order.

Step 2: Find the Pearson correlation of ranks#

rs=[R(Xi)RX][R(Yi)RY][R(Xi)RX]2[R(Yi)RY]2r_s=\frac{\sum[R(X_i)-\overline{R_X}][R(Y_i)-\overline{R_Y}]}{\sqrt{\sum[R(X_i)-\overline{R_X}]^2}\sqrt{\sum[R(Y_i)-\overline{R_Y}]^2}}

If rₛ=1, the rankings are perfectly matched, -1 is completely reversed, and around 0 indicates that the monotonic rank association is weak.

Simplified formula when there are no ties#

Difference in rankdi=R(Xi)R(Yi)d_i=R(X_i)-R(Y_i)
simplified formulars=16di2n(n21)r_s=1-\frac{6\sum d_i^2}{n(n^2-1)}

Interpreting direction and size#

The sign represents the direction of the monotonic relationship, and the absolute value represents the consistency of the ranks. Fixed boundaries of strength and weakness depend on field and measurement reliability, and are therefore coupled with scatter plots, confidence intervals, and research context.

Inference for the Population Rank Correlation#

H0:ρs=0H1:ρs0H_0:\rho_s=0\qquad H_1:\rho_s\ne0

For small samples, you can use exact tests based on rank permutation distributions, and for tied ranks and large samples, you can use appropriate approximation, permutation, and bootstrap. Decide in advance whether it will be on one side or both sides.

Can Fisher Z be used directly on Spearman rₛ?#

It is generally not exact to use the variance 1/(n−3) for Pearson r directly for Spearman rₛ. Since the sampling distribution and tie effects are different, we use Spearman's approximation, permutation method, and bootstrap confidence intervals.

ItemPearson rSpearman rₛ
Data usedRaw valuesRanks
RelationshipLinearMonotonic
OutliersMore sensitiveUsually less sensitive
Inferencet test or Fisher’s zExact, permutation, asymptotic, or bootstrap methods