The Central Idea
A scatterplot shows whether paired quantitative variables tend to move together. The correlation coefficient measures how closely that point cloud follows a straight-line pattern.
The sample correlation coefficient is denoted by \(r\), and it always satisfies
\[ \boxed{-1\le r\le 1}. \]Its sign gives the direction of the linear association, and its distance from \(0\) indicates the strength of that linear association.
Begin with the Scatterplot
Correlation should not be calculated and interpreted in isolation. First inspect a scatterplot for
- direction;
- linear or nonlinear form;
- clusters and gaps;
- outliers and influential observations;
- possible errors in pairing, units, or data entry.
A single number cannot reveal all of these features.
Population and Sample Correlation
The correlation for an entire population is commonly denoted by the Greek letter \(\rho\), pronounced “rho.” The correlation calculated from sample data is denoted by \(r\).
\[ \text{population correlation: }\rho \qquad \text{sample correlation: }r. \]In this lesson, correlation usually means the sample Pearson correlation coefficient \(r\).
What Pearson Correlation Measures
Pearson's correlation coefficient measures the direction and strength of a linear relationship between two quantitative variables. It answers a focused question:
How consistently do observations with above-average values of one variable also have above-average or below-average values of the other?
It does not summarize every possible kind of dependence.
Positive Correlation
When \(r>0\), the variables have a positive linear association. Cases with above-average \(x\)-values tend to have above-average \(y\)-values, and cases with below-average \(x\)-values tend to have below-average \(y\)-values.
Values of \(r\) closer to \(1\) indicate a tighter positive linear pattern.
Negative Correlation
When \(r<0\), the variables have a negative linear association. Cases with above-average \(x\)-values tend to have below-average \(y\)-values, and cases with below-average \(x\)-values tend to have above-average \(y\)-values.
Values of \(r\) closer to \(-1\) indicate a tighter negative linear pattern.
Correlation Near Zero
When \(r\) is near \(0\), the data show little linear association. This means that a straight line does not summarize the point cloud well.
It does not necessarily mean that the variables are unrelated. A strong curved relationship can have \(r\) near \(0\).
Perfect Correlation
If every point lies exactly on a line with positive slope, then
\[ r=1. \]If every point lies exactly on a line with negative slope, then
\[ r=-1. \]Perfect correlation requires exact linear alignment. A perfect curved relationship does not produce \(r=1\) or \(r=-1\) unless the curve is actually a line.
A Visual Scale for \(r\)
The following values provide a conceptual scale:
| Value of \(r\) | Linear pattern |
|---|---|
| \(1\) | Perfect positive linear association |
| Near \(1\) | Strong positive linear association |
| Near \(0\) | Weak or no linear association |
| Near \(-1\) | Strong negative linear association |
| \(-1\) | Perfect negative linear association |
“Near” has no universal numerical boundary. Context, data quality, sample size, and the consequences of a decision all affect what counts as practically important.
Standardized Values
Correlation is built from standardized values. For a measurement \(x_i\), its standardized value is
\[ z_{x_i}=\frac{x_i-\bar{x}}{s_x}. \]Likewise,
\[ z_{y_i}=\frac{y_i-\bar{y}}{s_y}. \]Each standardized value reports how many sample standard deviations an observation lies above or below its variable's mean.
The Correlation Formula
For \(n\) paired observations, the sample correlation coefficient is
\[ \boxed{ r=\frac{1}{n-1} \sum_{i=1}^{n} \left(\frac{x_i-\bar{x}}{s_x}\right) \left(\frac{y_i-\bar{y}}{s_y}\right) }. \]In words, \(r\) is the average product of the paired standardized values, using the sample divisor \(n-1\).
Why Products Determine the Sign
If \(x_i\) and \(y_i\) are both above their means, their standardized values are both positive, so their product is positive. If both are below their means, both standardized values are negative, and their product is again positive.
\[ (+)(+)=+, \qquad (-)(-)=+. \]These same-side observations contribute toward positive correlation.
How Negative Contributions Arise
If one variable is above its mean while the other is below its mean, the standardized values have opposite signs.
\[ (+)(-)=-, \qquad (-)(+)=-. \]These opposite-side observations contribute toward negative correlation.
A Computational Form
Correlation can also be calculated directly from deviations:
\[ \boxed{ r= \frac{\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y})} {\sqrt{ \left[\sum_{i=1}^{n}(x_i-\bar{x})^2\right] \left[\sum_{i=1}^{n}(y_i-\bar{y})^2\right] }} }. \]This form makes the balance between paired co-movement in the numerator and total variation in the denominator visible.
Example Data
Consider five paired observations:
\[ (1,2),\ (2,3),\ (3,5),\ (4,4),\ (5,6). \]The means are
\[ \bar{x}=\frac{1+2+3+4+5}{5}=3 \]and
\[ \bar{y}=\frac{2+3+5+4+6}{5}=4. \]Example: Organize the Deviations
| \(x_i\) | \(y_i\) | \(x_i-\bar{x}\) | \(y_i-\bar{y}\) | Product | \(x\)-square | \(y\)-square |
|---|---|---|---|---|---|---|
| 1 | 2 | \(-2\) | \(-2\) | 4 | 4 | 4 |
| 2 | 3 | \(-1\) | \(-1\) | 1 | 1 | 1 |
| 3 | 5 | 0 | 1 | 0 | 0 | 1 |
| 4 | 4 | 1 | 0 | 0 | 1 | 0 |
| 5 | 6 | 2 | 2 | 4 | 4 | 4 |
| Sums | 9 | 10 | 10 | |||
Example: Calculate \(r\)
Substitute the three sums into the computational formula:
\[ r= \frac{9}{\sqrt{(10)(10)}} =\frac{9}{10} =0.9. \]The data have a strong positive linear association. Larger \(x\)-values tend to occur with larger \(y\)-values, and the points remain fairly close to a straight-line pattern.
Correlation and Covariance
The sample covariance is
\[ s_{xy} = \frac{1}{n-1} \sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y}). \]Correlation standardizes covariance:
\[ \boxed{r=\frac{s_{xy}}{s_xs_y}}. \]Covariance retains the units and scale of the variables. Correlation removes those units, creating a standardized measure between \(-1\) and \(1\).
Correlation Is Unitless
Because correlation divides covariance by the two standard deviations, the measurement units cancel. Changing height from inches to centimeters does not change the strength of the linear association with weight.
A correlation should therefore be reported as a number, not as centimeters, dollars, years, or another unit.
Correlation Is Symmetric
Interchanging the variables does not change the correlation:
\[ \boxed{r_{xy}=r_{yx}}. \]Correlation between height and weight is the same as correlation between weight and height. This symmetry differs from regression, where choosing a response variable and an explanatory variable matters.
Adding a Constant Does Not Change \(r\)
If the same constant is added to every value of a variable, its mean shifts by that constant but its deviations from the mean remain unchanged.
\[ r_{x,y}=r_{x+a,y+b}. \]Converting every temperature by adding an offset therefore does not change the magnitude or sign of the correlation, provided the scale direction is preserved.
Positive Rescaling Does Not Change \(r\)
Multiplying every value of a variable by a positive constant changes its standard deviation by the same factor. Standardization cancels the change. For \(a>0\) and \(b>0\),
\[ r_{x,y}=r_{ax,by}. \]Thus, converting meters to centimeters or dollars to thousands of dollars leaves correlation unchanged.
Negative Rescaling Reverses the Sign
Multiplying one variable by a negative constant reverses its order. The magnitude of correlation stays the same, but its sign reverses:
\[ r_{-x,y}=-r_{x,y}. \]Multiplying both variables by negative constants reverses both axes, so the original sign returns.
Correlation Is Not Slope
Correlation measures standardized linear strength. Slope measures change in the response variable per unit of the explanatory variable.
A strong relationship can have a small slope if the units make the vertical changes numerically small. A weak relationship can have a steep apparent slope. Changing measurement units changes slope but does not change correlation.
Correlation Describes Linear Form Only
Consider a perfectly symmetric relationship such as
\[ y=x^2 \]observed at \(x=-2,-1,0,1,2\). The relationship is exact, but the downward movement on the left balances the upward movement on the right. Its Pearson correlation is \(0\).
Therefore,
\[ \boxed{r=0\text{ does not imply no relationship}.} \]Correlation Does Not Establish Causation
A large value of \(|r|\) shows a strong linear association in the observed data. It does not prove that changing one variable will cause the other to change.
The association may result from reverse causation, a lurking variable, selection bias, measurement procedures, shared time trends, or chance. Causal conclusions require appropriate design and substantive reasoning.
Outliers Can Change Correlation
Pearson correlation uses means, standard deviations, and products of deviations. Each of these quantities is sensitive to unusual observations. A single distant point can greatly increase, decrease, or reverse \(r\).
Report the scatterplot, verify unusual cases, and compare conclusions with and without an influential point when that comparison is analytically appropriate.
Restricted Range Can Weaken Correlation
Sampling only a narrow range of one variable can make an underlying linear association appear weaker. For example, height and weight may have a lower correlation in a sample restricted to people of nearly the same height than in a more varied population.
Correlation belongs to the observed population and range. It is not an immutable property of the variable names.
Combining Groups Can Mislead
Two or more subgroups may have different centers or different within-group relationships. A combined correlation can be stronger, weaker, or opposite in sign from the correlations within the groups.
When a relevant categorical variable is available, inspect subgroup scatterplots and correlations before relying on a single pooled value.
Sample Size Matters
A correlation calculated from a small sample can change substantially when only one or two observations change. A moderate sample correlation may reflect a real population pattern, sampling variation, or both.
Later inferential methods quantify uncertainty about population correlation. For now, always report the number of paired observations and avoid false precision.
Missing Data Must Preserve Pairing
Correlation requires complete pairs. If one case has an \(x\)-value but no \(y\)-value, that case cannot contribute a paired product unless a justified missing-data method is used.
Deleting missing \(x\)-values and missing \(y\)-values independently can misalign the rows and produce a meaningless result.
Correlation Requires Variation
If every \(x\)-value is identical, then
\[ s_x=0. \]The formula for \(r\) would divide by zero. Correlation is therefore undefined if either variable has zero variation.
Interpret Magnitude in Context
Universal labels such as “weak below \(0.3\)” or “strong above \(0.7\)” can be convenient, but they are not laws. A correlation of \(0.3\) may matter in a setting with noisy human behavior, while \(0.9\) may be inadequate for precision calibration.
Interpretation should consider measurement reliability, expected variability, sample size, decision stakes, and field-specific benchmarks.
Statistical and Practical Importance
A correlation can be statistically distinguishable from zero yet too small to matter operationally. Conversely, a correlation with meaningful practical consequences may be estimated imprecisely in a small sample.
Magnitude, uncertainty, and real-world consequences answer different questions and should be evaluated separately.
Correlation Matrices
When a dataset contains several quantitative variables, their pairwise correlations can be organized in a correlation matrix. The entry in row \(i\), column \(j\) is the correlation between variables \(i\) and \(j\).
A correlation matrix is symmetric, and for every nonconstant variable its diagonal entry equals \(1\):
\[ r_{ij}=r_{ji}, \qquad r_{ii}=1. \]The matrix is a compact screening tool, but important pairwise scatterplots should still be examined.
Pearson and Rank Correlation
Pearson's \(r\) measures linear association using the original numerical values. Rank-based coefficients, such as Spearman's correlation, use the order of the observations and can summarize a consistently increasing or decreasing relationship that is not linear.
The methods answer different questions. A rank correlation is not a device for concealing data problems, and neither coefficient replaces a scatterplot.
A Reliable Workflow
- Identify the cases and two quantitative variables.
- Verify the pairing, units, and missing-data handling.
- Draw and inspect the scatterplot.
- Confirm that linear association is the feature of interest.
- Calculate \(r\) with appropriate software or the formula.
- Interpret its sign and magnitude in context.
- Investigate outliers, clusters, restricted range, and subgroups.
- State limitations and avoid unsupported causal claims.
Reporting Correlation
A concise report should include the variables, cases, sample size, direction, magnitude, form, and any material qualifications.
For example:
Among the \(80\) sampled stores, floor area and weekly sales had a strong positive linear association (\(r=0.82\)). The scatterplot contained one high-leverage store, so conclusions were checked with and without that observation.
Common Error: Reporting \(r\) Without a Graph
Different point patterns can produce the same correlation. One may be a clean linear cloud, another may contain a curve, and another may be driven by one influential point.
The number summarizes linear co-movement; the scatterplot shows the structure that gives the number meaning.
Common Error: Interpreting \(r=0\) as Independence
Zero correlation means no measured linear association. It does not generally imply that the variables are independent.
Independence does imply zero correlation when the needed moments exist, but the reverse implication fails in general.
Common Error: Treating Correlation as a Percentage
A correlation of \(0.6\) does not mean that the variables are “\(60\%\) related,” nor does it mean that a \(1\%\) increase in one produces a \(0.6\%\) increase in the other.
Correlation is a standardized index of linear association, not a rate, probability, or percentage change.
Common Error: Ignoring the Sign
The values \(r=0.8\) and \(r=-0.8\) have the same linear strength but opposite directions. Reporting only \(|r|=0.8\) discards an essential part of the relationship.
Common Error: Calling Correlation a Cause
Wording such as “\(x\) increases \(y\)” makes a causal claim. Correlation alone supports wording such as “larger \(x\)-values tended to occur with larger \(y\)-values.”
Common Error: Using Correlation for Categories
Pearson correlation requires quantitative variables. Arbitrarily coding categories as \(1,2,3\) invents numerical distances and can create a coefficient with no meaningful interpretation.
Practice 1: Direction and Strength
Interpret \(r=-0.87\) for vehicle age and resale value in a sample of used vehicles.
Practice 2: Compare Correlations
Which shows the stronger linear association: \(r=0.72\) or \(r=-0.91\)? Explain.
Practice 3: Units
The correlation between height in inches and weight in pounds is \(0.68\). What happens to \(r\) if height is converted to centimeters?
Practice 4: Reverse a Scale
If \(r_{xy}=0.55\), what is \(r_{-x,y}\)?
Practice 5: Zero Correlation
A dataset has \(r=0\). Give a reason why the variables may still be related.
Practice 6: Causation
Screen time and reported anxiety have \(r=0.42\) in an observational sample. State one conclusion the correlation supports and one conclusion it does not support.
Practice 7: Outlier Sensitivity
A correlation changes from \(0.18\) to \(0.76\) when one distant observation is included. What should the analyst report and investigate?
Practice 8: Undefined Correlation
Every case in a dataset has \(x=10\). Why is the correlation between \(x\) and \(y\) undefined?
Practice 9: Compute \(r\)
Suppose
\[ \sum(x_i-\bar{x})(y_i-\bar{y})=12, \quad \sum(x_i-\bar{x})^2=16, \quad \sum(y_i-\bar{y})^2=25. \]Find \(r\).
Practice 10: Critique a Claim
A manager says, “The correlation between advertising and sales is \(0.80\), so increasing advertising by \(10\%\) will increase sales by \(8\%\).” Identify the error.
Practice Answers
Practice 1
Vehicle age and resale value have a strong negative linear association in the sample. Older vehicles tend to have lower resale values. The coefficient alone does not establish the form beyond linearity or prove causation.
Practice 2
\(r=-0.91\) shows the stronger linear association because \(|-0.91|>|0.72|\). Its direction is negative, while the direction of \(r=0.72\) is positive.
Practice 3
The correlation remains \(0.68\). Converting inches to centimeters is a positive linear rescaling.
Practice 4
Multiplying one variable by \(-1\) reverses the sign, so
\[ r_{-x,y}=-0.55. \]Practice 5
The variables may have a curved relationship, such as a symmetric U-shaped pattern. Opposing linear tendencies can cancel and produce \(r=0\).
Practice 6
The data support a moderate positive linear association: people reporting more screen time tended to report more anxiety. The correlation does not establish that screen time causes anxiety.
Practice 7
Report both values and state that the apparent positive association depends heavily on one observation. Verify the record, identify its context, inspect the scatterplot, and determine whether the case belongs to the intended population.
Practice 8
Because all \(x\)-values are identical, \(s_x=0\). The correlation formula would divide by \(s_x\), so \(r\) is undefined.
Practice 9
Use the computational formula:
\[ r=\frac{12}{\sqrt{(16)(25)}} =\frac{12}{20} =0.6. \]Practice 10
The manager has confused correlation with a percentage rate and a causal slope. The value \(0.80\) measures standardized linear association. It does not specify the sales change per percent of advertising, and observational correlation alone does not prove a causal effect.
What to Remember
Pearson's sample correlation coefficient satisfies
\[ \boxed{-1\le r\le 1}. \]- The sign gives the direction of linear association.
- The magnitude \(|r|\) gives the strength of linear association.
- Correlation is unitless and symmetric.
- Positive shifts and rescalings do not change \(r\).
- Correlation is sensitive to outliers and restricted range.
- A value near zero can conceal a strong nonlinear relationship.
- Correlation does not establish causation.
Always interpret \(r\) with a scatterplot and within the context of the data.
Where We Go Next
Correlation measures how strongly two variables follow a linear pattern, but it does not produce an equation for prediction.
The next lesson, Simple Linear Regression, constructs a fitted line, interprets its slope and intercept, and uses residuals to evaluate how well the model represents the observed data.