← All resources

WORKED EXAMPLE · MONOTONIC RANK ASSOCIATION

Spearman Correlation Worked Example: Ordinal Severity and a Numeric Biomarker

Follow an ordinal imaging grade and numeric biomarker from paired participant-level data and a jittered scatterplot through tied ranks, Spearman’s correlation, interpretation, and BioTabular setup.

Published by BioTabularLast reviewed: November 2, 2026

This worked example uses synthetic data created for teaching. Imagine 25 independently sampled participants who each receive one ordered imaging-severity grade from 0 through 4 and one biomarker measurement. The scientific question is whether participants with higher severity grades generally have higher biomarker concentrations, without treating a one-grade step as a fixed numeric distance.

Define the paired variables and association target

Observational unit
One independently sampled participant.
Pairing structure
The severity grade and biomarker value on each row belong to the same participant.
First variable
Imaging-severity grade, ordered from 0 to 4.
Second variable
Biomarker concentration in ng/mL.
Target
The direction and strength of the population monotonic rank association.
Starting method
Two-sided Spearman rank correlation with average ranks for ties.

The values within a row form a meaningful pair, while the 25 participant rows are independent. Spearman correlation is symmetric: reversing the axes does not change the coefficient. The analysis does not designate one variable as a causal exposure and the other as an outcome.

Inspect the synthetic participant-level data

ParticipantImaging-severity gradeBiomarker (ng/mL)
P0102.3
P0203.1
P0302.8
P0404.0
P0503.5
P0612.9
P0714.4
P0813.7
P0915.1
P1013.3
P1123.8
P1225.6
P1324.7
P1426.2
P1525.0
P1635.1
P1737.4
P1836.3
P1938.5
P2035.8
P2147.0
P2249.2
P2348.1
P24412.0
P25410.4

Look at the paired observations before calculating a coefficient

Jittered scatterplot of imaging-severity grade against biomarker concentration for 25 participants. Concentrations generally rise with severity, adjacent grades overlap, and the increase becomes larger at the highest grades.
Horizontal jitter separates participants who share an ordinal grade; it does not change their values or the calculation. Gold markers and the dashed connection show grade-specific biomarker medians descriptively. Spearman correlation does not fit that line.

The points move upward overall as severity increases, but they form five vertical grade bands rather than a straight-line cloud. Adjacent grades overlap, and the rise is steeper at the upper end. This is a positive monotonic pattern: higher grades generally accompany higher concentrations, without requiring a constant increase for every one-grade step.

A U-shaped pattern would not be summarized well by Spearman correlation because its direction changes. A scatterplot remains essential even when the chosen calculation uses ranks.

Replace values with ranks and handle ties

Spearman’s coefficient is the Pearson correlation of the two rank variables. The smallest value receives rank 1, the next receives rank 2, and so on. Tied values receive their average rank.

Each imaging grade occurs five times. Grade 0 occupies pooled positions 1 through 5, so every grade-0 participant receives severity rank 3. Grade 1 receives average rank 8; grades 2, 3, and 4 receive average ranks 13, 18, and 23. The biomarker value 5.1 also occurs twice, so both observations receive biomarker rank 13.5.

Imaging gradeParticipantsAverage severity rankMedian biomarker (ng/mL)
0533.1
1583.7
25135.0
35186.3
45239.2

Average ranks preserve tied observations rather than breaking ties arbitrarily. Because ties are present, BioTabular reports an asymptotic approximation for the p-value rather than an exact no-ties permutation calculation.

Calculate Spearman’s rank correlation

Complete pairs
25; omitted 0
Severity grades
0 through 4; five participants per grade
Spearman correlation
ρs = 0.9062308
Direction
Strong positive monotonic association
Two-sided p-value
4.53 × 10−10
Computation
Asymptotic approximation; ties detected

ρs = Pearson correlation of the paired average ranksρs = .9062; p < .001

At α = .05, the result provides evidence against a population Spearman correlation of zero. The coefficient’s positive sign matches the upward ordering in the figure. Its magnitude describes how consistently the participant ranks move together; it does not mean that severity “explains 90.6%” of the biomarker or that a one-grade increase causes a particular concentration change.

