Answer
Pearson or Spearman correlation: which should you use?
The short answer
Pearson's r measures how well a straight line fits; Spearman's rho is Pearson's r on the ranks, so it measures any consistently rising or falling trend. Use Pearson for roughly linear interval-scale data without extreme points, and Spearman for ordinal data, curved monotonic trends, or outliers. In one simulation a curved trend gave r = .68 but rho = .96, and one extreme point lifted r from .12 to .53.
The short answer
The two coefficients answer different questions. **Pearson's r asks how closely the points follow a straight line. Spearman's ρ** (rho) replaces each value with its rank and then computes Pearson's r on those ranks, so it asks whether higher values of one variable go with higher (or lower) values of the other, whatever the shape of the trend. Both run from −1 to 1, and both are 0 when there is no association of the kind they measure.
- Pick Pearson when both variables are measured on an interval or ratio scale, a scatterplot looks roughly linear, and no single point sits far from the rest. It uses the actual distances between values, so it is the more informative choice when its conditions hold.
- Pick Spearman when at least one variable is ordinal (ranks, ratings), when the trend is monotonic but bends, or when a few extreme points would otherwise drive the result.
- Decide before you look at the p-values, ideally from the measurement scale and a scatterplot, and report the one you chose. Running both and keeping the more significant one inflates the false positive rate.
See it in R and Python
The code simulates 40 observations in each of three scenarios: (A) a straight-line relationship with normal noise, (B) a relationship that always increases but curves sharply upward, and (C) two unrelated variables plus one extreme point. It computes both coefficients for each, checks that Spearman's ρ equals Pearson's r on the ranks, and runs both tests on scenario B.
R
set.seed(8071)
n <- 40
# Scenario A: a straight-line relationship with normal noise
xa <- runif(n, 0, 4)
ya <- 2 + 0.8 * xa + rnorm(n)
# Scenario B: monotonic but strongly curved (exponential growth)
xb <- runif(n, 0, 4)
yb <- exp(1.2 * xb) * exp(rnorm(n, 0, 0.3))
# Scenario C: no relationship, plus one extreme point
xc <- c(rnorm(n - 1), 6)
yc <- c(rnorm(n - 1), 6)
both <- function(x, y) c(pearson = cor(x, y),
spearman = cor(x, y, method = "spearman"))
round(rbind(A_linear = both(xa, ya),
B_curved = both(xb, yb),
C_outlier = both(xc, yc),
C_without = both(xc[-n], yc[-n])), 3)
# Spearman's rho is Pearson's r computed on the ranks
all.equal(cor(rank(xb), rank(yb)), cor(xb, yb, method = "spearman"))
# Tests for scenario B, as they would be reported
cor.test(xb, yb) # Pearson, with 95% CI
cor.test(xb, yb, method = "spearman", exact = FALSE)Python
import numpy as np
from scipy import stats
rng = np.random.default_rng(8071)
n = 40
# Scenario A: a straight-line relationship with normal noise
xa = rng.uniform(0, 4, n)
ya = 2 + 0.8 * xa + rng.normal(size=n)
# Scenario B: monotonic but strongly curved (exponential growth)
xb = rng.uniform(0, 4, n)
yb = np.exp(1.2 * xb) * np.exp(rng.normal(0, 0.3, n))
# Scenario C: no relationship, plus one extreme point
xc = np.r_[rng.normal(size=n - 1), 6]
yc = np.r_[rng.normal(size=n - 1), 6]
def both(x, y):
return (round(stats.pearsonr(x, y)[0], 3),
round(stats.spearmanr(x, y)[0], 3))
for name, x, y in [("A_linear", xa, ya), ("B_curved", xb, yb),
("C_outlier", xc, yc), ("C_without", xc[:-1], yc[:-1])]:
print(name, "pearson, spearman:", both(x, y))
# Spearman's rho is Pearson's r computed on the ranks
print(np.isclose(stats.pearsonr(stats.rankdata(xb), stats.rankdata(yb))[0],
stats.spearmanr(xb, yb)[0]))
# Tests for scenario B: Pearson with a Fisher-z 95% CI (as in R's cor.test)
r, p = stats.pearsonr(xb, yb)
z, se = np.arctanh(r), 1 / np.sqrt(n - 3)
lo, hi = np.tanh(z + np.array([-1, 1]) * stats.norm.ppf(0.975) * se)
print("pearson r", round(r, 3), "p", p, "95% CI", round(lo, 3), round(hi, 3))
rho, p_s = stats.spearmanr(xb, yb)
print("spearman rho", round(rho, 3), "p", p_s) pearson spearman
A_linear 0.791 0.781
B_curved 0.683 0.959
C_outlier 0.526 0.247
C_without 0.121 0.187
[1] TRUE
Pearson's product-moment correlation
data: xb and yb
t = 5.7599, df = 38, p-value = 1.215e-06
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.4714934 0.8198701
sample estimates:
cor
0.6827274
Spearman's rank correlation rho
data: xb and yb
S = 438, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.9589118
The figures come from one seeded run of the R code. Python's random numbers differ from R's, so its figures differ slightly (for example r = .865 and ρ = .971 for the curved scenario, and the extreme point lifts r from .147 to .513 but ρ only from .097 to .163), but they show the same pattern.
What the numbers show
- Straight line, normal noise (A): the two agree closely (r = .791, ρ = .781). When Pearson's conditions hold, switching to Spearman changes little.
- Curved but always increasing (B): Spearman's ρ = .959 says the ordering is almost perfectly consistent, while Pearson's r = .683 says a straight line fits only moderately well. Both statements are true; they describe different features. If your question is "does y go up whenever x goes up?", Spearman answers it directly.
- One extreme point (C): with 39 unrelated points, r = .121 and ρ = .187. Adding one point at (6, 6) raised r to .526 but ρ only to .247. A rank can be at most n, so one value far from the rest has limited pull on Spearman, while it can dominate Pearson.
- The rank identity holds exactly: Pearson's r on the ranks equals Spearman's ρ (
TRUE). Tied values get the average of the ranks they span.
Choosing in practice
Start with a scatterplot. It shows at once whether the trend is straight, curved, or driven by a few points, which is what the choice really depends on. A coefficient alone cannot tell these apart (see what happens when x and y are sorted separately before fitting for another reminder that the number needs the picture).
Ordinal variables and questionnaire scores. A single Likert item (1 to 5) is ordinal, so Spearman is the natural choice. A total or mean across many items takes many values and is often treated as interval-scale, in which case Pearson is defensible if the scatterplot looks linear and neither score is badly skewed or piled up at a floor or ceiling. When in doubt, Spearman is the safer choice and loses little when the data would have suited Pearson.
Testing and intervals. The usual Pearson test and its Fisher-z confidence interval assume the data are roughly bivariate normal; with skewed data or outliers they can mislead even when r itself is a fair summary. Spearman's test needs no distributional assumption beyond independent pairs. A transformation (for example a log, as in scenario B) can sometimes make a curved relationship linear, after which Pearson on the transformed values is a good option (see when to log-transform data).
Neither measures non-monotonic patterns. A U-shaped relationship can give both coefficients near 0. Kendall's τ is another rank-based option that copes well with many ties. Our test chooser and the DASS blog cover choosing between tests in more detail.
How to report a Spearman correlation in APA style (7th edition)
Give the coefficient with its degrees of freedom (n − 2) in parentheses, drop the leading zero (a correlation cannot exceed 1), and give an exact p-value unless it is below .001. Say in the method section which coefficient you used and why. Using scenario B from the example above:
"Because the relationship was monotonic but clearly nonlinear, we used Spearman's rank correlation. Scores were strongly positively correlated, rₛ(38) = .96, p < .001."
If you report Pearson's r instead, add its confidence interval: "r(38) = .68, 95% CI [.47, .82], p < .001." In a correlation table, state in a note which coefficient the table shows.
Related tools and guides
- Correlation power and sample size calculator
- APA 7 formatter for correlations
- APA 7 formatter for nonparametric tests
- Sorting x and y separately before regression
- When should you log-transform data?
- Effect size r for a t test
- Which statistical test should I use?
- Spearman's rank correlation coefficient (Wikipedia)
More answered questions
- How do you compare medians when the groups differ in shape and spread?
- Kolmogorov-Smirnov, t test or Mann-Whitney: which detects a change from a baseline?
- Regression to the mean vs the gambler's fallacy: what is the difference?
Working with your own data?
General answers only go so far. Send us your situation and we'll reply by email within two business days.
Ask your questionWritten by AskStats with AI assistance. This is general information, not advice for your specific data or study. When the results matter, check your approach with a qualified statistician.