Correlation measures one specific thing: how strongly two variables move together in a straight-line pattern. Taller people tend to weigh more; ice cream sales tend to rise with temperature; hours studied tend to move with exam scores. The Pearson correlation coefficient, r, puts a precise number on that relationship β but it's also one of the most misused numbers in statistics, routinely stretched to claim things it was never built to say.
- How to calculate Pearson's r, and what the number from -1 to +1 actually means
- Why correlation only captures linear relationships β and what that misses
- How outliers can wildly distort a correlation coefficient
- Exactly why correlation doesn't imply causation, with real mechanisms for false correlations
The Formula and What It Measures
It's worth being precise about scale, too: correlation is unaffected by the units either variable is measured in. Whether height is measured in centimetres or inches, or income in dollars or thousands of dollars, the Pearson correlation coefficient between height and income comes out identical β this scale-invariance is exactly why r is reported as a single, unitless number between β1 and +1 rather than in the original units of either variable, and it's what makes correlations comparable across completely different pairs of variables.
The numerator is the covariance of x and y β a measure of how much the two variables vary together. When x is above its mean at the same time y is above its mean (and vice versa), each term in the sum is positive, pushing r upward. When one is above its mean while the other is below, the term is negative. The denominator rescales this into a standardized range from β1 to +1, making it comparable across any two variables regardless of their original units.
- r = +1: a perfect positive linear relationship β every point falls exactly on an upward-sloping line.
- r = β1: a perfect negative linear relationship β every point falls exactly on a downward-sloping line.
- r = 0: no linear relationship at all.
- Values in between describe the strength: |r| above about 0.7 is usually considered strong, 0.3-0.7 moderate, below 0.3 weak β though these thresholds are conventions, not fixed rules, and what counts as "strong" varies by field.
Worked Example
Problem: Five students' hours studied and exam scores: (2, 65), (4, 70), (6, 80), (8, 85), (10, 95). Calculate the Pearson correlation coefficient.
Mean of x (hours) = 6, mean of y (scores) = 79.
Deviations and products: (β4)(β14)=56, (β2)(β9)=18, (0)(1)=0, (2)(6)=12, (4)(16)=64 β Ξ£(xα΅’βxΜ)(yα΅’βΘ³) = 150
Ξ£(xα΅’βxΜ)Β² = 16+4+0+4+16 = 40. Ξ£(yα΅’βΘ³)Β² = 196+81+1+36+256 = 570
r = 150 / β(40Γ570) = 150 / β22800 = 150 / 151.0 β 0.993
An r of 0.993 indicates an extremely strong positive linear relationship β in this small, deliberately clean example, hours studied very closely tracks exam score.
Correlation Only Captures Linear Relationships
This is the single most important limitation to understand. Two variables can have a very strong, completely deterministic relationship and still produce a Pearson correlation near zero, if that relationship isn't a straight line. A classic example: y = xΒ² for x ranging from β10 to +10 is a perfect, entirely predictable curve β but its Pearson correlation is exactly 0, because the relationship is symmetric and curved, not linear. Always look at a scatter plot alongside the correlation number; a number alone can hide a real, strong, non-linear pattern.
Outliers Can Distort Correlation Dramatically
Because the formula involves squared deviations in the denominator, a single extreme outlier can swing r substantially β sometimes creating the appearance of a strong correlation from otherwise unrelated data, or masking a genuine relationship in the rest of the data. This is exactly why examining a scatter plot before trusting a correlation coefficient is standard practice, not an optional extra step β a striking r value driven by one unusual point tells a very different story than the same r value spread evenly across the whole data set.
Correlation Does Not Imply Causation
This phrase gets repeated so often it risks becoming background noise, so it's worth being concrete about exactly how a real correlation can arise without any direct causal link:
- Reverse causation: ice cream sales correlate with drowning deaths β not because ice cream causes drowning, but because both rise with hot weather driving more swimming and more ice cream purchases simultaneously.
- Confounding variable: a third, unmeasured factor drives both variables. Cities with more fire trucks tend to have more fire damage β not because fire trucks cause damage, but because larger fires (the real driver) call in more trucks and cause more damage.
- Coincidence: with enough variables compared against each other, some will correlate strongly by pure chance β a well-known collection of spurious correlations pairs things like per-capita cheese consumption with the number of people who died tangled in their bedsheets, tracking almost perfectly for no causal reason whatsoever.
Establishing genuine causation requires a fundamentally different kind of evidence β typically a well-designed controlled experiment with random assignment, not just an observed correlation, however strong. Establishing this properly is the subject of experimental study design, a distinct topic from correlation itself.
Squaring the correlation coefficient gives RΒ² (the coefficient of determination), which has a genuinely useful practical interpretation: it's the proportion of variance in one variable that's "explained" by its linear relationship with the other. An r of 0.7 gives RΒ² = 0.49 β meaning about 49% of the variation in y is associated with variation in x, leaving 51% explained by other factors. This connects correlation directly to regression analysis, where RΒ² is the standard measure of model fit.
Real-World Uses
Finance: portfolio diversification relies directly on correlation β combining assets with low or negative correlation reduces overall portfolio volatility, because when one asset falls, a negatively correlated one is more likely to hold steady or rise, smoothing the combined result.
Medicine and public health: correlation is often the first signal researchers look for when investigating a potential risk factor β a correlation between a lifestyle factor and a health outcome doesn't prove causation on its own, but it's frequently the starting point that justifies a more rigorous controlled study.
Business analytics: correlating marketing spend with sales, or employee satisfaction scores with retention rates, is a standard first step in exploratory data analysis β cheap to compute and useful for generating hypotheses, even though confirming any of these relationships as causal requires further, more careful analysis.
Meteorology and climate science: correlating atmospheric variables (like sea surface temperature and rainfall patterns) is fundamental to building and validating predictive models, though climate scientists are especially careful to distinguish correlation from mechanism given how easily confounding variables enter environmental data.
Correlation With Categorical or Ranked Data
Pearson's r requires genuinely numeric, roughly continuous data and assumes the relationship (if any) is linear. For ranked or ordinal data β or when the relationship is monotonic but not necessarily a straight line β Spearman's rank correlation is used instead, calculated on the ranks of the values rather than the raw values themselves. This makes it more robust to outliers and appropriate for a wider range of relationships than Pearson's correlation.
Common Mistakes
Extrapolating beyond the observed data range. A strong correlation calculated from x values between 2 and 10 tells you nothing reliable about what happens at x = 50 β the relationship could curve, plateau, or reverse entirely outside the range you actually observed.
Averaging correlations incorrectly. Correlation coefficients cannot simply be averaged arithmetically across different samples or subgroups to get an overall correlation β doing so produces a mathematically invalid result. Combining correlations properly requires either pooling the raw data or using a proper statistical transformation (Fisher's z-transformation), not a simple mean of the r values themselves.
What counts as a "strong" correlation?
Can correlation be negative, and what does that mean?
Does a correlation of 0 mean the variables are completely unrelated?
How large a sample do I need before trusting a correlation coefficient?
Share this article
Written by
Statistics Fundamentals Editorial Team
Written and reviewed by our team of statistics educators. Content is aligned with GCSE, A-Level, AP Statistics, and undergraduate curricula.
About Statistics Fundamentals β