BioTabular currently does not display a confidence interval for Spearman’s ρ. A study requiring interval estimation should prespecify and report an appropriate validated interval method rather than reusing Pearson’s Fisher-z interval automatically.

Why this is not simply “Pearson for non-normal data”

The method choice follows the scale and association target. Imaging severity is ordinal: grade 4 is more severe than grade 3, but the numerical distance between grades need not equal the distance between grades 1 and 0. The question also concerns monotonic ordering rather than a straight-line biomarker increase.

Separate normality tests on severity and biomarker would not decide this question. Spearman correlation is useful here because ranks represent the ordered scientific target. It is not a universal repair for outliers, dependence, confounding, or a non-monotonic relationship.

Assumptions and practical checks

  1. Independent participant rows: each participant contributes one pair. Repeated scans, bilateral measurements, families, or sites require a dependence-aware analysis.
  2. Meaningful ordering: higher imaging grades consistently represent greater severity.
  3. Monotonic target: the relationship moves in one overall direction over the observed range. Inspect the plot rather than inferring shape from ρ alone.
  4. Correct pairing: never sort the two columns separately; each biomarker must remain linked to the correct participant’s grade.
  5. Transparent ties: repeated grades are expected and receive average ranks. The inferential calculation must acknowledge ties.
  6. No dominating or erroneous observation: ranks can reduce sensitivity to raw spacing, but they do not make data errors, extreme observations, or separated subgroups irrelevant.

Reproduce the result in BioTabular

  1. Download the synthetic CSV and open the Spearman correlation calculator.
  2. Import the file. Keep Participant_ID as the identifier, mark Imaging_Severity_Grade as ordinal or numeric, and keep Biomarker_ng_mL numeric.
  3. Confirm the variable roles, then select Imaging_Severity_Grade as the first variable and Biomarker_ng_mL as the second.
  4. Confirm Spearman correlation, the two-sided alternative, and α = .05.
  5. Run the analysis. Confirm 25 complete pairs, no omissions, ρs = .906, p < .001, and the message “asymptotic approximation; ties detected.”
  6. Inspect the scatterplot and send it to Plot Studio. Preserve the grade bands and visible points; any horizontal jitter used for presentation must be labelled and must not alter the calculation.

Interpret and report the result

Within the observed grades and biomarker range, participants with higher imaging severity tend to have higher biomarker concentrations. The result concerns the ordering of participant pairs. It does not estimate the biomarker difference between grades, identify a diagnostic threshold, demonstrate agreement between measurements, or show that severity causes biomarker change.

“Among 25 independent participants with complete measurements, imaging-severity grade and biomarker concentration showed a strong positive monotonic association (Spearman ρs = .906, two-sided p < .001). Tied imaging grades were assigned average ranks and an asymptotic p-value was used. The jittered scatterplot showed increasing biomarker concentrations across ordered grades with overlap between adjacent grades.”

A complete study report should also define the grading system, measurement timing, participant selection, missing-pair handling, whether the analysis was prespecified, and any sensitivity analyses for important subgroups or unusual observations.

Common mistakes this example avoids

  • Treating an ordinal grade as if every one-unit step had equal quantitative meaning.
  • Choosing Spearman only because a separate normality test was significant.
  • Calculating a coefficient without inspecting the paired observations.
  • Breaking participant pairing by sorting columns independently.
  • Calling a monotonic coefficient a fitted curve or a per-grade effect.
  • Interpreting a strong correlation as causation, agreement, discrimination, or clinical usefulness.
  • Treating repeated participant measurements as independent pairs.

Limits of this worked example

The dataset is small, complete, synthetic, and intentionally monotonic. It has balanced counts at each grade, no covariates, repeated measurements, clusters, missing pairs, verification bias, or prespecified clinical threshold. Real studies may need ordinal regression, nonlinear regression, partial association, repeated-measures methods, multilevel models, measurement-error analysis, diagnostic-accuracy analysis, or multiplicity control when many correlations are screened.

Related resources

Read Pearson vs. Spearman Correlation for the broader method choice. Compare this monotonic rank target with the Pearson correlation worked example, which summarizes an approximately linear association between two numeric variables. Return to Which Statistical Test Should I Use? for other data structures.

References and further reading

BioTabular’s editorial approach and scope explain how these educational resources are prepared and what they do not replace.