CalculatorsToolsGuides 日本語
BenchFig › Guides › Pearson vs Spearman correlation: differences and when to use each
Statistics

Pearson vs Spearman correlation: differences and when to use each

A correlation coefficient measures how closely two quantities move together. The two in everyday use are Pearson’s r, for linear relationships, and Spearman’s ρ, for monotonic relationships based on ranks. On the same data they can differ a lot, and the choice can change the conclusion. This guide shows the difference with numbers and plots, then covers confidence intervals, P values at small n, and reporting.

Updated: BenchFig日本語
Calculate a correlation on your own dataPaste X and Y: r, ρ, P values, 95% CI of r, a scatter plot and a results sentence.Calculate →

The difference in one line

Key points
  • Pearson’s r uses the values themselves and measures the strength of a linear relationship; it is sensitive to outliers
  • Spearman’s ρ replaces values by ranks and then computes Pearson’s r; it measures a monotonic relationship (one goes up as the other goes up) and is robust to outliers and curvature
  • Both run from −1 to 1: 0 means no relationship, ±1 a perfect one (a straight line for Pearson, perfectly matching ranks for Spearman)
  • Correlation does not mean that one causes the other

Pearson’s r is the sum of products of deviations divided by the square root of the product of the sums of squared deviations:

r = Σ(x − x̄)(y − ȳ)√(Σ(x − x̄)² · Σ(y − ȳ)²)Spearman’s ρ uses the same formula after converting x and y to ranks (tied values get their average rank).

In the app’s sample (mRNA vs protein, n = 14, made up), r = 0.91 (95% CI 0.74 to 0.97) and ρ = 0.96: both show a strong positive correlation. With clean data like this the two barely differ. They part ways in cases like these:

Outliers and curves change the picture

02468100246810YX
Pearson r = 0.87, Spearman ρ = 0.24
40506070809010002468Signal (%)Time (h)
Pearson r = 0.86, Spearman ρ = 1.00
Left: nine unrelated points plus one far-away point (made up). That single point lifts Pearson’s r to 0.87, while rank-based Spearman’s ρ changes much less and stays non-significant. Right: a saturating curve (made up). The ranks agree perfectly (ρ = 1), but r is below 1 because the points are not on a straight line.
DatanPearson rPSpearman ρP
Sample (mRNA vs protein)140.9125.5 × 10−60.9605.1 × 10−8
Outlier example (left)100.8749.3 × 10−40.2360.51 (exact)
Same, outlier removed9−0.0480.90−0.0500.91 (exact)
Saturating curve (right)80.8580.00641.0005.0 × 10−5 (exact)

On the left, nine unrelated points (r = −0.05) become a “significant strong correlation”, r = 0.87, P = 9.3 × 10−4, by adding one point. Pearson’s r multiplies distances from the mean, so a single distant point can dominate. For Spearman that point only carries the information “largest x and largest y”, one rank’s worth, so ρ = 0.24 (P = 0.51): it changes much less and is not significant.

On the right it is the other way round: the relationship is perfect, yet r is not 1. Responses that saturate with dose or time, or that grow exponentially, suit Spearman, or Pearson after a log transform. In both cases, look at the scatter plot first.

When to use which

Points scatter roughly around a straight line, with no extreme points
Pearson’s r with its 95% CI, often reported together with a fitted line (regression)
Curved but monotonic, outliers present, or ordinal scores (e.g. 0–3 ratings)
Spearman’s ρ; if a log transform makes it linear, Pearson on the log scale is also an option
U-shaped or peaked (not monotonic)
Both coefficients come out near 0 and miss the relationship. Show the scatter plot and consider a model that fits the shape

95% confidence interval of r (Fisher’s z)

Because r is bounded by −1 and 1 its distribution is skewed, so the interval is built on Fisher’s z = atanh(r) scale and transformed back:

tanh( atanh(r) ± 1.96√(n − 3) )Not defined for n ≤ 3 (BenchFig reports −1 to 1).
The same r = 0.5 has a very wide interval when n is small.
n95% CI for r = 0.5P (r = 0)
5−0.68 to 0.960.39
10−0.19 to 0.860.14
200.07 to 0.770.025
500.26 to 0.682.2 × 10−4
1000.34 to 0.631.2 × 10−7

