Introduction
A study-time slope can describe different comparisons, depending on which other information is included in the regression. A simple regression compares exam scores across study times without accounting for prior achievement. A multiple regression can instead compare students with the same prior score while their study times differ. The two slopes need not be equal.
This tutorial works through a small, hypothetical dataset to calculate both slopes. The purpose is to see precisely what each number describes, not to conclude that studying more causes a particular score increase. The example is deliberately small enough to check the calculations by hand.
The Example Data and Regression Models
Suppose six hypothetical students have recorded study time, a prior exam score, and a later exam score. Study time is measured in hours; both scores are on a 100-point scale. Let \(x\) denote study time, \(z\) denote prior score, and \(y\) denote the later exam score.
| Student | Study time \(x\) (hours) | Prior score \(z\) (points) | Later exam score \(y\) (points) |
|---|---|---|---|
| A | 2 | 58 | 39 |
| B | 3 | 74 | 49 |
| C | 4 | 66 | 47 |
| D | 4 | 66 | 47 |
| E | 5 | 82 | 59 |
| F | 6 | 74 | 59 |
The simple regression model has fitted values \(\hat{y}=b_0+b_1x\). The two-predictor model has fitted values \(\hat{y}=b_0+b_1x+b_2z\). In each case, least squares chooses the coefficients to minimize the sum of squared residuals, where a residual is observed score minus fitted score.
The fitted models summarize associations in these data. To interpret the two-predictor model as a common adjusted comparison, its additive form must be suitable for the question: the fitted change for a one-hour difference is assumed to be the same across prior-score values. The predictors also must not be exact linear copies of each other, so their separate coefficients can be calculated. In the example, study time and prior score are not exact linear copies. No tests or confidence intervals are calculated here, so sampling assumptions for such inference are not needed. These fitted slopes alone do not establish cause and effect.
Worked Example: Calculating the Unadjusted Slope
First fit a simple regression of later exam score on study time alone. The sample means are \(\bar{x}=4\) hours and \(\bar{y}=50\) points. The least-squares slope is the sum of the cross-products of centered values divided by the sum of squared centered study times:
For the six students, the centered study times are \(-2,-1,0,0,1,2\), and the centered scores are \(-11,-1,-3,-3,9,9\). Therefore,
The intercept is \(b_0=\bar{y}-b_1\bar{x}=50-(5)(4)=30\). Thus the unadjusted fitted line is \(\hat{y}=30+5x\). In this sample, the fitted later exam score increases by 5 points for each additional hour of study time, without accounting for prior score. The units are points per hour.
Calculating the Adjusted Coefficient
To fit the two-predictor model, it is useful to center both predictors and the outcome by subtracting their sample means. Here \(\bar{x}=4\) hours, \(\bar{z}=70\) prior-score points, and \(\bar{y}=50\) later-score points. Centering does not change either slope; it makes the cross-products used to calculate them easier to see.
For this dataset, the centered cross-product totals are:
For example, the centered prior scores are \(-12,4,-4,-4,12,4\). Their cross-products with the centered later scores sum to \((-12)(-11)+(4)(-1)+(-4)(-3)+(-4)(-3)+(12)(9)+(4)(9)=296\). The other totals can be checked from the centered values in the table in the same way.
Worked Example: Solving for Both Adjusted Slopes
Write the centered two-predictor fitted model as \(\hat{y}-\bar{y}=b_1(x-\bar{x})+b_2(z-\bar{z})\). The least-squares slopes satisfy the centered normal equations:
These equations result from minimizing the sum of squared residuals. If \(u_i=x_i-\bar{x}\), \(v_i=z_i-\bar{z}\), and \(w_i=y_i-\bar{y}\), the centered residual is \(w_i-b_1u_i-b_2v_i\). Setting the derivative of the sum of its squares with respect to each slope equal to zero gives \(\sum u_i(w_i-b_1u_i-b_2v_i)=0\) and \(\sum v_i(w_i-b_1u_i-b_2v_i)=0\). Rearranging gives the displayed equations using the five cross-product totals above.
The determinant of the coefficient matrix is \(10(352)-40(40)=1920\), which is not zero, so the two equations have a unique solution. Solving,
The centered fitted model is therefore \(\hat{y}-50=3(x-4)+0.5(z-70)\). In the original units its intercept is \(50-(3)(4)-(0.5)(70)=3\), giving \(\hat{y}=3+3x+0.5z\).
The adjusted study-time coefficient is 3 points per hour: in this fitted model, a one-hour difference in study time is associated with a 3-point difference in predicted later score when prior scores are the same. The prior-score coefficient is 0.5 later-score points per prior-score point when study time is the same. Neither interpretation says that changing a predictor would necessarily cause that score difference.
Comparing Predictions at the Same Prior Score
A useful way to interpret the adjusted coefficient is to compare two fitted profiles that have the same prior score. Because the model is additive, the prior-score term is identical for both profiles and cancels in their predicted-score difference. The study-time contribution is then the study-time coefficient multiplied by the difference in hours.
Worked Example: Comparing Two Matched Profiles
Compare two hypothetical student profiles, both with a prior score of 70 points. One studies for 4 hours and the other for 5 hours. Use the adjusted fitted model \(\hat{y}=3+3x+0.5z\).
For the 4-hour profile, the fitted score is \(3+(3)(4)+(0.5)(70)=3+12+35=50\) points. For the 5-hour profile, it is \(3+(3)(5)+(0.5)(70)=3+15+35=53\) points. Thus the fitted difference is \(53-50=3\) points for a one-hour difference in study time at the same prior score.
For comparison, the unadjusted line predicts \(30+(5)(4)=50\) points at 4 hours and \(30+(5)(5)=55\) points at 5 hours, a 5-point difference. These are predictions from different models: the first comparison uses prior score in the model, while the second does not.
What the Difference Between Slopes Does—and Does Not—Say
The unadjusted slope is 5 points per hour, while the adjusted slope is 3 points per hour. This example shows that including prior score changes the fitted study-time association. It does not, by itself, explain why the numbers differ or tell us which model is appropriate for every purpose. Those are separate questions from calculating and interpreting these two coefficients.
The adjusted coefficient is conditional on the model's other predictor: it compares fitted scores at the same prior-score value. The unadjusted coefficient describes the overall fitted linear trend across the observed study times without using prior score in the regression. Because they describe different comparisons, the two estimates are not contradictory, even though they have different values.
The fitted values need not equal the observed scores. For example, for student A the adjusted fitted score is \(3+(3)(2)+(0.5)(58)=38\) points, while the observed score is 39 points. The residual is \(39-38=1\) point. A regression coefficient describes the fitted pattern; it does not claim every observation lies exactly on the fitted line or plane.
Common Mistake
A common mistake is to say, “The unadjusted slope is 5 and the adjusted slope is 3, so studying one more hour causes exactly 3 extra exam points after controlling for prior score.” That reasoning turns an association in an observational regression into a causal conclusion. The coefficient calculation alone does not establish that study time was assigned independently of other influences, nor does it rule out unmeasured differences between students.
The correction is to describe the fitted comparison precisely: in this two-predictor model, students with the same prior score but a one-hour difference in study time have predicted later exam scores that differ by 3 points. This is a model-based adjusted association, not automatically an effect of an intervention. Also avoid describing the 3-point coefficient as the overall trend: the overall trend from the simple regression in this example is 5 points per hour.
Check Your Understanding
Use the example and explanations above to answer these questions.
- What does the unadjusted slope of 5 points per hour describe in the hypothetical dataset?
- In the adjusted model, what quantities are held equal when interpreting the study-time coefficient?
- Using the adjusted model, what is the predicted-score difference between profiles with the same prior score and study times of 3 and 6 hours?
- Why is the adjusted study-time coefficient not automatically a causal effect?
- Why can the unadjusted and adjusted slopes differ without contradicting each other?