Correlation

On this page 7

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.

CoefficientWhat it measuresData requirementsStrength
Pearson rLinear associationInterval or ratio dataEfficient with roughly normal data
Spearman rhoMonotonic association using ranksOrdinal or continuous dataRobust to outliers and skew
Kendall tauAgreement in pairwise orderingOrdinal data, small samplesClear interpretation, robust
Point-biserialBinary versus continuous variableOne dichotomous variableEquivalent to Pearson on 0/1 codes
Phi coefficientAssociation of two binary variables2 by 2 contingency tableSimple for yes/no data
Common correlation coefficients and when each applies

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 rCommon labelExplained variance r²
About 0.1SmallAbout 1 percent
About 0.3MediumAbout 9 percent
About 0.5LargeAbout 25 percent
0.9 and aboveVery strong81 percent or more
Conventional interpretation of the absolute value of r

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 builds on the descriptive measures in the same topic and is often confused with neighboring ideas. The table clarifies the distinctions.

ConceptWhat it describesRelation to correlation
VarianceSpread of one variableAppears in the denominator through standard deviations
Standard deviationTypical distance from the meanUsed to standardize both variables
CovarianceJoint variation in original unitsCorrelation is covariance scaled to -1 to +1
Regression slopeChange in Y per unit change in XDepends on units; correlation does not
CausationOne variable produces change in anotherNot established by correlation alone
Correlation and neighboring concepts

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.

MistakeCauseRemedy
Inferring causationA confounder drives both variablesUse experiments or causal methods
Outlier-driven rOne extreme point dominates the sumsPlot the data; check Spearman rho
Missing a curved patternPearson r captures only linear trendsInspect a scatter plot; transform variables
Restricted rangeSample covers a narrow slice of valuesInterpret r only within the sampled range
Aggregation reversalSimpson’s paradox across subgroupsAnalyze relevant groups separately
Spurious trend correlationTwo time series both trend over timeCorrelate differences or detrended values
Typical mistakes, their causes and remedies

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.