Why Correlation Has Fixed Limits
Pearson’s correlation summarizes the direction and strength of a linear pattern between two quantitative variables. Its values always fall between \(-1\) and \(1\). These limits are not a convention imposed on the calculation; they follow from a basic inequality about sums of products. Understanding that inequality also explains what the endpoint values mean: a correlation of \(1\) or \(-1\) occurs only when the observed pairs lie exactly on a straight line with positive or negative slope.
To see the structure behind the result, center each variable by subtracting its sample mean. The centered values describe how far each observation is above or below its own mean. Correlation compares the products of these paired deviations with the overall sizes of the deviations in each variable.
This expression is equivalent to the covariance formula for correlation: the factors involving \(n-1\) in the sample covariance and the two sample standard deviations cancel. In the definition above, the numerator is the sum of paired centered products, and the denominator scales that sum by the sizes of the two sets of centered values.
The Inequality Behind the Bound
The Cauchy–Schwarz inequality says that for any two finite lists of real numbers \(a_1,\ldots,a_n\) and \(b_1,\ldots,b_n\),
In the correlation formula, choose \(a_i=x_i-\bar{x}\) and \(b_i=y_i-\bar{y}\). The numerator is then \(\sum a_i b_i\), while the denominator is the square root of \((\sum a_i^2)(\sum b_i^2)\). Provided that denominator is positive, divide both sides of the inequality by it. The result is
The bound applies to any finite set of paired numerical observations for which \(r\) is defined. It does not require a random sample, a particular probability model, or a specific distribution of the data. Those considerations can matter for other statistical questions, but the bound itself is a direct consequence of the values in the data.
Why Equality Means a Perfect Line
The inequality gives more than the limits. It also gives an exact condition for reaching them. To establish that condition, consider the centered lists \(a_i=x_i-\bar{x}\) and \(b_i=y_i-\bar{y}\). For any real number \(t\), a sum of squares cannot be negative:
Expanding the squares produces a quadratic expression in \(t\):
When both centered lists have nonzero sums of squares, the coefficient of \(t^2\) is positive. A quadratic with positive leading coefficient can stay nonnegative for every real \(t\) only if its discriminant is at most zero. Applying that condition gives
This is the Cauchy–Schwarz inequality for the two centered lists. Equality holds precisely when the quadratic has a repeated root, meaning the sum of squares is zero for some \(t\). A sum of squares is zero only when every squared term is zero, so equality requires \(b_i=t a_i\) for every observation. In the original variables, this means
Thus every observed point lies exactly on one straight line. If \(t>0\), the line has positive slope and the centered products add to a positive value, giving \(r=1\). If \(t<0\), the line has negative slope and the products add to a negative value, giving \(r=-1\). The case \(t=0\) would make all \(y_i\) equal, so \(y\) would have zero variability and correlation would be undefined rather than an endpoint.
Worked Examples
Worked Example: A Correlation Strictly Inside the Bounds
Suppose three hypothetical paired measurements are \(x=(1,2,3)\) and \(y=(2,4,5)\). Calculate \(r\), then check that the result falls within the permitted range.
The means are \(\bar{x}=2\) and \(\bar{y}=11/3\). The centered values are \(x_i-\bar{x}=(-1,0,1)\) and \(y_i-\bar{y}=(-5/3,1/3,4/3)\). Therefore,
Substituting these values into the formula gives
Both variables vary, so the denominator is positive and \(r\) is defined. The calculated value is positive and less than \(1\), as required. Since it is not an endpoint, these three points do not lie exactly on one straight line, even though their pattern is strongly positive.
Worked Example: Correlation of Minus One
Consider the hypothetical pairs \((1,8)\), \((2,6)\), and \((4,2)\). Each value of \(y\) follows the rule \(y=10-2x\). Verify the correlation and relate it to the equality condition.
The means are \(\bar{x}=7/3\) and \(\bar{y}=16/3\). The centered lists are \((-4/3,-1/3,5/3)\) and \((8/3,2/3,-10/3)\). Their sums of products and squares are
Thus
Here each centered \(y\)-value is \(-2\) times the corresponding centered \(x\)-value. The centered lists are exact negative multiples, so they meet the equality condition with a negative multiplier. In the scatterplot, all three points lie exactly on a straight line with negative slope.
Worked Example: Checking for Exact Linearity
Suppose four hypothetical observations are \(x=(1,2,3,4)\) and \(y=(1,2,2,4)\). Calculate \(r\) and check whether the equality condition holds.
The means are \(\bar{x}=2.5\) and \(\bar{y}=2.25\), giving centered lists \((-1.5,-0.5,0.5,1.5)\) and \((-1.25,-0.25,-0.25,1.75)\). The required sums are
Substitution gives
The centered lists are not multiples of one another: for example, the ratios of corresponding centered values are \((-1.25)/(-1.5)\approx 0.8333\) and \((-0.25)/(-0.5)=0.5\), which are not equal. The points therefore do not lie exactly on a straight line, and the correlation is positive but strictly below \(1\).
What the Endpoints Do—and Do Not—Tell You
An endpoint correlation is a statement about the observed pairs: they fit an exact straight-line rule. It is not simply a claim that a pattern looks very strong, nor does it mean every observation is identical. For \(r=1\), the values of \(y\) increase in exact proportion to the centered values of \(x\); for \(r=-1\), they decrease in exact proportion. Either variable may have any nonzero scale of variation.
The requirement that both variables vary is essential. If all \(x_i\) are the same, then \(\sum (x_i-\bar{x})^2=0\). If all \(y_i\) are the same, then \(\sum (y_i-\bar{y})^2=0\). In either case, the denominator in the formula is zero. It is incorrect to describe such a data set as having correlation zero: the correlation is undefined because the formula cannot be evaluated.
A further special case helps clarify why exact endpoints are about the data points rather than a guarantee of a broad pattern. With only two paired observations, if both variables vary, each centered list has two entries that are negatives of one another. One centered list must therefore be a positive or negative multiple of the other, so the correlation is \(1\) or \(-1\). Two points always determine a straight line; this endpoint alone does not provide evidence of a stable pattern among a larger set of observations.
Check Your Understanding
Use the centered-value formula and the equality condition to answer the questions.
- In the correlation formula, what choices of \(a_i\) and \(b_i\) make the Cauchy–Schwarz inequality apply?
- What does \(r=-1\) imply about the observed points and the slope of their line?
- A data set has the same \(x\)-value for every observation. Is its correlation zero, one, minus one, or undefined? Explain.
- Can a correlation of \(0.95\) correspond to points that are not exactly collinear? Explain using the equality condition.
- Why can two nonconstant paired observations have correlation \(1\) or \(-1\) even though the result may not indicate a dependable pattern in a larger population?