Why Predict for Both Groups at the Same Value?
A group difference can depend on what is being held fixed. For example, a fitted outcome might differ between two groups partly because the groups tend to have different values of a numeric predictor. To focus on the model’s comparison between the groups at one particular value of that predictor, calculate a fitted outcome for each group while keeping the numeric value unchanged.
This is a direct use of an additive regression equation. The task is to substitute the specified predictor value and the two possible values of a zero-one indicator, then interpret the results in the outcome’s units. The predictions describe fitted outcomes under the model; they are not necessarily the outcomes that particular individuals will have.
The Model and Its Conditions
Let \(Y_i\) be a quantitative outcome for observation \(i\), let \(x_i\) be a numeric predictor, and let \(G_i\) be a binary group indicator. Suppose the model includes an intercept, the numeric predictor, and the indicator, with no interaction between them.
The model’s additive form means that the numeric predictor has the same fitted slope for both groups: changing \(x\) by one unit changes the fitted outcome by \(\hat{\beta}_1\), whichever value \(G\) has. The group difference is represented by the indicator term. There is no \(xG\) term allowing that difference to change with \(x\).
For this comparison to have the intended meaning, the indicator must be coded consistently, the numeric value must be expressed in the units used to fit the model, and the two predictions must use the same value of \(x\). The linear additive form must be suitable for the range under discussion. In the population model, the usual conditional-mean assumption is \(E(\varepsilon_i\mid x_i,G_i)=0\), where \(\varepsilon_i\) is the error. A probability distribution for the errors is not needed just to substitute values into a fitted equation. Whether the model and its estimates are adequate is a separate question from doing the arithmetic.
Calculate the Two Fitted Outcomes
At a fixed value \(x=x_0\), substitute \(G=0\) to obtain the reference group’s fitted outcome. Then substitute \(G=1\), keeping \(x=x_0\), to obtain the other group’s fitted outcome.
The subscript on \(\hat{y}_0\) or \(\hat{y}_1\) identifies the indicator value, not a different value of the numeric predictor. Both fitted outcomes use the same \(x_0\). Their difference is
This cancellation is a consequence of the model’s additive form: the intercept and numeric-predictor contribution are identical in the two predictions, leaving the indicator contribution. Thus, in this model, the fitted difference at the fixed numeric value equals the estimated indicator coefficient. The calculation also displays the two fitted outcomes themselves, which can be more informative than reporting only a difference.
Worked Example: Study Time and a Binary Group
Suppose a hypothetical model predicts quiz score in points from study time in hours and an indicator for attending a review session. The indicator is \(G=0\) for students who did not attend and \(G=1\) for students who attended. The fitted equation is \[ \hat{y}=42+3.5x+5G. \] Calculate and compare fitted quiz scores at \(x=4\) hours.
Check the setup. The question gives one numeric predictor and a zero-one group indicator, and the fitted equation contains no interaction term. We use the same study time, 4 hours, for both groups. The comparison is therefore the one described by this additive model.
For students who did not attend, use \(G=0\): \[ \hat{y}_0=42+3.5(4)+5(0)=42+14+0=56. \] The fitted quiz score is 56 points.
For students who attended, use \(G=1\): \[ \hat{y}_1=42+3.5(4)+5(1)=42+14+5=61. \] The fitted quiz score is 61 points.
At four hours of study, the fitted score for students who attended is 5 points higher than the fitted score for students who did not attend: \(61-56=5\) points. These are model-based fitted outcomes, not claims that every student in either group will score exactly that amount. The comparison is conditional on the stated study time and model.
Reading the Predictions in Context
A prediction is meaningful only when its units and conditions are clear. In the example, 56 and 61 are fitted quiz scores in points, both at four hours of study. Saying simply “the predictions are 56 and 61” omits what is being predicted and which group each number describes.
Also distinguish a fitted conditional mean from an observed outcome. The equation gives the outcome predicted by the fitted model for specified predictor values. An individual with those values may have a different observed score because outcomes vary around the model’s conditional mean. A fitted value does not say that the group label itself caused the outcome to change.
Worked Example: A Negative Group Difference
A hypothetical model predicts daily symptom score, measured in points, from age in years and an indicator for a treatment group. Let \(G=0\) represent the comparison group and \(G=1\) the treatment group. The fitted equation is \[ \hat{y}=18+0.20x-2.4G. \] Calculate fitted scores for both groups at age 50.
Check the setup. The fitted equation is additive, the group is coded zero or one as described, and both predictions will use age 50 years. The coefficient estimates are taken as given; this calculation does not independently establish whether the model is an adequate description of outcomes.
For the comparison group, substitute \(x=50\) and \(G=0\): \[ \hat{y}_0=18+0.20(50)-2.4(0)=18+10=28. \] The fitted symptom score is 28 points.
For the treatment group, substitute \(x=50\) and \(G=1\): \[ \hat{y}_1=18+0.20(50)-2.4(1)=18+10-2.4=25.6. \] The fitted symptom score is 25.6 points.
At age 50, the fitted score for the treatment group is 2.4 points lower: \(25.6-28=-2.4\) points. The negative sign indicates the direction of the fitted difference for \(G=1\) relative to \(G=0\); it does not mean that either fitted score is negative. This is an association described by the fitted model, not by itself evidence of a causal treatment effect.
Keeping Other Predictors Fixed
An additive model may contain more than one numeric predictor. The same comparison works when the other predictors are held at specified values in both calculations. Each shared predictor contributes the same amount to both fitted outcomes, while the indicator changes from zero to one.
Worked Example: Two Numeric Predictors and a Group Indicator
A hypothetical model predicts monthly energy use in kilowatt-hours from floor area \(x\), measured in hundreds of square feet, a temperature measure \(z\), measured in degrees, and an indicator \(G\) for building type. Here \(G=0\) denotes type A and \(G=1\) denotes type B. The fitted equation is \[ \hat{y}=120+18x-2z+35G. \] Calculate fitted use for each building type when \(x=10\) and \(z=15\).
Check the setup. The equation includes no interactions, and both comparisons use the same floor area and temperature value. The predictor values use the specified units, so they can be substituted directly.
For type A, \(G=0\): \[ \hat{y}_0=120+18(10)-2(15)+35(0) =120+180-30+0=270. \] The fitted monthly use is 270 kilowatt-hours.
For type B, \(G=1\): \[ \hat{y}_1=120+18(10)-2(15)+35(1) =120+180-30+35=305. \] The fitted monthly use is 305 kilowatt-hours.
At the stated floor area and temperature, the model’s fitted use for type B is 35 kilowatt-hours higher than for type A. Both shared predictor contributions, \(18(10)\) and \(-2(15)\), appear in both calculations. Only the indicator term changes.
A Short Justification and a Common Pitfall
The comparison can be justified directly by writing out the conditional means. With \(G=0\), the mean is \(\beta_0+\beta_1x_0\). With \(G=1\), it is \(\beta_0+\beta_1x_0+\beta_2\). Subtracting the first expression from the second cancels the terms that are common to both groups, so the difference is \(\beta_2\). Replacing the unknown coefficients with their estimates gives the corresponding difference between fitted outcomes, \(\hat{\beta}_2\).
This equality depends on comparing the groups at the same numeric predictor value and on having no interaction between the indicator and that predictor. If the equation included an interaction term, the indicator-group difference could depend on \(x\); the simple equality to a constant indicator coefficient would no longer apply. Always inspect the stated equation before using this shortcut.
- Wrong reasoning: “The indicator coefficient is 5, so the fitted outcome for the \(G=1\) group is 5.” This mistakes the indicator contribution for the entire prediction.
- Correction: Substitute all predictor values into the fitted equation. The intercept and numeric-predictor terms contribute to the fitted outcome too; the indicator coefficient is only the added group contribution when \(G=1\).
- Wrong reasoning: “The two groups’ predictions differ by the indicator coefficient even if their numeric predictor values are different.”
- Correction: First set the numeric predictor to the same specified value in both calculations. If the values differ, the comparison also reflects a change in the numeric-predictor contribution.
Check Your Understanding
For each question, keep track of the group coding, the predictor values, and the outcome units.
- A fitted equation is \(\hat{y}=10+2x+3G\), where \(G=0\) is group A and \(G=1\) is group B. Calculate both fitted outcomes at \(x=6\), and state the fitted difference.
- In the equation \(\hat{y}=30-0.5x-4G\), what does the sign of the indicator contribution imply about group \(G=1\) at a fixed \(x\)?
- Why must \(x\) be kept at the same value when the goal is to compare the fitted groups at that value?
- A model has an indicator coefficient of 8, but the fitted outcome for \(G=0\) at a specified predictor value is 42. What is the fitted outcome for \(G=1\) under the stated additive model?
- Does a fitted outcome of 61 mean every individual with those predictor values will have an observed outcome of 61? Explain briefly.