From a Regression Model to Adjusted Treatment Means
When treatment groups begin with different baseline scores, comparing their unadjusted outcome averages may not answer the intended question. A regression model can instead compare fitted mean outcomes at specified baseline scores. If the model includes a treatment-by-baseline interaction, the fitted treatment difference can vary across the baseline scale. This tutorial works through that calculation, including uncertainty, a results table, and a plot of the fitted profiles.
All data and estimates below are hypothetical. The outcome is a follow-up score, and the baseline score is measured in points. Treatment assignment is coded \(T=0\) for the comparison group and \(T=1\) for the treatment group. Let \(x\) denote baseline score and define \(z=x-50\), so that the baseline score of 50 is the reference point for the intercepts.
For the fitted means and confidence intervals in this example, assume that the conditional mean is correctly represented by this linear model; observations are independent; and the errors have conditional mean zero, constant variance, and a normal distribution. The fitted coefficient estimates are obtained by least squares. Normal errors, together with the other assumptions, justify the usual \(t\)-based confidence intervals. In an application, the score values used for comparison should also be supported by the observed baseline-score ranges in both groups; a model calculation outside those ranges would be extrapolation.
Worked Example: Calculate Means and Their Uncertainty
Worked Example: Calculate Means and Their Uncertainty
Suppose the fitted coefficients are \(\hat{\beta}_0=70\), \(\hat{\beta}_1=0.30\), \(\hat{\beta}_2=2.0\), and \(\hat{\beta}_3=0.10\). The estimated coefficient covariance matrix, in the order \((\hat{\beta}_0,\hat{\beta}_1,\hat{\beta}_2,\hat{\beta}_3)\), is $$ \widehat{\operatorname{Cov}}(\hat{\boldsymbol{\beta}})= \begin{pmatrix} 0.64&0&0&0\\ 0&0.0004&0&0\\ 0&0&1.00&0\\ 0&0&0&0.0016 \end{pmatrix}. $$ For simplicity, this hypothetical example uses zero estimated covariances between the coefficients. Suppose the residual degrees of freedom are \(36\), so the 95% pointwise \(t\) critical value is \(t_{0.975,36}=2.028\). Find the fitted means and their standard errors for both groups at baseline scores 40, 50, and 60.
For the comparison group, \(T=0\), so its fitted mean is \(\hat{\mu}_0(x)=70+0.30z\). For the treatment group, \(T=1\), so its fitted mean is \(\hat{\mu}_1(x)=70+0.30z+2.0+0.10z\). Thus the treatment-group intercept at \(x=50\) is 72, and its slope is 0.40 outcome-score points per baseline-score point.
At baseline 40, \(z=-10\). The fitted means are $$ \hat{\mu}_0(40)=70+0.30(-10)=67,\qquad \hat{\mu}_1(40)=70+0.30(-10)+2.0+0.10(-10)=68. $$ At baseline 50, \(z=0\), giving fitted means 70 and 72. At baseline 60, \(z=10\), giving fitted means 73 and 76.
A fitted mean is a linear combination of the estimated coefficients. Its estimated variance is the corresponding quadratic form using the coefficient covariance matrix. With the zero covariances shown above, the comparison-group variance at \(z\) is \(0.64+z^2(0.0004)\). The treatment-group variance is \(0.64+z^2(0.0004)+1.00+z^2(0.0016)\). Therefore, at baseline 40, the standard errors are $$ SE\{\hat{\mu}_0(40)\}=\sqrt{0.64+100(0.0004)}=\sqrt{0.68}=0.8246, $$ $$ SE\{\hat{\mu}_1(40)\}=\sqrt{0.64+100(0.0004)+1.00+100(0.0016)} =\sqrt{1.84}=1.356. $$ At baseline 50, the standard errors are \(\sqrt{0.64}=0.8000\) and \(\sqrt{1.64}=1.281\). At baseline 60, they are the same as at baseline 40, because the variance expressions depend on \(z^2\).
For example, the 95% confidence interval for the comparison-group mean at baseline 40 is $$ 67\pm 2.028(0.8246)=67\pm1.672=(65.33,\ 68.67). $$ For the treatment-group mean at that baseline, it is $$ 68\pm 2.028(1.356)=68\pm2.751=(65.25,\ 70.75). $$ These are pointwise intervals: each applies to the specified group and baseline score, rather than guaranteeing a particular coverage rate for all six means simultaneously.
Compare the Treatment Profiles
The model’s treatment mean difference at a given baseline score is the treatment-group fitted mean minus the comparison-group fitted mean. Subtracting the two fitted profiles cancels the shared terms:
The estimated difference is 1 outcome-score point at baseline 40, 2 points at baseline 50, and 3 points at baseline 60. The positive interaction estimate means the fitted difference increases by 0.10 outcome-score point for each one-point increase in baseline score. This describes the fitted association in this model; by itself, it does not establish that treatment caused the differences.
Worked Example: Quantify Uncertainty in a Treatment Difference
At baseline 60, calculate a 95% pointwise confidence interval for the fitted treatment-minus-comparison mean difference. Because \(\hat{\Delta}(z)=\hat{\beta}_2+z\hat{\beta}_3\), its estimated variance is $$ \widehat{\operatorname{Var}}\{\hat{\Delta}(z)\} =\widehat{\operatorname{Var}}(\hat{\beta}_2) +z^2\widehat{\operatorname{Var}}(\hat{\beta}_3) +2z\widehat{\operatorname{Cov}}(\hat{\beta}_2,\hat{\beta}_3). $$
At baseline 60, \(z=10\). The covariance is zero in the supplied matrix, so $$ SE\{\hat{\Delta}(10)\}=\sqrt{1.00+10^2(0.0016)}=\sqrt{1.16}=1.077. $$ The estimated difference is \(2.0+0.10(10)=3.0\) points. Its interval is $$ 3.0\pm2.028(1.077)=3.0\pm2.184=(0.816,\ 5.184). $$ Under the model assumptions, this interval gives a range of plausible values for the treatment-minus-comparison difference in conditional mean outcome at baseline 60. It does not describe the range of individual outcomes.
The same calculation at baseline 40 gives a difference of 1 point and standard error \(\sqrt{1.16}=1.077\), so its interval is \((-1.184,\ 3.184)\). At baseline 50, the difference is 2 points and its standard error is \(\sqrt{1.00}=1.000\), giving \((-0.028,\ 4.028)\). These intervals are wide relative to their estimates; they do not establish a clear nonzero difference at all three selected scores.
Present the Fitted Means in a Table
A useful results table keeps the fitted mean, its standard error, and its pointwise confidence interval together, with baseline and outcome units stated. The entries below use the calculations above; values are rounded to three or four significant figures.
Worked Example: Assemble a Results Table
Use the rule \(\hat{\mu}\pm2.028(SE)\) for each row. For example, at baseline 50 the treatment-group interval is \(72\pm2.028(1.281)=(69.40,\ 74.60)\). Applying the same calculation to the other five fitted means gives:
| Treatment group | Baseline score (points) | Fitted mean outcome (points) | SE (points) | 95% pointwise CI for mean (points) |
|---|---|---|---|---|
| Comparison | 40 | 67.00 | 0.8246 | (65.33, 68.67) |
| Comparison | 50 | 70.00 | 0.8000 | (68.38, 71.62) |
| Comparison | 60 | 73.00 | 0.8246 | (71.33, 74.67) |
| Treatment | 40 | 68.00 | 1.356 | (65.25, 70.75) |
| Treatment | 50 | 72.00 | 1.281 | (69.40, 74.60) |
| Treatment | 60 | 76.00 | 1.356 | (73.25, 78.75) |
This table reports adjusted conditional means at specified baseline scores, not averages across all people in either group. In a report, identify the outcome and score units and state that the intervals are pointwise confidence intervals for conditional means.
Plot the Two Fitted Profiles
A plot makes the changing treatment difference easier to see. The grid below places baseline score on the horizontal axis and fitted mean outcome on the vertical axis. “C” marks a comparison-group fitted mean and “T” marks a treatment-group fitted mean. These are the six calculated points; a conventional profile plot would connect the points within each group with straight lines, as specified by this linear model. The table above, rather than this compact point plot, gives the confidence intervals.
| Fitted mean outcome (points) | Baseline 40 | Baseline 50 | Baseline 60 |
|---|---|---|---|
| 76 | T | ||
| 75 | |||
| 74 | |||
| 73 | C | ||
| 72 | T | ||
| 71 | |||
| 70 | C | ||
| 69 | |||
| 68 | T | ||
| 67 | C |
Both fitted profiles rise with baseline score. The treatment profile rises somewhat more steeply, so the vertical separation grows from 1 point at baseline 40 to 3 points at baseline 60. A full plot should label both axes with units and identify the two groups. If confidence intervals are added, make clear whether the bars show uncertainty for each fitted mean or for the treatment differences; those are different quantities.
Why the Calculation and Presentation Matter
An interaction model does not have one treatment difference that applies at every baseline score. It gives a fitted difference as a function of baseline. Reporting only the coefficient \(\hat{\beta}_2=2.0\) without its reference point would be incomplete: here it is the estimated difference specifically at baseline 50, where \(z=0\). At other baseline scores the interaction term changes the comparison.
The uncertainty also belongs to the quantity being reported. A confidence interval for a group’s conditional mean uses the coefficient combination defining that fitted mean. A confidence interval for a treatment difference instead uses the coefficient combination defining the difference, with its own variance. Overlap or non-overlap of two separate mean intervals is not a substitute for calculating an interval for the difference.
Check Your Understanding
Use the fitted model and covariance matrix in the examples above.
- What are the comparison-group and treatment-group slopes in outcome points per baseline-score point?
- At baseline 55, what is \(z\), and what are the two fitted mean outcomes?
- Why does the treatment coefficient alone not give the treatment difference at baseline 60?
- What does the standard error of a fitted conditional mean quantify, and how is it different from variation among individual outcomes?
- In a report, why should a confidence interval for the treatment difference be calculated directly rather than inferred from the two separate group-mean intervals?