Tutorials › Regression Analysis (Undergraduate) › Adjusted Contrasts Among Three Rehabilitation Programs

Integrated Applied Case Studies · Tutorial 974 of 991

Adjusted Contrasts Among Three Rehabilitation Programs

Use a common-slope regression model to estimate program differences at a shared baseline value and quantify uncertainty in each pairwise contrast.

Advanced 10 min read

What You'll Learn

  • Set up a regression model for three programs using reference coding and a baseline covariate.
  • Calculate adjusted fitted means at a clearly specified baseline value.
  • Form all three pairwise program contrasts and identify their signs.
  • Calculate a contrast standard error and confidence interval using coefficient variances and covariance.
  • Re-express the model with a different reference program and verify that the comparisons are unchanged.

Why Compare Adjusted Program Outcomes?

Suppose patients enter one of three rehabilitation programs with different baseline severity. Comparing the programs' raw average outcomes may mix two things: differences in program assignment and differences in who began with more severe symptoms. Regression can describe each program's fitted outcome at the same baseline value, making the comparison explicit. The resulting comparison is an adjusted contrast: a difference between fitted means under a stated model, not automatically proof that one program caused better outcomes.

The key is to compare like with like. We will model a quantitative recovery score using a baseline severity measure and an indicator for program membership. We will use a common baseline slope, so the adjusted difference between programs does not depend on the baseline value at which the fitted means are reported. That assumption is useful for a focused comparison, but it should be considered rather than taken for granted.

Model and Interpretation

Let \(Y_i\) be patient \(i\)'s recovery score at follow-up, with higher values indicating better recovery. Let \(x_i\) be that patient's baseline severity score, and let \(z_i=x_i-50\), so that \(z_i=0\) corresponds to a baseline score of 50. Let programs A, B, and C be the three possible program assignments. Taking A as the reference program, define \(I_{Bi}=1\) for a patient in B and 0 otherwise, and define \(I_{Ci}\) similarly for C.

Model: The common-slope reference-coded regression model is
$$ Y_i=\beta_0+\beta_1 z_i+\beta_B I_{Bi}+\beta_C I_{Ci}+\varepsilon_i. $$
Here \(\beta_0\) is the fitted mean recovery score for program A at baseline severity 50; \(\beta_1\) is the change in fitted mean score per one-point increase in baseline severity, shared by all three programs; \(\beta_B\) is the adjusted difference B minus A; and \(\beta_C\) is the adjusted difference C minus A. The model sets both indicators to zero for program A.

For a patient with baseline value \(x^*\), the fitted means are obtained by inserting \(z^*=x^*-50\) and the relevant program indicators. In particular, the fitted means for A, B, and C are \(\beta_0+\beta_1z^*\), \(\beta_0+\beta_1z^*+\beta_B\), and \(\beta_0+\beta_1z^*+\beta_C\). Subtracting these expressions gives the pairwise contrasts:

$$ B-A=\beta_B,\qquad C-A=\beta_C,\qquad B-C=\beta_B-\beta_C. $$

These differences are constant across baseline values because the model has a common slope and no program-by-baseline interaction. That is a model property, not a general fact about rehabilitation outcomes.

Assumptions for the Comparisons

The regression describes the conditional mean of the outcome as a straight-line function of baseline severity within each program, with the same slope in each program. The errors have mean zero given the predictors, are independent across patients, and have constant variance. For the usual exact small-sample \(t\)-based confidence intervals and tests, the errors are also assumed normally distributed. The data must contain patients from each program across a useful shared range of baseline severity; otherwise, fitted means at a common value may rely on extrapolation.

The common-slope form is especially important here. If program differences change with baseline severity, a single adjusted contrast cannot summarize the difference at every baseline value. Also, adjustment alone does not establish causation. A causal interpretation requires a suitable study design and additional conditions; in an observational comparison, unmeasured differences between patients may remain.

Worked Example: Fitted Means at a Shared Baseline

Consider a hypothetical analysis with recovery score measured in points and baseline severity measured on a 0-to-100 scale. The fitted model, with A as reference and baseline centered at 50, is

$$ \widehat{Y}=68+0.40(x-50)+5I_B+2I_C. $$

