3.4.1, 3.4.2.4 - Spearman's rank and significance

3.4.1, 3.4.2.4 - Spearman's rank and significance

Spearman's rank describes the strength and direction of a monotonic association between paired variables. Learn to calculate it, handle tied values correctly and distinguish a descriptive coefficient from a justified significance test. The complete original training examples concern geographical gradients, not real field observations.

Association and inference

A scatter graph reveals a paired relationship; a coefficient summarises it, while an inferential test asks how compatible the observed relationship is with a stated null hypothesis under suitable assumptions.

Spearman's rank

Spearman's rank correlation, rsr_s, is the correlation of the ranks of paired observations. It measures monotonic association: one variable tends consistently to increase or decrease as the other increases, without requiring a straight-line relationship.

rsr_s lies from −1 to +1. +1 means identical rank order; −1 means completely reversed order. A value near zero indicates little monotonic association, not necessarily no relationship: a U-shaped pattern can have weak rank correlation despite a clear curved relationship. Inspect the graph and data before choosing the statistic.

The paired unit must be clear. Distance and water temperature from each of six distinct sites form six pairs; mixing one site's distance with another's temperature destroys the relationship. Ranked ordinal or numerical data can be suitable. The test assumes independent paired units; readings repeated at one site or strongly related neighbouring units may not supply independent evidence. Selection and measurement affect generalisation even when calculation is correct.

Descriptive rsr_s summarises these pairs. Statistical inference compares it with what might occur under a null model, enabling a limited statement about evidence against no association. Neither a strong coefficient nor a small p-value establishes a cause: altitude, shade or time could confound an apparent geographical gradient. Relational enquiry therefore combines a clear question, paired measurements, graph inspection, calculation and contextual judgement.

Ranking and calculation without ties

Rank both variables in the same direction, keep each site's pair on the same row, and calculate the rank difference before applying the no-tie shortcut.

No tied ranks

rs=1−6∑d2n(n2−1)r_s=1-\frac{6\sum d^2}{n(n^2-1)}

dd is the difference between the two ranks for each pair; nn is the number of pairs. This shortcut is exact when neither variable has tied values.

In the original illustration, ascending distance and temperature ranks are:

SiteDistance rankTemperature rankddd2d^2
A1100
B23−11
C3211
D4400
E5500
F6600

∑d2=2\sum d^2=2, so rs=1−6(2)/[6(62−1)]=1−12/210=0.942857…r_s=1-6(2)/[6(6^2-1)]=1-12/210=0.942857\ldots, or +0.943 to three decimal places. The strong positive rank association is imperfect because B and C swap order. Reversing the ranking direction for both variables leaves the answer unchanged; reversing just one changes its sign and misrepresents the original association.

Check every pair, nn, the squared differences and the final interval −1 to +1. A negative difference still produces a positive squared difference. Keep unrounded working until the end. If both sets of raw values are ranked smallest =1, an increase in one with a decrease in the other should give a negative coefficient, providing a useful sign check.

Testing significance in context

A significance decision requires a stated hypothesis, level and appropriate reference distribution, rather than calling every non-zero coefficient significant.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account