Sb8–Sb10 - Spearman's rank and choosing a test
Calculate Spearman's coefficient from untied ranks, test for population association and choose between the Pearson and Spearman procedures. The shape of the relationship matters as much as the availability of a calculator button.
Ranks and Spearman's coefficient
Can two data sets have exactly the same rank correlation even though their numerical gaps are completely different?
Yes. Ranking remembers order and forgets spacing. That is useful for studying a monotonic relationship, but it deliberately discards some information.
You already know
Pearson's coefficient describes linear correlation. A monotonic relationship tends to increase throughout or decrease throughout; a U-shaped relationship does neither over its full range.
Rank each variable separately, but keep the two ranks for each observation paired. Use the same convention for both variables, such as rank for the smallest value. The calculations here use distinct values: tied ranks are outside this topic's assessed scope.
Spearman's rank correlation coefficient
Spearman's coefficient is the pmcc of the two columns of ranks. It measures the direction and strength of monotonic association. It lies between and , with the extremes representing completely agreeing or completely reversed rank orders.
Your calculator's correlation calculation on the ranked columns gives . Entering the raw measurements instead gives Pearson's coefficient for the raw data, a different calculation.
Spearman's coefficient without ties
For pairs of untied ranks, let be the difference between the two ranks for observation . Then
This is equivalent to calculating the pmcc of the ranks. Rank both variables consistently and preserve the pairs.
In the formula booklet.
The short-cut formula is convenient for summary statistics; a rank table makes detailed reasoning clear.
Worked example 1: ranking raw measurements
Question. Six walks have distances and corresponding durations minutes. Find Spearman's coefficient.
Plan. Rank each column from smallest to largest, then calculate the sum of squared paired rank differences.
| Walk | Distance rank | Duration rank | ||
|---|---|---|---|---|
Why this step? The final two walks reverse their duration order. Their ranks must remain attached to their own distances.
Answer. , showing strong positive monotonic association in this sample.
Check. The pmcc of rank columns and is the same value.
Change only the second variable's orientation: record minutes remaining from a -minute allowance instead of minutes used.
Worked example 2: reversing one ordering
Question. For the same walks, the remaining times are minutes. Find Spearman's coefficient between distance and remaining time.
Plan. Keep distance ranks fixed, reverse the duration ordering through the new variable, and calculate again.
| Walk | Distance rank | Remaining-time rank | |
|---|---|---|---|
Why this step? Longer durations leave less remaining time, so reversing just one ordering reverses the coefficient's sign.
Answer. , a strong negative monotonic association in the sample.
Check. Its magnitude matches Example 1. Reversing both rank conventions would preserve a coefficient; reversing only one changes its sign.
To see the information loss in the opening question, compare with either or . Both rank columns are , so both give , despite their very different numerical gaps.
Watch out
Wrong: subtract raw measurements to calculate , or feed raw measurements into the calculator and call its “Spearman's”. Right: calculate on the paired ranks.
Use a new ordering, still with no ties.
Testing for population association
Spearman's test does not require a bivariate Normal population model. It still needs suitable paired observations and a defensible sampling or experimental design; removing a distributional assumption does not remove the need for sound data.
Spearman hypotheses
State : no association between the variables in the population. The alternative specifies positive association, negative association or any association in that population. Use “association” for this test, distinguishing it from Pearson's test of linear correlation.
A monotonic pattern is the relevant alternative. For an observational study, a random sample of independent pairs supports inference to its population. Spearman can also be used for an appropriate association question with controlled input levels; it does not require both variables to have a bivariate Normal distribution.
Use the booklet's Spearman table, with the row for the number of pairs, not the Pearson table. For example:
| , Spearman table | One-sided | Two-sided |
|---|---|---|
| Critical magnitude |
Reject in the positive or negative tail specified by the alternative, or use for a two-sided test. Equality at the critical boundary belongs to the critical region; compare with the precision used by the printed table. Do not interpolate unlisted or blank entries. The critical tables are in the formula booklet.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account