The study team has patients from all three programs near baseline 50, so this comparison does not require extrapolating beyond the observed range. At \(x=50\), the centered baseline value is \(50-50=0\). The adjusted fitted mean for program A is

$$ \widehat{Y}_A=68+0.40(0)=68\text{ points}. $$

For B, the B indicator is 1 and the C indicator is 0:

$$ \widehat{Y}_B=68+0.40(0)+5(1)+2(0)=73\text{ points}. $$

For C, the indicators are 0 and 1:

$$ \widehat{Y}_C=68+0.40(0)+5(0)+2(1)=70\text{ points}. $$

Thus, at baseline severity 50, the fitted adjusted contrasts are B minus A \(=73-68=5\) points, C minus A \(=70-68=2\) points, and B minus C \(=73-70=3\) points. These are fitted comparisons for patients with the same stated baseline value, according to this model.

The common slope also illustrates why these differences do not change at other baseline values. At baseline 55, for example, the fitted means are \(68+0.40(5)=70\) for A, \(75\) for B, and \(72\) for C. The three pairwise differences are still 5, 2, and 3 points.

Uncertainty for a Pairwise Contrast

A contrast estimate has sampling uncertainty because the regression coefficients are estimated from data. Its standard error depends on the variances of the coefficients involved and, when a contrast combines coefficients, their covariance. For a linear combination \(a\hat{\beta}_B+b\hat{\beta}_C\), its estimated variance is

$$ \widehat{\operatorname{Var}}(a\hat{\beta}_B+b\hat{\beta}_C) =a^2\widehat{\operatorname{Var}}(\hat{\beta}_B) +b^2\widehat{\operatorname{Var}}(\hat{\beta}_C) +2ab\widehat{\operatorname{Cov}}(\hat{\beta}_B,\hat{\beta}_C). $$

For a 95% confidence interval using the usual regression \(t\) procedure, the estimate is paired with its standard error and the appropriate \(t\) critical value with residual degrees of freedom \(df\). The interval describes uncertainty in the population contrast under the model and its assumptions. It is not a statement that there is a 95% probability that a fixed parameter lies in this particular calculated interval.

Worked Example: Uncertainty for All Three Comparisons

Suppose the hypothetical regression has \(df=54\), and its estimated covariance matrix for the two program coefficients is

$$ \widehat{\operatorname{Var}} \begin{pmatrix}\hat{\beta}_B\\\hat{\beta}_C\end{pmatrix} = \begin{pmatrix}0.90&0.30\\0.30&1.00\end{pmatrix}. $$

The diagonal entries give \(SE(\hat{\beta}_B)=\sqrt{0.90}=0.949\) points and \(SE(\hat{\beta}_C)=\sqrt{1.00}=1.00\) point. The off-diagonal entry is the estimated covariance; it must be included for the B-versus-C contrast. Using the fitted differences from the previous example:

B minus A. The estimate is 5 points, and its standard error is 0.949 points. With \(t^*=2.005\) for a two-sided 95% interval with 54 degrees of freedom, the interval is

$$ 5\pm 2.005(0.949)=5\pm1.903=(3.097,\ 6.903)\text{ points}. $$

C minus A. The estimate is 2 points, with standard error 1.00 point. Its interval is

$$ 2\pm2.005(1.00)=(-0.005,\ 4.005)\text{ points}. $$

B minus C. The estimate is \(\hat{\beta}_B-\hat{\beta}_C=5-2=3\) points. Its estimated variance is

$$ 0.90+1.00-2(0.30)=1.30, \qquad SE(\hat{\beta}_B-\hat{\beta}_C)=\sqrt{1.30}=1.140\text{ points}. $$

The corresponding 95% interval is

$$ 3\pm2.005(1.140)=3\pm2.286=(0.714,\ 5.286)\text{ points}. $$

For example, the test of \(H_0:\beta_C=0\) against \(H_a:\beta_C\ne0\) has \(t=2/1.00=2.00\), with 54 degrees of freedom and a two-sided \(p\)-value of about 0.051. At \(\alpha=0.05\), this comparison does not meet the conventional significance threshold. That result is consistent with its interval, which includes zero. The B-minus-C interval excludes zero, suggesting a positive difference under the model, while the B-minus-A interval also excludes zero.

