Why Two Regression Slopes Can Both Be Correct
A regression slope is meaningful only after the association it summarizes has been specified. A simple regression of an outcome on one predictor describes their marginal association: it summarizes the relationship across the observations without accounting for other variables. In an additive multiple regression without interactions, a coefficient describes a conditional association: it summarizes the relationship between the outcome and predictor at fixed values of the other covariates. With interactions, that relationship can depend on covariate values.
These estimates need not be equal. They use the data differently and answer different descriptive questions. A difference does not, by itself, show that one calculation is wrong. The important tasks are to state which association is being estimated, check whether the model matches that question, and interpret the coefficient in context. Neither type of regression coefficient automatically describes a causal effect.
Specify the Model Before Interpreting a Coefficient
Let \(Y\) be a quantitative outcome, \(X\) a quantitative predictor, and \(Z\) a binary covariate coded 0 or 1. A simple linear regression has fitted equation \(\hat{Y}=\hat{\beta}_0+\hat{\beta}_{1,\mathrm{marg}}X\). Its slope is marginal with respect to \(Z\), because \(Z\) is not included in the equation.
A multiple regression with a common slope for \(X\) in the two groups has fitted equation \(\hat{Y}=\hat{\beta}_0+\hat{\beta}_{1,\mathrm{cond}}X+\hat{\beta}_2Z\). The fitted intercept for \(Z=0\) is \(\hat{\beta}_0\); for \(Z=1\), it is \(\hat{\beta}_0+\hat{\beta}_2\). The coefficient \(\hat{\beta}_{1,\mathrm{cond}}\) therefore represents one shared within-group slope.
The conditional equation assumes that a straight-line relationship is a suitable summary within each group and that the two groups share the same slope. In other words, the model has no \(X\)-by-\(Z\) interaction. If group-specific slopes differ, the common-slope model may still provide a numerical coefficient, but that coefficient is a pooled summary rather than the slope in each group. For the calculations below, the records are treated as the observations to summarize; no significance test or population inference is being made. Standard assumptions for inferential regression, such as independence and suitable error behavior, would need consideration before using standard errors or tests.
Worked Example: A Marginal Slope and an Adjusted Slope
Suppose a hypothetical training program records practice hours \(X\), a binary group indicator \(Z\), and a test score \(Y\), measured in points, for six participants. The records are constructed for illustration, not from a real study.
| Group indicator \(Z\) | Practice hours \(X\) | Test score \(Y\) (points) |
|---|---|---|
| 0 | 0 | 5 |
| 0 | 1 | 8 |
| 0 | 2 | 11 |
| 1 | 2 | 15 |
| 1 | 3 | 18 |
| 1 | 4 | 21 |
First fit the marginal simple regression. For observations \((x_i,y_i)\), its least-squares slope is
Here, \(\bar{x}=(0+1+2+2+3+4)/6=2\), and \(\bar{y}=(5+8+11+15+18+21)/6=13\). The numerator is
and the denominator is \((-2)^2+(-1)^2+0^2+0^2+1^2+2^2=10\). Thus \(\hat{\beta}_{1,\mathrm{marg}}=42/10=4.2\) points per practice hour. The fitted marginal line has intercept \(13-(4.2)(2)=4.6\) points, so its equation is \(\hat{Y}=4.6+4.2X\).
Now fit the conditional model with a common within-group slope. In group \(Z=0\), the means are \(\bar{x}_0=1\) and \(\bar{y}_0=8\). Its within-group slope is
In group \(Z=1\), the means are \(\bar{x}_1=3\) and \(\bar{y}_1=18\). The within-group slope is also \(\{(-1)(-3)+(0)(0)+(1)(3)\}/2=3\). Thus a shared within-group slope fits both groups: \(\hat{\beta}_{1,\mathrm{cond}}=3\). The fitted line for group 0 is \(5+3X\), and for group 1 it is \(9+3X\); equivalently, the multiple regression is \(\hat{Y}=5+3X+4Z\).
The marginal slope is 4.2 points per hour, while the conditional slope is 3 points per hour. Both calculations use the stated least-squares formula for their respective models. The first summarizes the overall pattern; the second compares practice hours within the two groups under a shared-slope model. They are different summaries, not competing calculations of the same quantity.
Why the Estimates Differ
In the example, the groups have different score levels at corresponding practice hours: the fitted group 1 line is 4 points above the group 0 line. The distributions of practice hours also differ: group 1 has higher practice-hour values. The marginal regression combines variation within groups with variation between groups. By contrast, the adjusted slope is estimated from how \(X\) and \(Y\) vary together within groups, while accounting for the group-specific intercept.
This distinction is visible in the calculations. The marginal numerator, \(\sum_i(x_i-\bar{x})(y_i-\bar{y})\), uses deviations from the overall means. The conditional coefficient in the group-indicator model is based on deviations from each group's means. Because the centering and included variation differ, the resulting slopes may differ. There is no general rule that the marginal slope must be larger or smaller; the direction and size of the difference depend on the data.
Why the Common Conditional Slope Is a Weighted Summary
For a binary covariate \(Z\) and an additive model with a shared slope, the adjusted least-squares slope can be derived by centering \(X\) and \(Y\) separately within each group. This gives a precise reason that the estimate reflects within-group relationships rather than the overall relationship.
Write \(g\) for group 0 or 1, and let \(x_{ig}\) and \(y_{ig}\) be observation \(i\)'s values in that group. For any proposed slope \(b\), the best fitted intercept within group \(g\) is \(\bar{y}_g-b\bar{x}_g\). The resulting residual for that observation is \((y_{ig}-\bar{y}_g)-b(x_{ig}-\bar{x}_g)\). Least squares chooses \(b\) to minimize the sum of squared residuals across both groups:
Differentiate \(S(b)\) with respect to \(b\) and set the derivative to zero. The result is
Rearranging and solving for \(b\) gives
This coefficient exists as a uniquely determined slope when there is within-group variation in \(X\), so the denominator is positive. The expression combines within-group cross-products and within-group variation in \(X\). Groups with more within-group variation in \(X\) can contribute more to the common slope than groups with little such variation. The derivation also depends on allowing separate group intercepts while imposing one shared slope.
Worked Example: Different Slopes Across Groups
Consider another hypothetical data set, with \(Y\) measured in score points and \(X\) in practice hours. Group 0 has observations \((X,Y)=(0,2),(1,4),(2,6)\); group 1 has \((0,10),(1,15),(2,20)\). The data show distinct group-specific slopes: \(2\) points per hour in group 0 and \(5\) points per hour in group 1.
If the question is about each group's conditional association, the two slopes are the relevant estimates. A model that insists on one shared conditional slope instead pools the within-group cross-products. Each group has \(\bar{x}_g=1\) and within-group sum of squares for \(X\) equal to \(2\). The within-group cross-product is \(4\) for group 0 and \(10\) for group 1. Therefore, the common adjusted slope is
In this particular data set, the marginal slope is also \(3.5\). The groups have the same distribution of \(X\), so the difference in their outcome levels does not add a between-group association between \(X\) and \(Y\). Still, 3.5 is not the slope in either group. It is the common-slope model's pooled summary. If the scientific question calls for different group-specific associations, reporting only the common slope would conceal that difference.
Worked Example: How Within-Group Variation Affects the Shared Slope
Use a third hypothetical data set. Group 0 has \((X,Y)=(0,1),(1,3),(2,5)\), and group 1 has \((0,7),(2,10),(4,13)\). Scores are in points. The within-group slopes are \(2\) points per hour in group 0 and \(1.5\) points per hour in group 1.
For group 0, the within-group means are \((1,3)\), the cross-product sum is \(4\), and the \(X\) sum of squares is \(2\). For group 1, the means are \((2,10)\), the cross-product sum is \(12\), and the \(X\) sum of squares is \(8\). The additive common-slope fit therefore gives
For comparison, across all six observations \(\bar{x}=1.5\) and \(\bar{y}=6.5\). The marginal cross-product sum is \(26.5\), and the overall \(X\) sum of squares is \(11.5\). Thus \(\hat{\beta}_{1,\mathrm{marg}}=26.5/11.5\approx2.304\) points per hour. The estimates differ because the marginal calculation includes between-group as well as within-group variation. The conditional common slope weights each group's within-group relationship according to its within-group variation in \(X\); here group 1 has substantially more such variation.
Interpretation, Pitfalls, and Practical Use
Before comparing estimates, ask what each is intended to describe. If the question concerns the overall observed association, a marginal slope may be appropriate. If it concerns the association among observations comparable on specified covariates, a conditional model may be more suitable. Choosing covariates is a substantive decision: the coefficient's conditional meaning depends on which variables are included, and a regression calculation alone does not establish that the adjustment is appropriate for a causal question.
A frequent mistake is to say, “The adjusted coefficient is different from the crude coefficient, so one must be wrong.” That reasoning treats two different summaries as though they estimate an identical quantity. The correction is to name the target for each model, verify the arithmetic, and check the conditional model's assumptions—especially whether a shared slope is reasonable. A second mistake is to interpret \(\hat{\beta}_{1,\mathrm{cond}}\) as the change in outcome caused by changing \(X\). It is an adjusted association unless additional design and causal assumptions justify a causal interpretation.
In applied work, report the units and covariates clearly. For example: “The marginal fitted score difference was 4.2 points per additional practice hour; the slope adjusted for group was 3.0 points per hour under a common-slope model.” This wording makes the comparison intelligible without implying that one is a corrected version of the other. If an interaction is plausible or supported by the subject matter, give the group-specific slopes rather than treating a shared coefficient as universally applicable.
Check Your Understanding
Answer each question by identifying the association or calculation being described.
- In a regression of \(Y\) on \(X\) alone, what does the estimated slope summarize when a relevant group variable \(Z\) is available but not included?
- In the model \(\hat{Y}=\hat{\beta}_0+\hat{\beta}_1X+\hat{\beta}_2Z\), with binary \(Z\), what assumption about the \(X\)-to-\(Y\) slope is imposed?
- Why did the first worked example give marginal and conditional slopes of 4.2 and 3 points per hour, respectively?
- In the third worked example, why does group 1 contribute more to the common conditional slope than group 0?
- If the within-group slopes differ, what question does a common-slope coefficient answer, and what information might it hide?
- Why is it incorrect to call an adjusted regression coefficient a causal effect without further assumptions?