What r measures
Pearson's r answers one question: how close do the points come to lying on a single straight line, and does that line rise or fall? A value of +1 means every point sits exactly on an upward-sloping line, −1 means exactly on a downward-sloping one, and 0 means no linear pattern at all.
The construction is simple. For each pair, measure how far x sits from its mean and how far y sits from its mean, and multiply the two deviations. Pairs where both variables are above their means, or both below, contribute a positive product. Pairs where one is above and the other below contribute a negative one. Add the products and you have the covariance, which already answers the question — except that its size depends on the units. A covariance of 400 could indicate a tight relationship in millimetres or a weak one in kilometres.
Dividing by the product of the two standard deviations strips the units out. That is all r is: a covariance divided by the two spreads, which mathematically confines it to the range −1 to +1 by the Cauchy-Schwarz inequality. The consequence worth remembering is that r is invariant to any change of scale or origin: measure temperature in Fahrenheit or Celsius, prices in dollars or euros, and r does not move.
What r does not measure is the steepness of the relationship. A slope of 0.01 and a slope of 100 can both give r = 0.99 if the points hug the line equally tightly. For steepness you need linear regression; r is about tightness, not about rate of change.
Testing r, and putting an interval around it
An r computed from a handful of points can be large by luck. With five random pairs the sample correlation exceeds 0.878 in magnitude 5% of the time even when the two variables are completely unrelated. So a correlation needs a significance test, and the test statistic is t = r√(n−2) / √(1−r²) with n − 2 degrees of freedom.
That formula is exactly the t test for the slope in simple regression, and it must be, since the slope is zero precisely when r is zero. The n − 2 comes from the two parameters implicitly estimated — the two means. As n grows, the correlation needed to reach significance falls sharply: 0.878 at n = 5, 0.632 at n = 10, 0.197 at n = 100. With 1,000 pairs an r of 0.07 is significant and explains half a percent of the variance, which is the clearest demonstration that significance and importance are different questions.
For an interval around r you cannot use r ± something, because the sampling distribution of r is skewed and bounded — an r of 0.9 cannot stray far above itself but can fall a long way. Fisher's transformation fixes this: z = ½·ln[(1+r)/(1−r)] maps the bounded scale onto the whole real line, where the sampling distribution is approximately normal with standard error 1/√(n−3). Build the interval on the z scale, then transform both limits back with the hyperbolic tangent. The result is asymmetric around r, which is correct: the interval reported for the calculator's default data runs from −0.34 to +0.98, with far more room above the point estimate than below it.
Worked example: five pairs by hand
Take the default data, x = 1, 2, 3, 4, 5 and y = 2, 4, 5, 4, 5.
- Means. x̄ = 15/5 = 3; ȳ = 20/5 = 4.
- Deviations. x − x̄: −2, −1, 0, 1, 2. y − ȳ: −2, 0, 1, 0, 1.
- Products. 4, 0, 0, 0, 2, so Sₓᵧ = 6. Only two pairs contributed anything; the middle three sat on a mean.
- Sums of squares. Sₓₓ = 4+1+0+1+4 = 10; Sᵧᵧ = 4+0+1+0+1 = 6.
- r. 6 / √(10 × 6) = 6 / √60 = 6 / 7.745967 = 0.774597.
- r². 0.774597² = 0.600. Sixty percent of the variation in y is associated with variation in x.
- t statistic. 0.774597 × √3 / √(1 − 0.6) = 1.341641 / 0.632456 = 2.1213, on 3 degrees of freedom.
- Significance. The two-tailed 5% cut-off for t on 3 df is 3.182, and 2.12 falls well short. Equivalently, the critical r at n = 5 is 0.878 and 0.775 does not reach it. Not significant.
- Fisher interval. z = ½·ln(1.774597/0.225403) = ½ × 2.063438 = 1.031719. SE = 1/√2 = 0.707107. The 95% multiplier is 1.959964, so the interval on the z scale is 1.031719 ± 1.385903, and transforming back gives −0.340 to +0.984.
The interval is the honest summary. An r of 0.77 sounds impressive, but with five points the data are compatible with everything from a moderate negative relationship to a nearly perfect positive one. Reporting “r = 0.77” alone would be indefensible; reporting “r = 0.77, 95% CI −0.34 to 0.98, n = 5” tells the truth.
How to read the coefficient
Square it first. r² is the share of variation in one variable that is associated with the other, and it falls away much faster than r suggests: r = 0.5 gives r² = 0.25, so a “moderate” correlation accounts for a quarter of the variation and leaves three quarters unexplained. r = 0.3 accounts for 9%.
Treat the verbal labels as conventions, not facts. Calling |r| below 0.2 “very weak” and above 0.8 “very strong” is a widely used convention and nothing more; an r of 0.4 between a biomarker and a clinical outcome may be a major finding, while an r of 0.9 between two supposedly independent sensor channels is a fault report. Compare against the norms of your own field.
Check the significance test and the interval together. A significant r on 2,000 pairs may be trivially small; a non-significant r on 8 pairs may be consistent with a very strong relationship. The p-value tells you whether zero is ruled out; the interval tells you what is not ruled out.
Look at the deviation-products table for single dominant pairs. Pearson's r is not robust: one outlying point far from both means can create a large correlation from noise or destroy a real one. If one row's product dwarfs the rest, re-run without it, and consider Spearman's rank correlation, which uses ranks and is far less sensitive to extreme values.
Finally, the standing caution: correlation is not causation, and it is not even evidence of a relationship in a specific direction. Two variables can correlate because one drives the other, because a third drives both, or because of how the sample was selected. Restricting the range of x — studying only high earners, only large firms, only accepted applicants — systematically shrinks r towards zero even when the underlying relationship is strong.
How large must r be to reach significance?
| n (pairs) | df = n − 2 | Critical t | Critical |r| | r² at that point |
|---|---|---|---|---|
| 5 | 3 | 3.182 | 0.878 | 0.771 |
| 10 | 8 | 2.306 | 0.632 | 0.399 |
| 20 | 18 | 2.101 | 0.444 | 0.197 |
| 30 | 28 | 2.048 | 0.361 | 0.130 |
| 50 | 48 | 2.011 | 0.279 | 0.078 |
| 100 | 98 | 1.984 | 0.197 | 0.039 |
Read the last column carefully: at n = 100 a barely significant correlation explains under 4% of the variation. Significance is a statement about zero, not about size.
Where r misleads
- Curved relationships. A perfect parabola symmetric about the mean of x has r = 0. Always look at the plot before concluding there is no relationship.
- Outliers. A single distant point can drag r from 0.1 to 0.8 or the reverse. Check the deviation-products table for a row that dominates the sum.
- Restricted range. Correlating test scores with performance among people who were selected on the test guarantees an attenuated r. The population value is larger than the sample suggests.
- Aggregated data. Correlations computed on group averages are typically far higher than the same correlation on individuals — the ecological fallacy.
- Mixed subgroups. Two subgroups with no internal correlation can produce a strong overall r simply because their centres differ. Simpson's paradox is the extreme form, where the overall sign reverses within every subgroup.
- Reading causation into it. r is symmetric: it cannot distinguish x causing y from y causing x, let alone from a common cause.
Related measures
If you want to predict one variable from the other, or need the relationship in real units, move to the linear regression calculator. In simple regression R² equals r², and the t test for the slope is identical to the t test reported here — the two pages answer different questions about the same fit.
For the unstandardised version, in the original units of both variables, use the covariance calculator. For monotonic relationships that are not straight, or for data with outliers or ordinal scales, use Spearman's rank correlation, which applies this same formula to ranks rather than raw values.
For binary outcomes, correlation is the wrong summary and an odds ratio or a chi-square test of association is appropriate. And with several predictors, the individual correlations stop telling the whole story, because predictors correlated with each other share explanatory power; the adjusted R² calculator deals with that setting.
The coefficient was formalised by Karl Pearson in 1896, building on Francis Galton's work on regression towards the mean in the 1880s; Fisher's z transformation followed in 1915 and is still the standard way to build an interval for a correlation.
