Guides / correlation
Correlation: a complete guide, with worked examples
Correlation is the most widely used and most widely over-interpreted statistic in research. This guide explains what r actually measures, how to choose between Pearson and Spearman, works a coefficient out by hand, shows what r squared adds, and sets out the interpretation and reporting that examiners look for.
Correlation measures the strength and direction of the association between two variables. It is expressed as a coefficient between −1 and +1: values near +1 indicate that high scores on one variable accompany high scores on the other, values near −1 indicate the opposite, and values near 0 indicate no linear association. Correlation describes association only and does not establish that one variable causes the other.
Definition
What correlation measures
A correlation coefficient summarises how two variables move together in a single number between −1 and +1. The sign tells you the direction; the magnitude tells you the strength.
A positive correlation means high scores on one variable tend to accompany high scores on the other. A negative correlation means high scores on one accompany low scores on the other. A coefficient near zero means there is no consistent linear pattern — which, as the fourth panel below shows, is not the same as no relationship.
Pearson's r compresses an entire scatterplot into one number, and it can only see straight lines. A curved relationship, a cluster of outliers or two distinct subgroups can all produce a coefficient that badly misrepresents the data. This is why plotting is not optional. A scatterplot costs one line of code and settles in seconds what no summary statistic can tell you on its own.
Choosing
Pearson, Spearman or Kendall?
The choice is driven by your measurement level and the shape of the relationship, not by which one your software offers first.
| Coefficient | Use when | Measures | Symbol |
|---|---|---|---|
| Pearson's r | Both variables continuous, relationship linear, roughly normal | Linear association | r |
| Spearman's rho | Ordinal data, non-linear but monotonic, or outliers present | Monotonic association | rₛ or ρ |
| Kendall's tau | Small samples or many tied ranks | Concordance of pairs | τ |
The practical decision
Spearman's rho is simply Pearson's r computed on the ranked data rather than the raw values. That is why it handles outliers and curved-but-monotonic relationships: converting to ranks removes the influence of extreme values and of the exact spacing between them.
Send the variables and how they were measured. A named statistician confirms the right coefficient, runs it, and gives you the annotated output and the reporting sentence.
Get a fixed quoteAssumptions
Assumptions, and why you must plot first
Pearson's r carries assumptions that are routinely ignored, and the cost of ignoring them is a coefficient that means something other than what you think it means.
| Assumption | How to check | If it fails |
|---|---|---|
| Linearity | Scatterplot | Use Spearman, or transform the variable |
| Both variables continuous | Measurement level | Use Spearman for ordinal data |
| No influential outliers | Scatterplot | Use Spearman, or report both with and without |
| Homoscedasticity | Scatterplot — even vertical spread | Interpret cautiously; consider transformation |
| Bivariate normality | Histograms, Q-Q plots | Matters mainly for the p-value and CI, not r itself |
Every one of those checks except the last is answered by looking at a single scatterplot, which takes seconds. A single outlying point can move r from 0.10 to 0.60, or mask a genuine relationship entirely.
If you correlate university entry scores with degree performance using only admitted students, you have already removed the low end of the entry-score range. Restricting the range mechanically shrinks r — a genuine relationship in the full population can look like nothing in your sample. Always ask whether your sampling truncated one of the variables.
Worked example
Worked example: calculating Pearson's r by hand
Six participants complete a study skills measure (X) and sit an exam (Y). We want the correlation between them.
| Participant | X | Y | X−X̄ | Y−Ȳ | (X−X̄)(Y−Ȳ) | (X−X̄)² | (Y−Ȳ)² |
|---|---|---|---|---|---|---|---|
| 1 | 10 | 54 | −5 | −12 | 60 | 25 | 144 |
| 2 | 12 | 58 | −3 | −8 | 24 | 9 | 64 |
| 3 | 14 | 62 | −1 | −4 | 4 | 1 | 16 |
| 4 | 16 | 70 | 1 | 4 | 4 | 1 | 16 |
| 5 | 18 | 74 | 3 | 8 | 24 | 9 | 64 |
| 6 | 20 | 78 | 5 | 12 | 60 | 25 | 144 |
| Sum | 90 | 396 | 0 | 0 | 176 | 70 | 448 |
Step 1 — the means
X̄ = 90 / 6 = 15 and Ȳ = 396 / 6 = 66
Step 2 — the deviations and their products
Each row subtracts the mean, then multiplies the two deviations together. Those products are what carry the relationship: when both deviations have the same sign, the product is positive, pushing r upwards.
Step 3 — apply the formula
r = Σ(X−X̄)(Y−Ȳ) / √[Σ(X−X̄)² × Σ(Y−Ȳ)²]
r = 176 / √(70 × 448) = 176 / √31360 = 176 / 177.09 = 0.994
Step 4 — test it
t = r × √[(n−2) / (1−r²)] = 0.994 × √(4 / 0.0120) = 0.994 × 18.26 = 18.15
With df = n − 2 = 4, that gives p < .001.
An r of 0.994 essentially never occurs with real behavioural data — the numbers here were chosen so the arithmetic stays clean. Correlations in psychology and education are typically between 0.10 and 0.40. Treat any r above 0.90 in real data as a prompt to check whether you have accidentally correlated a variable with a version of itself.
Interpretation
Interpreting r and r squared
The coefficient itself is not on a scale most people read intuitively. Squaring it helps.
| r | r² | Variance explained | Conventional label |
|---|---|---|---|
| 0.10 | 0.01 | 1% | Small |
| 0.30 | 0.09 | 9% | Medium |
| 0.50 | 0.25 | 25% | Large |
| 0.70 | 0.49 | 49% | Very large |
| 0.90 | 0.81 | 81% | Rare in behavioural data |
r² is the proportion of variance in one variable that is shared with the other. An r of 0.30 — a “medium” effect by Cohen's conventions — accounts for 9% of the variance, leaving 91% unexplained. Stating both keeps the interpretation honest.
Cohen himself warned against applying them mechanically. In a field where correlations of 0.10 are the norm, an r of 0.25 may be substantial; in a calibration study, 0.90 may be unacceptably poor. Interpret against your field's typical effects, and always report the confidence interval around r.
Correlation with a binary variable
If one variable is genuinely dichotomous — passed or failed, treated or untreated — Pearson's r computed on 0/1 coding has a special name, the point-biserial correlation, but it is arithmetically identical and is interpreted the same way. It relates directly to the independent t-test: a significant point-biserial correlation and a significant t-test on the same data are the same result expressed twice. If the binary split is artificial, however — a continuous variable you cut at the median — expect the coefficient to shrink, because dichotomising throws away real information and typically costs you around 20% of your statistical power.
The confidence interval around r
A correlation from a small sample is very imprecise, and reporting r alone hides that. With n = 20, an observed r of 0.40 has a 95% interval of roughly [−0.05, 0.72] — consistent with no relationship at all and with a strong one. With n = 200 the same r gives roughly [0.28, 0.51], which is a genuinely informative result.
Our confidence interval calculator computes intervals for means and proportions, and the effect size calculator handles standardised effects with their intervals.
Use the calculatorWorked example
Worked example: Spearman's rho
Eight students rank their confidence with statistics (1 = least confident) and are separately ranked by exam performance. Both variables are ordinal, so Pearson is inappropriate.
| Student | Confidence rank | Exam rank | d | d² |
|---|---|---|---|---|
| A | 1 | 2 | −1 | 1 |
| B | 2 | 1 | 1 | 1 |
| C | 3 | 4 | −1 | 1 |
| D | 4 | 3 | 1 | 1 |
| E | 5 | 6 | −1 | 1 |
| F | 6 | 5 | 1 | 1 |
| G | 7 | 8 | −1 | 1 |
| H | 8 | 7 | 1 | 1 |
| Sum | 8 |
rₛ = 1 − [6Σd² / (n(n²−1))] = 1 − [(6 × 8) / (8 × 63)] = 1 − (48 / 504) = 1 − 0.095 = 0.905
A rho of 0.905 indicates a strong monotonic relationship: students who rank themselves as more confident do tend to rank higher on the exam, with each pair differing by only one rank position.
The simple formula above assumes no ties. With tied values — common in Likert data, where many respondents give the same answer — use the Pearson formula applied to the ranks instead. Every statistical package does this automatically, but the hand formula will be slightly wrong.
Extension
Partial correlation: holding a third variable constant
If you suspect a third variable is inflating or masking a relationship, a partial correlation estimates the association between X and Y with the influence of that third variable removed from both.
Worked example
Suppose study hours and exam score correlate at r = .55. You suspect prior attainment drives both. Prior attainment correlates .60 with study hours and .65 with exam score. The partial correlation is:
rₓₖ·ₛ = (rₓₖ − rₓₛrₖₛ) / √[(1 − rₓₛ²)(1 − rₖₛ²)]
= (.55 − (.60 × .65)) / √[(1 − .36)(1 − .4225)]
= (.55 − .39) / √(.64 × .5775) = .16 / .608 = .263
The association drops from .55 to .26 once prior attainment is held constant. Roughly half the original relationship was attributable to the fact that stronger students both study more and score higher — which is a substantively different story from the raw coefficient.
| Coefficient | Value | Interpretation |
|---|---|---|
Zero-order r | .55 | The raw association, confounded |
Partial r | .26 | With prior attainment held constant |
| Difference | −.29 | The portion explained by the confounder |
Controlling for one measured confounder does not make the relationship causal. There may be others you did not measure, and statistical control cannot address them. Partial correlation tells you the association survives adjustment for the variables you have — nothing about the ones you have not.
Partial versus semi-partial
A partial correlation removes the third variable from both X and Y. A semi-partial (or part) correlation removes it from only one of them, and is what regression reports when it gives the unique contribution of a predictor. They answer different questions, and software labels them inconsistently, so check which one you are reading.
Inference
Why correlation is not causation
This is the single most repeated warning in statistics and still the most frequently violated in discussion sections. A correlation between X and Y is consistent with several very different explanations, and the coefficient cannot distinguish between them.
| Explanation | Example |
|---|---|
| X causes Y | Studying more improves exam performance |
| Y causes X | Doing well makes students more willing to study |
| A third variable causes both | Conscientiousness drives both studying and performance |
| Selection effect | Only motivated students enrolled in the first place |
| Chance | With enough variables tested, some will correlate by luck |
Establishing causation requires design, not analysis: randomisation, temporal ordering, or a credible identification strategy. No correlation coefficient, however large and however significant, substitutes for it.
Write “was associated with”, “predicted” (in the statistical sense), or “covaried with”. Avoid “led to”, “caused”, “improved” or “affected” unless your design supports a causal claim. This single habit protects a great many discussion sections.
Pitfalls
Seven mistakes that cost marks
1. Not plotting the data
A curved relationship, an outlier or two subgroups will all produce a misleading coefficient. The scatterplot takes seconds and catches all three.
2. Using Pearson on ordinal data
Likert items, rankings and grades are ordinal. The spacing between response options is not known to be equal, so Spearman is the defensible choice.
3. Claiming causation
A correlation establishes that two variables move together, nothing more. Rewrite any sentence that says one variable improved, raised, reduced or caused another unless your design supports it.
4. Running dozens of correlations and reporting the significant ones
A correlation matrix with 10 variables contains 45 coefficients; at α = .05 you expect around two to be significant by chance alone. Either correct for multiple comparisons or state clearly that the analysis was exploratory.
5. Interpreting r as a percentage
An r of 0.50 does not mean 50% of anything. It is r² = 0.25, or 25%, that has the variance interpretation.
6. Ignoring restricted range
If your sample truncates one variable, r will understate the population relationship. Say so.
7. Reporting r without n or a confidence interval
An r of 0.45 from six participants and from six hundred are entirely different findings. The reader needs n to tell them apart.
Reporting
Reporting correlation in APA style
APA 7 wants the coefficient italicised, degrees of freedom in parentheses, no leading zero before the decimal point, and an exact p-value.
| Situation | How to write it |
|---|---|
| Pearson, significant | r(48) = .42, p = .002, 95% CI [.16, .63] |
| Pearson, non-significant | r(28) = .19, p = .314 |
| Spearman | rₛ(38) = .61, p < .001 |
| Very small p | p < .001 — never p = .000 |
| With variance explained | r(98) = .35, p < .001, r² = .12 |
.42, not 0.42, because r cannot exceed 1“Study skills scores were moderately positively associated with exam performance, r(98) = .35, p < .001, 95% CI [.16, .51], accounting for approximately 12% of the variance. As the design was cross-sectional, no causal inference is drawn.” That reports the coefficient, its precision, its practical size and its limits in three clauses.
Send your results chapter. A named statistician verifies the coefficients, checks the assumptions were met, and flags any causal language an examiner would query.
See results chapter reviewAnswers
Frequently asked questions
What is the difference between Pearson and Spearman correlation?
Pearson's r measures linear association between two continuous variables and assumes the relationship is a straight line. Spearman's rho measures monotonic association by correlating the ranks instead of the raw values, so it handles ordinal data, curved-but-consistent relationships and outliers. If either variable is ordinal — such as a Likert item — Spearman is the defensible choice.
What counts as a strong correlation?
By Cohen's conventions, .10 is small, .30 medium and .50 large, but these are field-dependent conventions rather than rules. In psychology and education, correlations above .50 are uncommon. Interpret against typical effects in your own literature, and always report the confidence interval, because a coefficient from a small sample is very imprecise.
Does correlation prove causation?
No. A correlation is equally consistent with X causing Y, Y causing X, a third variable causing both, a selection effect, or chance. Establishing causation requires design features such as randomisation and temporal ordering, not a larger coefficient. Use wording such as “was associated with” rather than “caused”.
What does r squared tell me?
It is the proportion of variance shared between the two variables. An r of .30 gives r² = .09, meaning the variables share 9% of their variance and 91% is unexplained. Reporting r² alongside r keeps the interpretation grounded, because r on its own tends to sound more impressive than it is.
Can a correlation be zero when the variables are clearly related?
Yes. Pearson's r only detects linear relationships. A strong curved relationship — performance rising with arousal and then falling, for instance — can produce an r near zero. This is the main reason to plot your data before computing any coefficient.
What sample size do I need for a correlation?
It depends on the effect you want to detect. To detect r = .30 with 80% power at α = .05 you need about 85 participants; to detect r = .50, about 29. Small samples produce very wide confidence intervals, which is why correlations from fewer than about 30 participants should be treated as provisional.
How do I report a correlation in APA style?
Give the coefficient italicised with degrees of freedom in parentheses, no leading zero, and an exact p-value: r(48) = .42, p = .002. Degrees of freedom are n − 2. Add the 95% confidence interval where the journal allows, and state which coefficient you used in the analysis section.
Keep reading
Related guides and services
Send the data. Get a fixed quote.
Attach your dataset or just describe the project. A named statistician replies with a price and a deadline, usually within one working day.