These are separate 95% intervals for three contrasts. They do not, by themselves, guarantee 95% simultaneous coverage of all three differences. Interpret the estimates, intervals, and tests as comparisons in the specified model, not as unadjusted raw group differences.

Changing the Reference Program

A reference category is a coding choice. It determines which program's fitted mean is represented by the intercept and which differences appear directly as coefficients. It does not determine which pairwise comparisons are scientifically meaningful. To see this, take C rather than A as the reference. Write the model as

$$ Y_i=\alpha_0+\alpha_1z_i+\alpha_A I_{Ai}+\alpha_B I_{Bi}+\varepsilon_i. $$

Now \(\alpha_0\) is the fitted mean for C at baseline 50; \(\alpha_A\) is A minus C, and \(\alpha_B\) is B minus C. From the first coding, the coefficient values transform as follows:

$$ \hat{\alpha}_0=68+2=70,\qquad \hat{\alpha}_A=-2,\qquad \hat{\alpha}_B=5-2=3. $$

The intercept changes from 68 to 70, and the displayed program coefficients change from 5 and 2 to -2 and 3. But the comparisons are recovered directly: B minus C is \(\hat{\alpha}_B=3\), C minus A is \(-\hat{\alpha}_A=2\), and B minus A is \(\hat{\alpha}_B-\hat{\alpha}_A=3-(-2)=5\) points.

Worked Example: Verifying a Contrast After Recoding

Use the same covariance information as before. Under the C-reference coding, the B-minus-C coefficient is \(\hat{\alpha}_B=\hat{\beta}_B-\hat{\beta}_C\), so its variance remains

$$ \widehat{\operatorname{Var}}(\hat{\alpha}_B) =0.90+1.00-2(0.30)=1.30. $$

Its standard error is therefore \(\sqrt{1.30}=1.140\) points, exactly as before. For B minus A, the recoded contrast is \(\hat{\alpha}_B-\hat{\alpha}_A\). Since \(\hat{\alpha}_A=-\hat{\beta}_C\), the contrast equals \(\hat{\beta}_B\). Its estimate is 5 points and its standard error is \(\sqrt{0.90}=0.949\) points, also unchanged. The numerical coefficient labels and their covariance entries may change under recoding, but a given fitted contrast and its uncertainty do not.

Common Pitfalls and Why the Details Matter

  • Reading each coefficient as a comparison with every other program. With A as the reference, \(\beta_B\) is B minus A, not B minus C. Calculate B minus C as \(\beta_B-\beta_C\).
  • Ignoring covariance when subtracting coefficients. The variance of a difference includes \(-2\widehat{\operatorname{Cov}}(\hat{\beta}_B,\hat{\beta}_C)\). Adding the two variances alone gives the wrong standard error unless the covariance is zero.
  • Calling adjusted means raw averages. They are model-based fitted means at a specified baseline value, not necessarily the observed average score in each program.
  • Assuming adjustment proves a treatment effect. Regression adjustment describes a conditional association. Causal conclusions require suitable design and assumptions beyond the fitted equation.
  • Changing the reference and thinking the result changed. Individual coefficient values depend on coding, but correctly formed comparisons between the same two programs remain the same.

Adjusted contrasts are useful because they express program differences in outcome units, at a shared baseline value, with uncertainty attached. A clear report states which subtraction is being made, the covariate value used for fitted means, the model assumptions relevant to that comparison, and the interval or test result. That makes the direction, size, and precision of each comparison interpretable without confusing coding choices with substantive conclusions.

Check Your Understanding

Use the common-slope model and the hypothetical estimates in this tutorial.

  1. At baseline severity 60, what are the fitted means for programs A, B, and C? What are the three pairwise contrasts?
  2. With A as the reference, which coefficient gives B minus A, and how do you calculate B minus C?
  3. Why does the variance of \(\hat{\beta}_B-\hat{\beta}_C\) include a covariance term?
  4. Under C-reference coding, what does the coefficient of \(I_A\) represent, and what is its value in the hypothetical example?
  5. Does a 95% interval for one contrast provide 95% simultaneous coverage for all three pairwise contrasts? Explain briefly.