Ask Mallard
Analysis method

Spearman correlation: rank association

4 min read

Spearman’s correlation describes whether higher values of one variable tend to accompany higher or lower values of another.

Fit

When to use it, and when not to

Use it when

  • Each independent person has two ordered measurements.
  • The relationship is monotonic: it tends to move in one direction, even when it curves.

Not when

Before you start

What you need

Decide these first
  1. Paired x and y observationsKeep lists equally long and in the same person order.
  2. The number and pattern of tied valuesAverage tied ranks. Many ties reduce how finely the data distinguish order.
  3. The inferential method and alternative hypothesisDecide whether a large-sample approximation or a justified permutation procedure fits the data.
It rests on these
  1. Pairs from different people are independent.How to check: Do not treat repeated visits as separate independent people.
  2. The two measurements have a meaningful order and both vary.How to check: Check category coding and ensure neither variable is constant.
  3. A single-direction relationship is the target.How to check: Plot the data. A U-shaped relationship can have a near-zero Spearman coefficient.

Plain language

How it works

Replace each variable’s values by their ranks, assigning an average rank to ties. Spearman’s rho is Pearson correlation of those ranks. Moving an extreme value farther out changes nothing if its rank stays the same.

What the sources show

Bishara and Hittner’s simulations compare correlation estimators and tests under nonnormality. Rank methods can help, but do not make inference assumption-free. A monotonic association means a trend in one direction; a curve that reverses direction is a different target.

The method at a glance
Spearman correlation: Matched ordered values. Then Average ranks for tied values. Then Correlation of the ranks.Spearman correlationMatched ordered valuesAverage ranks for tiedvaluesCorrelation of the ranks
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
Setting
8 independent people each supply two ordered measurements.
Question
Do their ranks tend to increase together?
Approach
x values: 1, 2, 3, 4, 5, 6, 7, 8. y values: 2, 1, 4, 3, 6, 5, 8, 9.
Result
Spearman rho = 0.929. The calculator’s approximate two-sided p < 0.001, using 8 pairs and 6 degrees of freedom.
What it means
This is a strong positive rank association in the sample. With so few pairs, use a justified exact or permutation method for final inference.

In practice

Recent studies PubMed search · not vetted

Searching PubMed…

Watch out

Common mistakes

The one to remember

Spearman correlation describes a monotonic relationship, not every curved pattern. Ties and small samples affect inference; Mallard’s p-value is a t approximation.

  • Applying the no-ties shortcut despite tied values.Instead: Use average ranks and correlate them. The shortcut assumes no ties.
  • Assuming a rank method needs no assumptions.Instead: Independence still matters. Approximate p-values can be unreliable with few pairs or many ties.

Inside Mallard

How Mallard uses this

Mallard links this article to its Spearman calculator. The tool averages tied ranks and uses an approximate t-based p-value. Plans do not link directly to this article yet.

No Mallard code example points to this page.
Calculators: Spearman correlation (§2.8).
Atlas node analysis.spearman_correlation, the id a plan cue records.

Work it out

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. Testing the significance of a correlation with nonnormal data: comparison of Pearson, Spearman, transformation, and resampling approaches (opens in a new tab) · Psychol Methods · doi 10.1037/a0028087
  2. Reducing Bias and Error in the Correlation Coefficient Due to Nonnormality (opens in a new tab) · Educ Psychol Meas · doi 10.1177/0013164414557639
Prepared with AI assistance. Source records verified by PMID, title, authors, year and DOI on 2026-11-06. No independent professional approval is claimed. Both primary simulation studies support the distinction between estimating rank association and choosing a valid significance test.
Last source review: 2026-11-06
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.