Key takeaways
- r is unitless and symmetric. Swapping x and y leaves Pearson’s r unchanged, so r cannot tell you which variable drives the other.
- Sign is direction, size is strength. Positive means both rise together; negative means one rises as the other falls.
- r = 0 means no linear pattern, not no relationship. A strong curve can produce a correlation near zero.
- r-squared is the practical number. r = 0.6 means about 36% of the variance is shared, not 60%.
- Significance is not strength. With a large sample, a trivial correlation can be statistically significant.
What the correlation coefficient measures
A correlation coefficient condenses a scatterplot into a single number. Pearson’s r asks whether the points tend to lie along a straight line and how tightly they cluster around it. If every point fell exactly on an upward-sloping line, r would be +1; if every point fell exactly on a downward-sloping line, r would be −1. A cloud with no linear trend gives r near 0.
Technically, r is the covariance of x and y divided by the product of their standard deviations. Dividing by both spreads removes the original units, so r does not change when you convert inches to centimeters or dollars to euros. That unitless property is what makes a correlation comparable across variables.
The formula
The definitional formula standardizes each observation before averaging the products:
r = 1/(n − 1) × Σ[((x − x̄)/sx) × ((y − ȳ)/sy)]
The computational form is easier to evaluate by hand and avoids rounding the means first:
r = Σ(x − x̄)(y − ȳ) ÷ √[Σ(x − x̄)² × Σ(y − ȳ)²]
Both formulas give the same answer because the n − 1 terms cancel in the ratio. The numerator is the sum of cross-products: positive when x and y are on the same side of their means, negative when they are on opposite sides. The denominator rescales that sum by the total variation in each variable, which is why r is bounded between −1 and +1.
Worked example: five pairs
Take five observations: x = 1, 2, 3, 4, 5 and y = 2, 4, 5, 4, 5. The mean of x is 3 and the mean of y is 4. The deviations from the mean are (−2, −1, 0, 1, 2) for x and (−2, 0, 1, 0, 1) for y. Their products sum to 4 + 0 + 0 + 0 + 2 = 6. The squared x deviations sum to 10, and the squared y deviations sum to 6.
So r = 6 ÷ √(10 × 6) = 6 ÷ 7.746 = 0.775. The relationship is positive and fairly strong. Squaring gives r² = 0.60, meaning about 60% of the variation in y is linearly associated with variation in x in this sample. Even a respectable correlation leaves plenty unexplained.
Strength, direction, and r-squared
Direction is read directly from the sign. A positive r means that when x is above its mean, y tends to be above its mean too. A negative r means the opposite. Strength is read from the absolute value, and the usual rule of thumb labels |r| below 0.3 as weak, 0.3 to 0.7 as moderate, and above 0.7 as strong. Those cutoffs are conventions, not laws.
Squaring the coefficient gives the proportion of variance shared by the two variables. r = 0.5 gives r² = 0.25, so only a quarter of the variance is accounted for, even though 0.5 sounds substantial. This is why reports aimed at non-specialists should quote r² alongside r. It also explains why correlations that look impressive can still leave predictions badly wrong.
Pearson or Spearman?
Pearson’s r measures linear association and uses the raw values, so a single extreme point can move it a lot. Spearman’s rho replaces the values with ranks and measures monotonic association: whether y tends to increase whenever x increases, even if the increase is curved. If a relationship is consistently upward but flattens out, Pearson may report 0.8 while Spearman reports 0.95.
Use Pearson when both variables are quantitative, the scatterplot is roughly linear, and there are no severe outliers. Use Spearman when the data are ordinal, when the relationship is monotonic but not linear, or when outliers make Pearson unstable. Report which coefficient you used, because the two can disagree.
Correlation is not causation
Three explanations fit almost any strong correlation. First, x may cause y. Second, y may cause x: hours of practice correlate with skill, but talent also drives practice. Third, a third variable may drive both. Ice cream sales and drowning deaths rise together, but heat drives both; banning ice cream would not save swimmers.
Age is a classic confounder in education data: shoe size correlates with reading ability among children, not because feet cause reading, but because older children have both. A randomized experiment is the strongest defense against confounding, because treatment assignment breaks the link between the treatment and other causes. When randomization is impossible, report the association as an association and describe the confounders you could not rule out.
Is the correlation statistically significant?
A sample correlation is an estimate, and its uncertainty depends heavily on n. The usual test statistic is:
t = r × √(n − 2) ÷ √(1 − r²), with n − 2 degrees of freedom
With n = 10 and r = 0.63, t = 0.63 × 2.828 ÷ 0.777 = 2.29, which gives a two-sided p-value of about 0.051 — just above the conventional 0.05 line. A 95% confidence interval computed with Fisher’s z transformation runs from roughly 0.00 to 0.90, which shows how little a ten-point sample pins down. The same r = 0.63 with n = 100 gives p < 0.001 and an interval of about 0.50 to 0.74.
Fisher’s transformation is z = arctanh(r), with standard error 1/√(n − 3); build the interval on that scale and transform back with tanh. The lesson is that r describes the sample, while the p-value asks whether the population correlation could plausibly be zero.
Traps: range restriction, curves, and subgroups
Restricting the range of x shrinks r even when the underlying relationship is strong. SAT scores and college grades correlate more weakly within an admitted class than across all applicants, because the class excludes the low end of the score range. The same attenuation happens when a variable is measured with error: unreliable measurements dilute the correlation toward zero.
Curves are another trap. The correlation between stress and performance can be near zero if moderate stress helps and extreme stress hurts, because the upward and downward parts cancel. Subgroups create Simpson’s paradox: a correlation can be positive within every department and negative overall when departments differ in size and base rates. Always plot the data, and plot it by group when groups exist.
Common mistakes
- Reading r = 0.5 as “50% of the relationship” instead of r² = 25% of the variance.
- Treating r = 0 as proof of independence when a strong curved relationship may be present.
- Comparing correlations across groups with very different ranges or reliabilities.
- Dropping an outlier solely because it weakens r, without checking whether it is a data error.
- Quoting a p-value for r while ignoring the confidence interval, especially in small samples.
- Describing a correlation as an “effect” before any causal design has been used.
How to report a correlation
Start with a scatterplot, because the number alone cannot reveal curvature, clusters, or outliers. Report the sample size, the coefficient and its type (Pearson, Spearman, or Kendall), and a confidence interval. Give r² when the audience needs to judge practical importance, and give the p-value only as a secondary check on whether the sample is compatible with zero.
Finally, separate description from explanation. “Height and weight are strongly correlated in this sample” is a finding. “Height causes weight” is a causal claim that needs a design capable of supporting it.
Frequently asked questions
What counts as a strong correlation?
There is no universal threshold. Above 0.7 is often called strong, 0.3 to 0.7 moderate, and below 0.3 weak, but the labels depend on the field and on the cost of a wrong prediction. A 0.5 correlation between two noisy biological measurements may be excellent.
Can a correlation coefficient be greater than 1?
No. The Cauchy–Schwarz inequality bounds the ratio at ±1, and the bound is reached only when all points lie exactly on a straight line. A value outside the range means the calculation or the data entry is wrong.
What does a correlation of zero mean?
It means there is no linear association in the sample. There may still be a strong curved relationship, a relationship that reverses direction, or a relationship that only appears within subgroups. Plot the data before concluding independence.
Is correlation the same as regression?
No. Correlation measures the strength of a linear association and treats both variables symmetrically. Regression fits a prediction line and treats one variable as the outcome, producing a slope in the units of y per unit of x.
Does a high correlation prove causation?
No. Confounding, reverse causation, and coincidence can all produce a high r. Only a design that rules out those alternatives — typically a randomized experiment — supports a causal claim.
How many pairs do I need?
Enough that the confidence interval is narrow enough to be useful. A rough rule is at least 30 pairs for a stable estimate, but the right answer comes from a power calculation based on the smallest correlation you care about detecting.
Further reading