Correlation is a statistical measure of how strongly and in which direction two variables move together. In statistics, it is usually expressed as a correlation coefficient that ranges from -1 to +1: +1 means a perfect positive relationship, -1 a perfect negative relationship, and 0 means no relationship of the type the coefficient measures.
Correlation is one of the most widely used tools in data analysis, from finance and medicine to product analytics. It is also one of the most misread. A coefficient describes association, not cause, and each coefficient captures only a specific kind of pattern, so the choice of measure and a look at the data matter as much as the number itself.
How the Pearson correlation coefficient is calculated
The most common measure is the Pearson correlation coefficient, written r for a sample. It equals the covariance of the two variables divided by the product of their standard deviations. Dividing by the standard deviations removes the units, so r is comparable across datasets measured in meters, dollars or seconds.
Intuitively, each observation is converted to a standardized score, its distance from the mean in standard deviations. When high values of one variable coincide with high values of the other, the products of the scores are positive and r rises. Pearson’s r measures only linear association: a perfect U-shaped relationship can yield r close to 0.
The square of r, called the coefficient of determination or r², gives the share of variance in one variable that a linear model of the other explains. An r of 0.5 therefore corresponds to only 25 percent explained variance, which is smaller than many readers expect.
Types of correlation coefficients
Several coefficients exist because data differ in scale, distribution and shape of relationship. Rank-based coefficients are more robust to outliers and capture any monotonic pattern, not only straight lines.
| Coefficient | What it measures | Data requirements | Strength |
|---|---|---|---|
| Pearson r | Linear association | Interval or ratio data | Efficient with roughly normal data |
| Spearman rho | Monotonic association using ranks | Ordinal or continuous data | Robust to outliers and skew |
| Kendall tau | Agreement in pairwise ordering | Ordinal data, small samples | Clear interpretation, robust |
| Point-biserial | Binary versus continuous variable | One dichotomous variable | Equivalent to Pearson on 0/1 codes |
| Phi coefficient | Association of two binary variables | 2 by 2 contingency table | Simple for yes/no data |
For non-monotonic patterns, newer measures such as distance correlation can detect dependence that all of the above miss. A partial correlation measures the association between two variables after removing the linear effect of one or more control variables.
Interpreting the strength of a correlation
There is no universal scale for a strong or weak correlation; what counts as large depends on the field and on measurement noise. Widely used conventions in the behavioral sciences offer a rough guide.
| Absolute r | Common label | Explained variance r² |
|---|---|---|
| About 0.1 | Small | About 1 percent |
| About 0.3 | Medium | About 9 percent |
| About 0.5 | Large | About 25 percent |
| 0.9 and above | Very strong | 81 percent or more |
Statistical significance is a separate question from strength. With 10,000 observations, an r of 0.03 can be significant at conventional levels while being practically irrelevant; with 10 observations, an r of 0.5 may not be significant. Reporting a confidence interval for r conveys both the estimate and its uncertainty.
Correlation compared with related statistical concepts
Correlation builds on the descriptive measures in the same topic and is often confused with neighboring ideas. The table clarifies the distinctions.
| Concept | What it describes | Relation to correlation |
|---|---|---|
| Variance | Spread of one variable | Appears in the denominator through standard deviations |
| Standard deviation | Typical distance from the mean | Used to standardize both variables |
| Covariance | Joint variation in original units | Correlation is covariance scaled to -1 to +1 |
| Regression slope | Change in Y per unit change in X | Depends on units; correlation does not |
| Causation | One variable produces change in another | Not established by correlation alone |
Unlike a regression slope, correlation is symmetric: the correlation of X with Y equals that of Y with X. It says nothing about which variable responds to the other, and a steep slope can coexist with a weak correlation when the data are noisy.
Common pitfalls when using correlation
Most errors with correlation come from trusting the coefficient without inspecting the data. A scatter plot should precede any interpretation, because very different datasets can share the same r, as the classic Anscombe quartet demonstrates.
| Mistake | Cause | Remedy |
|---|---|---|
| Inferring causation | A confounder drives both variables | Use experiments or causal methods |
| Outlier-driven r | One extreme point dominates the sums | Plot the data; check Spearman rho |
| Missing a curved pattern | Pearson r captures only linear trends | Inspect a scatter plot; transform variables |
| Restricted range | Sample covers a narrow slice of values | Interpret r only within the sampled range |
| Aggregation reversal | Simpson’s paradox across subgroups | Analyze relevant groups separately |
| Spurious trend correlation | Two time series both trend over time | Correlate differences or detrended values |
Another trap is multiple testing. Computing hundreds of pairwise correlations guarantees some apparently significant results by chance alone, so exploratory correlation matrices require correction or independent confirmation.
Understanding it simply
Correlation tells whether two things tend to rise and fall together. Taller people tend to weigh more, so height and weight are positively correlated. The colder the weather, the more heating is used, so temperature and heating are negatively correlated.
The result is a number between -1 and +1. Values near the ends mean a tight pattern. Values near zero mean almost no pattern. The most important warning is that moving together does not prove cause. Ice cream sales and sunburns rise together, but summer sun causes both.
Applied in practice
A product analyst at a subscription software company examines whether weekly active usage relates to renewal. Across 4,000 customer accounts, the Pearson correlation between average weekly logins and the renewal flag, a point-biserial correlation, is about 0.35, and the 95 percent confidence interval is narrow.
Before reporting, the analyst plots the data and finds that a few very large accounts with automated logins inflate usage. Spearman’s rho on ranks gives a similar value, which suggests the pattern is not driven by outliers. The analyst presents the result as a moderate association, not proof that more logins cause renewals, and recommends a controlled onboarding experiment to test whether increasing usage actually improves retention.