How to use the Correlation Coefficient
- Paste your X values into the first box and the matching Y values into the second.
- Keep the pairs aligned — the first X goes with the first Y, and extra unpaired values at the end are ignored.
- Read Pearson's r, which runs from −1 through 0 to +1.
- Check r² to see the share of variance in Y that moves with X.
- Use the t statistic with n − 2 degrees of freedom if you need a formal significance test.
How the calculation works
Pearson's r is the covariance of two variables divided by the product of their standard deviations, which rescales it into a unit-free number between −1 and +1. Because it is standardised, it is unaffected by changing units: converting heights from centimetres to inches leaves r untouched, while the raw covariance changes completely.
The coefficient captures linear association only. A perfect parabola through the origin, symmetric about the y-axis, has r of exactly zero despite Y being entirely determined by X. Anscombe's quartet is the classic demonstration: four data sets with identical means, variances and correlations that look nothing alike when plotted. Always look at the scatter before trusting a single coefficient.
Correlation is also acutely sensitive to outliers and to restricted range. One extreme point can pull r from 0.1 to 0.8 in a small sample, and truncating the range — measuring the link between test scores and job performance among people who all passed the test — systematically shrinks it. And the familiar warning holds: shared movement is consistent with X causing Y, Y causing X, or an unmeasured third variable driving both.
r = Σ(xᵢ − x̄)(yᵢ − ȳ) / √[Σ(xᵢ − x̄)² × Σ(yᵢ − ȳ)²]; t = r√(n − 2) / √(1 − r²) with df = n − 2Source: Pearson, 'Mathematical Contributions to the Theory of Evolution III', Phil. Trans. R. Soc. A 187 (1896); Anscombe, 'Graphs in Statistical Analysis', The American Statistician 27(1), 1973.
Worked example
Advertising spend of 1–7 thousand against sales of 2.1, 3.9, 6.2, 7.8, 10.1, 11.7 and 14.2.
- x̄ = 4, ȳ = 8.0.
- Σ(x − x̄)(y − ȳ) = 40.6; Σ(x − x̄)² = 28; Σ(y − ȳ)² = 58.98.
- r = 40.6 ÷ √(28 × 58.98) = 40.6 ÷ 40.64 = 0.9990.
- r² = 0.998, and t = 0.999 × √5 ÷ √0.002 = 49.9 on 5 df.
An r of 0.999 is a near-perfect positive linear relationship — 99.8% of the variation in sales tracks the spend in this sample.
Frequently asked questions
What is a strong correlation?+
As a rough guide, |r| above 0.7 is strong, 0.4–0.7 moderate and below 0.2 negligible — but the thresholds that matter depend heavily on the field.
Does r = 0 mean the variables are unrelated?+
No. It means there is no linear relationship. Curved relationships can be perfectly deterministic and still produce r near zero.
What does r² tell me that r does not?+
r² is the proportion of variance shared. An r of 0.5 sounds moderate but explains only 25% of the variation.
Can correlation prove causation?+
No. It is consistent with causation in either direction and with a confounding variable driving both. Only design, not arithmetic, settles causation.
Last reviewed September 1, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.