Key takeaways
- A correlation coefficient ranges from −1 to +1: the sign gives the direction, the absolute value gives the strength.
- Pearson’s r measures linear relationships between two continuous variables; Spearman’s rho measures monotonic relationships using ranks.
- r² (the coefficient of determination) is the proportion of variance the two variables share.
- Correlation does not establish causation, and a non-significant r does not prove there is no relationship.
- Report r with degrees of freedom (n − 2), the p value and ideally a 95% confidence interval: r(48) = .42, p = .002.
What is a correlation coefficient?
A correlation coefficient is a number between −1 and +1 that summarises the strength and direction of the relationship between two variables. A positive value means both tend to rise together, a negative value means one tends to fall as the other rises, and a value near zero means there is little or no linear (or, for Spearman, monotonic) relationship.
The most widely used is the Pearson product-moment correlation coefficient, written r for a sample and ρ (rho) for a population. Spearman’s rank correlation, also written ρ or rₛ, is its rank-based counterpart.
Pearson correlation formula
Pearson’s r compares how much the two variables vary together with how much each varies on its own:
r = Σ[(x − x̄)(y − ȳ)] / √[ Σ(x − x̄)² · Σ(y − ȳ)² ]
The numerator is the sum of cross-products: it is positive when above-average x values pair with above-average y values. The denominator rescales it so the result always falls between −1 and +1, whatever the units of measurement. Equivalently, r is the covariance of x and y divided by the product of their standard deviations.
How to compute Pearson’s r: a worked example
Five students report weekly hours of revision (x) and their exam score out of 100 (y).
| x | y | x − x̄ | y − ȳ | (x − x̄)(y − ȳ) | (x − x̄)² | (y − ȳ)² |
|---|---|---|---|---|---|---|
| 2 | 55 | −3 | −10 | 30 | 9 | 100 |
| 4 | 62 | −1 | −3 | 3 | 1 | 9 |
| 5 | 60 | 0 | −5 | 0 | 0 | 25 |
| 6 | 71 | 1 | 6 | 6 | 1 | 36 |
| 8 | 77 | 3 | 12 | 36 | 9 | 144 |
| x̄ = 5 | ȳ = 65 | 75 | 20 | 314 |
- Means: x̄ = 25 / 5 = 5; ȳ = 325 / 5 = 65.
- Sum of cross-products = 75.
- Denominator = √(20 × 314) = √6,280 ≈ 79.25.
- r = 75 / 79.25 ≈ .95.
That is a very strong positive relationship, and r² ≈ .90, so about 90% of the variation in exam scores is shared with revision hours in this tiny sample. With only five cases, though, a single unusual student could change the picture completely, which is why real studies need far larger samples.
Interpreting strength, direction and r²
A rough guide to size, following Cohen’s widely cited benchmarks for the behavioural sciences:
| |r| | Conventional label |
|---|---|
| around .10 | small |
| around .30 | medium (moderate) |
| .50 and above | large (strong) |
Treat these as a starting point, not a rule. In some fields a correlation of .20 between a cheap intervention and an important outcome is valuable; in others, two measures of the same construct should correlate above .80.
The coefficient of determination, r², is the proportion of variance in one variable that is linearly accounted for by the other. An r of .42 gives r² ≈ .18, or about 18% shared variance.
Three cautions apply to any correlation:
- Correlation is not causation. A third variable, reverse causation or selection effects can produce a correlation.
- Pearson only detects linear patterns. A strong U-shaped relationship can give r ≈ 0. Always look at a scatterplot.
- Restricted range weakens r. Correlating entrance scores with grades only among admitted students understates the true relationship.
A fourth caution concerns outliers. Because Pearson’s r is built on squared deviations, one extreme point can create a strong correlation where none exists or hide one that does. The classic demonstration is Anscombe’s quartet: four small datasets with almost identical means, standard deviations and r ≈ .82, yet completely different scatterplots, one of them a perfect line spoiled by a single outlier. If removing one case changes your conclusion, say so, and report both results or switch to Spearman’s rho.
Want a second pair of eyes? Want a second pair of eyes on your correlations or correlation matrix? We explain the output so you can report it confidently. See statistics help.
Pearson vs Spearman: when to use which
Spearman’s rho is Pearson’s formula applied to the ranks of the data instead of the raw values. It therefore measures whether the relationship is monotonic (consistently increasing or decreasing), not necessarily straight-line.
| Pearson’s r | Spearman’s rho | |
|---|---|---|
| Data type | Two continuous variables | Ordinal, or continuous data that break Pearson’s assumptions |
| Relationship detected | Linear | Monotonic |
| Sensitivity to outliers | High | Lower |
| Assumptions | Linearity; no extreme outliers; roughly bivariate normal data for the significance test and confidence interval | Monotonic relationship; paired observations |
So Spearman’s rho is not the same as Pearson’s r, though they often give similar values. In the worked example the ranks of x are 1–5 and the ranks of y are 1, 3, 2, 4, 5, giving rho = .90 against Pearson’s .95. When there are no tied ranks, a shortcut formula applies: rho = 1 − [6Σd² / (n(n² − 1))], where d is the difference between each pair of ranks. Here Σd² = 2, so rho = 1 − 12/120 = .90.
Choose Spearman for single Likert items, ranks, clearly skewed data or obvious outliers that are genuine values. Kendall’s tau is another rank-based option that behaves better with many ties or very small samples.
Testing significance and building a confidence interval
To test whether a sample correlation differs from zero, convert it to a t statistic with n − 2 degrees of freedom:
t = r√(n − 2) / √(1 − r²)
Say a study of 50 employees finds r = .42 between autonomy and job satisfaction. Then t(48) = .42 × √48 / √(1 − .1764) = 2.910 / 0.9075 ≈ 3.21, giving p = .002 (two-tailed).
A confidence interval is more informative. Because the sampling distribution of r is skewed, it is built on Fisher’s z transformation, z = ½ ln[(1 + r) / (1 − r)], with standard error 1 / √(n − 3), and then converted back. For r = .42 and n = 50 this gives a 95% CI of [.16, .63]: the data are compatible with anything from a small to a large population correlation. The general logic of p values and intervals is covered in our hypothesis testing guide.
Partial correlation and other extensions
A simple correlation can be inflated or hidden by a third variable. Ice cream sales and drowning incidents correlate because both rise in hot weather. A partial correlation estimates the relationship between two variables after removing the linear influence of one or more others. If autonomy and job satisfaction correlate at .42, but both are also related to seniority, the partial correlation controlling for seniority tells you how much of the association remains among people of similar seniority.
Other variants you may meet:
- Point-biserial correlation: one continuous and one genuinely binary variable (for example test score and pass/fail on a separate criterion). It is numerically identical to Pearson’s r with the binary variable coded 0/1, and closely linked to the independent-samples t-test.
- Phi coefficient: two binary variables; equivalent to Pearson’s r on two 0/1 variables.
- Intraclass correlation (ICC): agreement between raters or repeated measurements, used for reliability rather than association.
Common mistakes to avoid: running dozens of correlations and reporting only the significant ones without correction; averaging correlations without Fisher’s z transformation; and pooling groups whose relationships differ, which can create or reverse a correlation (Simpson’s paradox). A scatterplot coloured by group often reveals the last problem at a glance.
How to report a Pearson correlation in APA style
In APA 7, italicise r and p, omit the leading zero (because r cannot exceed 1), give degrees of freedom in parentheses and report exact p values:
Autonomy was positively correlated with job satisfaction, r(48) = .42, p = .002, 95% CI [.16, .63]. Employees who reported more control over their work tended to be more satisfied.
For Spearman:
Class rank and self-rated confidence were moderately related, rₛ(58) = −.31, p = .016.
Describe the direction in words as well as numbers, and avoid causal verbs such as “led to” or “increased”; “was associated with” or “tended to” keeps the claim within what a correlation can show.
With many variables, use a correlation matrix table showing only the lower triangle, with means and standard deviations in the first columns. If correlation is a step towards prediction or controlling for other variables, move on to regression analysis. For help running and interpreting correlations in your own data, see our SPSS help or R programming help.