Why Average Treatment Contrasts?
When a regression model includes a treatment-by-baseline interaction, its fitted treatment contrast can vary with the participant’s baseline value. A contrast calculated at one baseline value answers a conditional question: what difference does the model estimate at that value? Often we also want a single summary across a group of participants. To obtain it, predict the outcome under both assignments for each participant, subtract the predictions, and average those differences.
The resulting average is tied to the baseline values over which we average. Averaging over the participants in a trial gives a summary for that trial’s observed baseline distribution. Averaging over a different set of baseline values can give a different summary, even when the fitted regression coefficients are unchanged.
The Model and the Average Fitted Contrast
Let \(T_i\) denote the randomized assignment for participant \(i\), coded 0 for control and 1 for treatment. Let \(X_i\) be a baseline outcome measured before assignment, and let \(Y_i\) be the outcome measured afterward. Consider the linear treatment-by-baseline model
Here, \(\beta_0,\beta_1,\beta_2,\beta_3\) are model coefficients, and \(\varepsilon_i\) is the error for participant \(i\). The model specifies the conditional mean of \(Y_i\) for each assignment and baseline value. For the fitted model, replace the coefficients with their estimates and use the resulting fitted values as predictions.
To interpret the model’s treatment contrast, first hold the baseline value at \(x\). Under control assignment, set \(T_i=0\); under treatment assignment, set \(T_i=1\). The difference between the two fitted conditional means is the fitted treatment contrast at \(x\).
The estimated contrast depends on \(x\) when \(\hat{\beta}_3\) is not zero. The coefficient \(\hat{\beta}_1\) is specifically the fitted contrast at \(X=0\), not automatically the average contrast across participants.
Why the Formula Reduces to a Contrast at the Mean
The calculation starts with a difference for each participant, not with a single prediction at a representative participant. Substituting the model’s fitted contrast into the average gives
This equality follows from the linear form of the fitted contrast and the definition of the sample mean. It does not mean that participant-level predictions can be skipped when the model is more complicated, or when the aim is to average over a different target set of baseline values. In those cases, calculate the two predictions for every value in the intended set, take their differences, and average using the intended weights.
Worked Example: Averaging Contrasts for Three Participants
Suppose a hypothetical trial produces the fitted model \(\widehat{Y}=12+4T+0.60X-0.08(TX)\), where \(Y\) is a symptom score in points and \(X\) is the baseline symptom score in points. Three participants have baseline values 20, 30, and 40 points. Calculate the fitted treatment and control predictions for each participant, then find the sample-average fitted contrast.
Model check and setup. Treatment assignment is coded 0 or 1, and \(X\) is measured before assignment, as required for this baseline adjustment. This example stipulates a fitted linear model; it does not provide raw data with which to assess whether the model form fits adequately. The calculations apply over the stated baseline values.
For a participant with baseline value \(x\), the fitted control prediction is \(12+0.60x\), and the fitted treatment prediction is \(12+4+0.60x-0.08x\). At \(x=20\), these are \(12+0.60(20)=24\) points and \(12+4+0.60(20)-0.08(20)=26.4\) points. The fitted contrast is \(26.4-24=2.4\) points.
At \(x=30\), the control prediction is \(12+0.60(30)=30\) points, and the treatment prediction is \(12+4+0.60(30)-0.08(30)=31.6\) points. The contrast is \(31.6-30=1.6\) points.
At \(x=40\), the control prediction is \(12+0.60(40)=36\) points, and the treatment prediction is \(12+4+0.60(40)-0.08(40)=36.8\) points. The contrast is \(36.8-36=0.8\) points.
The average of the three participant-specific fitted differences is \((2.4+1.6+0.8)/3=1.6\) points. As a check, the mean baseline value is \((20+30+40)/3=30\), so the fitted contrast at that mean is \(4-0.08(30)=1.6\) points. Under this model, the average fitted treatment score is 31.6 points and the average fitted control score is 30 points; their difference is also 1.6 points.
Thus, for these three baseline values, the fitted treatment assignment is associated with a 1.6-point higher symptom score on average than the fitted control assignment. The direction and meaning of a higher score depend on how the outcome scale is defined.
The Baseline Distribution Determines the Average
The interaction makes the estimated contrast vary with baseline value. Therefore, the collection of values being averaged matters. In the sample-average contrast, every participant contributes one contrast, so a baseline value represented by many participants receives more weight than a value represented by only a few participants.
Worked Example: Unequal Numbers at Two Baseline Values
Suppose a hypothetical fitted model has contrast \(\widehat{\tau}(x)=2+0.10x\), where the outcome and baseline are measured in points. Six participants have baseline values 10, 10, 10, 10, 30, and 30. Calculate their predictions under both assignments and average the fitted differences.
Model check and setup. The values are assumed to be pre-assignment baseline measurements and the two assignment predictions come from the same fitted interaction model. All six listed participants receive equal weight. As in any prediction exercise, the stipulated model’s suitability cannot be checked without further data.
At \(x=10\), the fitted contrast is \(2+0.10(10)=3\) points. For each of the four participants with that baseline value, the treatment prediction is 3 points higher than the control prediction. At \(x=30\), the contrast is \(2+0.10(30)=5\) points; each of the two participants at that value has a treatment prediction 5 points higher than the control prediction.
Averaging the six participant-level differences gives \(\{4(3)+2(5)\}/6=(12+10)/6=3.667\) points. The mean baseline value is \(\{4(10)+2(30)\}/6=100/6=16.67\) points. Substitution into the fitted contrast gives \(2+0.10(16.67)=3.667\) points, apart from rounding.
Giving the two distinct baseline values equal weight instead would produce \((3+5)/2=4\) points. That answers a different averaging question: it weights the two baseline levels equally, rather than weighting each of the six participants equally. A reported average should make its target distribution clear.
Choosing the Values to Average Over
A sample average is often a useful summary for the participants whose baseline values were observed. But another question may call for averaging over a specified set of baseline values, such as a set representing a particular target group. The model-based calculation has the same basic form: predict under both assignments at every included value and average the differences using the chosen weights.
For example, if a target set contains \(m\) baseline values \(x_1^*,\ldots,x_m^*\) and gives each equal weight, the average is the mean of the \(m\) fitted contrasts. If the target assigns different weights to different values or groups, use those weights in the average. Changing the baseline distribution can change the average whenever the fitted contrast varies with baseline.
Worked Example: Comparing Two Averaging Distributions
Suppose a hypothetical fitted model gives \(\widehat{\tau}(x)=5-0.05x\) outcome points. One group of three participants has baseline values 20, 40, and 60 points. A separate target set consists of two equally weighted baseline values, 10 and 50 points. Find the average fitted contrast for each set.
Model check and setup. Both sets use baseline values measured before assignment, and the same fitted model is applied to each. The computation assumes the linear model is suitable across the values used; it should not be extrapolated to baseline values far beyond the range that supports the fit.
For the three participants, the fitted contrasts are \(5-0.05(20)=4\), \(5-0.05(40)=3\), and \(5-0.05(60)=2\) points. Their equally weighted average is \((4+3+2)/3=3\) points. Equivalently, their mean baseline is 40 points and \(5-0.05(40)=3\) points.
For the target set, the fitted contrasts are \(5-0.05(10)=4.5\) and \(5-0.05(50)=2.5\) points. Their equally weighted average is \((4.5+2.5)/2=3.5\) points. The two averages differ because the target set has a lower mean baseline value and the fitted contrast decreases as baseline increases.
These are model-based averages for two different baseline distributions, not evidence that the regression coefficients changed. The distinction is important when presenting a single average: identify the participants or target distribution to which it refers.
Assumptions, Interpretation, and a Common Pitfall
The arithmetic of averaging fitted contrasts follows directly from the fitted model. Interpreting that average as a useful treatment-assignment comparison requires care. The outcome model should describe the conditional mean adequately over the baseline values being averaged, including the assumed linear baseline relationship and linear interaction. The baseline variable must be measured before treatment assignment, and the coding of assignment must match the interpretation of 0 and 1. Predictions outside the range of observed baseline values rely on extrapolation and may be unreliable.
In a randomized study, the contrast compares fitted outcomes under the two assigned conditions at the same baseline values. A causal interpretation concerns assignment, under the usual requirements for interpreting randomized comparisons, such as valid randomization and appropriate outcome measurement. The regression calculation by itself does not establish that treatment received, adherence, or a different intervention caused the modeled contrast.
A common mistake is to report \(\hat{\beta}_1\) as the average treatment effect simply because it is the coefficient attached to \(T_i\). In this interaction model, \(\hat{\beta}_1\) is the fitted contrast when \(X=0\). For example, with \(\widehat{\tau}(x)=4-0.08x\) and mean baseline \(30\), the average fitted contrast is \(4-0.08(30)=1.6\), not 4. The value 4 is the model’s contrast at baseline zero. It equals the sample-average contrast only when the average baseline is zero or when the fitted interaction coefficient is zero.
Another mistake is to average contrasts over a few selected baseline values without explaining why those values represent the intended group. The correct operation depends on the question: average across participants for a participant-weighted summary, or use the stated target values and weights for another summary.
Check Your Understanding
Answer each question by referring to the model and the averaging distribution.
- For the fitted model \(\widehat{Y}=8+3T+0.5X-0.04(TX)\), what is the fitted treatment contrast at baseline value \(x=25\)?
- For that same model, a group has mean baseline value 20. What is its sample-average fitted contrast, assuming the model is applied to those participants?
- In a treatment-by-baseline model, what does the treatment coefficient alone represent?
- Why can the average contrast across participants differ from the average of contrasts at distinct baseline levels when those levels receive equal weight?
- What should be stated when reporting an average fitted treatment contrast based on a set of baseline values other than the observed participants’ values?