From Correlation to Slope
Correlation summarizes the direction and strength of a linear association without units. A regression slope answers a different question: how much the fitted response changes for a one-unit increase in the explanatory variable. These quantities are connected. Once the correlation and the sample standard deviations are known, the least-squares slope can be calculated without fitting the line from scratch.
Let \(x\) denote the explanatory variable and \(y\) the response variable. The fitted least-squares regression line has the form \(\hat{y}=b_0+b_1x\), where \(b_1\) is its slope. In this tutorial, \(r\) is the sample correlation between the paired \(x\)- and \(y\)-values, \(s_x\) is the sample standard deviation of the explanatory-variable values, and \(s_y\) is the sample standard deviation of the response-variable values.
This formula calculates the slope, not the intercept. It applies to paired quantitative data: each \(x\)-value must be matched with its corresponding \(y\)-value. For the formula using \(r\), both variables must vary in the sample, so \(s_x>0\) and \(s_y>0\). No assumption of normally distributed values is needed just to calculate this descriptive slope. The slope is most useful as a summary when a straight-line pattern is a reasonable description of the association; strong curvature or influential unusual observations can make that summary misleading.
Why the Formula Has This Form
The formula can be understood through standardization. Standardizing \(x\) means measuring its values in sample standard deviations from their mean; standardizing \(y\) does the same for the response. In those standardized units, the least-squares slope is \(r\). Converting back to the original measurement scales multiplies by \(s_y\) to restore response units and divides by \(s_x\) to account for the explanatory-variable scale.
The conversion can be written directly. If \(z_x=(x-\bar{x})/s_x\) and \(z_y=(y-\bar{y})/s_y\), then a one-unit increase in \(x\) corresponds to an increase of \(1/s_x\) in \(z_x\). A fitted change of \(r\) standardized response units corresponds to \(r s_y\) response units. Therefore the fitted change in \(y\) for a one-unit increase in \(x\) is
This also explains the units and sign. The correlation \(r\) has no units, while \(s_y/s_x\) has units of response per explanatory unit. Since standard deviations are positive, the sign of \(b_1\) is the sign of \(r\): a positive association gives a positive slope, and a negative association gives a negative slope.
Worked Example: Calculating a Slope From Paired Measurements
Suppose four hypothetical study sessions have explanatory-variable values \(x\) of 1, 2, 3, and 4 hours, and corresponding response values \(y\) of 2, 3, 5, and 6 points on a hypothetical assessment. Calculate the least-squares slope from the correlation and sample standard deviations.
First, the sample means are \(\bar{x}=2.5\) hours and \(\bar{y}=4\) points. The sums of squared deviations are
With \(n=4\), the sample standard deviations are
The sum of the paired cross-products of deviations is
Thus the sample correlation is
Now apply the slope formula, retaining the order \(s_y/s_x\):
The fitted line has a positive slope. In this sample, its predicted assessment score rises by 1.400 points for each additional hour of the explanatory measurement. This describes the fitted line, not a guaranteed change for every session and not evidence that increasing the hours causes a higher score.
Interpreting the Sign and Scale
A slope has a direction and a size. Its sign describes whether fitted response values tend to rise or fall as \(x\) increases. Its magnitude gives the change in fitted \(y\), in the response variable’s units, for a one-unit increase in \(x\). The standard deviations matter: two data sets can have the same correlation but different slopes if their measurement scales differ.
Worked Example: A Negative Slope in Context
In a hypothetical sample of 16 people, \(x\) is weekly screen time measured in hours and \(y\) is a response score measured in points. Suppose the sample summaries are \(r=-0.60\), \(s_x=3.0\) hours, and \(s_y=4.0\) points. Calculate and interpret the slope.
Both standard deviations are positive, so the correlation-based formula is defined. Substitution gives
The negative sign agrees with the negative correlation. The fitted response score decreases by 0.80 points for each one-hour increase in weekly screen time. This is a description of the linear association in these hypothetical data; it does not establish that screen time causes the score to change.
The value \(-0.60\) alone is not the slope. It indicates the direction and strength of the linear association on a unit-free scale. The ratio \(s_y/s_x\) supplies the scale needed to express the fitted change in points per hour.
Worked Example: How Changing Units Changes the Slope
Suppose, in another hypothetical sample, \(x\) is weekly exercise time and \(y\) is resting heart rate in beats per minute. The summaries are \(r=0.45\), \(s_x=2.0\) hours per week, and \(s_y=8.0\) beats per minute. Calculate the slope when exercise time is measured in hours, then convert the explanatory variable to minutes.
With hours as the unit for \(x\),
The positive slope means that the fitted resting heart rate increases by 1.8 beats per minute for each additional hour per week of exercise time in this sample. This association alone does not imply a causal effect.
One hour is 60 minutes, so \(s_x=120\) minutes per week. The correlation and response standard deviation do not change. In minutes, the slope is
The numerical slope is smaller because a one-minute increase is a smaller change than a one-hour increase. The fitted relationship has not changed; only the unit used to measure the explanatory variable has changed.
When the Formula Cannot Be Used
The correlation-based formula requires \(s_x>0\) and \(s_y>0\). If every observed \(x\)-value is identical, \(s_x=0\), and there is no variation in the explanatory variable from which to determine a unique least-squares slope. If \(s_x>0\) but every \(y\)-value is identical, then \(s_y=0\). The least-squares slope is then \(0\), because a horizontal line at that constant response value fits the data exactly, but the sample correlation \(r\) is undefined. The expression \(r s_y/s_x\) therefore cannot be used in that case.
These cases are distinct. It is not enough to check only that the explanatory variable varies: the formula specifically uses a correlation, and the correlation is undefined if either variable has zero sample standard deviation.
Common Mistakes
- Reversing the standard deviations. The formula is \(b_1=r(s_y/s_x)\), not \(r(s_x/s_y)\). The correct ratio gives response units per explanatory unit.
- Treating correlation as the slope. Correlation is unitless and lies between \(-1\) and \(1\); a slope has measurement units and is not restricted to that range.
- Ignoring the sign. Since the standard deviations are positive, the slope has the same sign as \(r\). A negative \(r\) cannot produce a positive slope under this formula.
- Using the formula when a variable does not vary. If \(s_y=0\), the slope is zero when \(s_x>0\), but \(r\) is undefined, so the correlation formula is unavailable. If \(s_x=0\), the slope is not uniquely determined.
- Turning a fitted association into a causal claim. A slope describes the fitted relationship in the data. By itself, it does not show that changing \(x\) causes a change in \(y\).
Check Your Understanding
Use the formula and attend to the units and conditions in each question.
- A hypothetical sample has \(r=0.30\), \(s_x=5\) kilograms, and \(s_y=2\) centimeters. What is the least-squares slope, including its units?
- Two hypothetical variables have \(r=-0.70\), \(s_x=4\) hours, and \(s_y=6\) points. State the slope and interpret its sign and scale.
- Why can two data sets have the same correlation but different least-squares slopes?
- If \(s_x>0\) but \(s_y=0\), what is the least-squares slope, and why can it not be calculated using \(r(s_y/s_x)\)?
- A student says that a slope of \(0.4\) means the correlation is \(0.4\). Explain why this conclusion is not generally justified.