With n = 10 and r = 0.5, the 95% CI spans everything from a weak negative to a fairly strong positive correlation. Reporting the interval, not just r, tells readers how much the data can support.

Spearman at small n: exact P

For large n, Spearman’s P uses the same t approximation as Pearson’s. For small n, the exact P from counting all n! orderings of the ranks is more reliable. BenchFig reports the exact P for n ≤ 10 without ties.

nOrderings n!Smallest two-sided P (ρ = ±1)
360.33
4240.083
51200.017
67200.0028
75,0404.0 × 10−4
840,3205.0 × 10−5
103,628,8005.5 × 10−7

With n = 4, even perfectly matching ranks give P = 2/24 = 0.083, which cannot reach 0.05; with n = 3 it is 0.33. A correlation on 3 or 4 points can hardly support any test.

Try correlations on sample dataOpen a sample on the Correlation & regression screen and edit the values in the table: r, ρ and the 95% CI update immediately. Change one value to something far off to see what an outlier does.
Open for free →

Correlation vs causation, and other pitfalls

Correlation coefficient and P value in Excel

With x in A2:A15 and y in B2:B15 (Excel 2010 or later). For the n = 14 sample, these values match SciPy’s pearsonr and spearmanr.

Putting ρ into the same t and T.DIST.2T formulas gives the t-approximation P for Spearman (for n above about 10). Exact small-n P values are not readily available in Excel.
QuantityExcel formulaSample value
Pearson’s r=CORREL(A2:A15,B2:B15) (in F2; =PEARSON(…) is the same)0.9121
n=COUNT(A2:A15) (in F3)14
t=F2*SQRT((F3-2)/(1-F2^2)) (F2 = r)7.709
Two-sided P=T.DIST.2T(ABS(F4),F3-2) (F4 = t)5.5 × 10−6
Spearman’s ρFill =RANK.AVG(A2,$A$2:$A$15,1) in C and =RANK.AVG(B2,$B$2:$B$15,1) in D, then =CORREL(C2:C15,D2:D15)0.9604

How to write it in a paper

Methods: “Correlation was assessed by Pearson’s correlation coefficient r, with 95% confidence intervals from Fisher’s z transformation.” For Spearman: “Correlation was assessed by Spearman’s rank correlation coefficient ρ (exact P for n ≤ 10 without ties, otherwise the t-distribution approximation).”

Results: “mRNA and protein levels were strongly positively correlated (Pearson r = 0.91, 95% CI 0.74–0.97, n = 14, P < 0.001).” Always give n and show the scatter plot. General formats are in how to report statistics.

FAQ

Can I report both Pearson and Spearman?

Yes, but decide in advance which is the main result, and do not compute both and report only the significant one. Show a scatter plot either way so readers can see the shape of the relationship.

Is r = 0.3 a “weak” correlation?

Cohen’s rough benchmarks of 0.1, 0.3 and 0.5 for small, medium and large exist, but what matters depends on the field and the measurement. Judge practical usefulness from the width of the 95% CI and the scatter plot rather than the number alone.

Can I use several measurements from the same animal as separate points?

They are not independent, so the P value comes out too small. Use one mean per animal, compute a correlation within each animal and combine them, or use repeated-measures correlation or a mixed model.

Is the Spearman P exact when there are many ties?

With ties, BenchFig reports the t-distribution approximation (as SciPy’s spearmanr does). With many ties and small n the approximation can be rough; say so in the Methods, or check with software that runs a permutation test.

Compute a correlation on sample dataOpen a sample on the Correlation & regression screen to get Pearson’s r with its 95% CI, Spearman’s ρ (exact P for n ≤ 10 without ties), the regression line and a results sentence.
Open for free →
Your own data, all the way to the final figure.Loading your files, saving, and journal-ready export (PDF, TIFF, PNG, SVG) are in BenchFig Pro for Windows, updated based on researchers’ requests: ¥3,980/year (2 PCs), with lab and perpetual licenses too.
About the app →

Related guides

Product and journal names are trademarks or registered trademarks of their respective owners.