Tutorials › Regression Analysis (Undergraduate) › Nonlinear Baseline Adjustment

Regression in Randomized Studies · Tutorial 903 of 991

Nonlinear Baseline Adjustment

See how a curved baseline–outcome relationship can be represented in ANCOVA without making the treatment effect vary across baseline values.

Intermediate 9 min read

What You'll Learn

  • Write an ANCOVA model with a centered baseline outcome and its square
  • Interpret the quadratic term as curvature in the baseline–outcome relationship
  • Calculate fitted outcomes for each treatment assignment at selected baseline values
  • Explain why a quadratic baseline term does not by itself create treatment-effect variation
  • Compare predictions from quadratic and straight-line baseline specifications
  • Recognize when a quadratic adjustment is useful and what it cannot establish

Why Allow a Curved Baseline Relationship?

ANCOVA adjusts a post-treatment outcome for a measurement of the same outcome taken before treatment. A straight-line adjustment assumes that the expected follow-up outcome changes by the same amount for each one-unit increase in baseline, across the full baseline range. That can be a useful approximation, but it may be too restrictive. For example, follow-up scores might rise quickly across the lower baseline range and then rise more slowly among participants who began with high scores.

A quadratic baseline term allows this relationship to bend while retaining a common treatment effect. The key distinction is that the curve describes how baseline relates to the expected outcome; unless a treatment-by-baseline interaction is included, the model still assigns the same treatment contrast at every baseline value.

Definition: Let \(T_i\) equal 1 for a participant assigned to treatment and 0 for a participant assigned to control. Let \(B_i\) be that participant’s baseline outcome and \(Y_i\) the follow-up outcome. A quadratic-baseline ANCOVA model is $$ Y_i=\beta_0+\beta_1T_i+\beta_2(B_i-c)+\beta_3(B_i-c)^2+\varepsilon_i, $$ where \(c\) is a chosen centering value, often the sample mean baseline outcome. The squared baseline term allows curvature in the expected follow-up outcome. The model has no treatment-by-baseline interaction, so its treatment contrast is constant across baseline values.

The fitted coefficients are estimated by ordinary least squares: the procedure chooses coefficient estimates that minimize the sum of squared differences between observed follow-up outcomes and fitted outcomes. Centering baseline makes the model easier to interpret and can make calculations more manageable. It does not change the fitted predictions when the model includes the intercept, linear baseline term, and squared baseline term.

For a standard interpretation of regression estimates, baseline must be measured before assignment, and the model should represent the conditional mean reasonably well over the baseline range being analyzed. The usual independent-error and constant-variance assumptions support conventional standard errors; normally distributed errors are additionally used for exact small-sample \(t\)- and \(F\)-inference. Random assignment supports comparing assigned groups, while the regression model adjusts for baseline. A quadratic term cannot compensate for serious outcome missingness or a model that poorly represents the data.

Predictions and the Treatment Contrast

For a participant with baseline value \(B=b\), the fitted control outcome is found by setting \(T=0\), and the fitted treatment outcome by setting \(T=1\). In both predictions, the baseline terms are the same. Subtracting the control prediction from the treatment prediction gives the model’s adjusted treatment contrast.

$$ \begin{aligned} \widehat{Y}_{\text{control}}(b) &=\hat{\beta}_0+\hat{\beta}_2(b-c)+\hat{\beta}_3(b-c)^2,\\ \widehat{Y}_{\text{treatment}}(b) &=\hat{\beta}_0+\hat{\beta}_1+\hat{\beta}_2(b-c)+\hat{\beta}_3(b-c)^2,\\ \widehat{Y}_{\text{treatment}}(b)-\widehat{Y}_{\text{control}}(b) &=\hat{\beta}_1. \end{aligned} $$

This subtraction is also a short justification of an important interpretation: the quadratic baseline term changes the predicted outcomes in both groups, but it does not make their difference depend on baseline. For a common set of baseline values, averaging the two sets of predictions also gives a difference of \(\hat{\beta}_1\), because the shared baseline terms cancel at every value.

These are model-based adjusted predictions, not guarantees about any particular person’s outcome. A prediction at a baseline value outside the range observed in the trial requires extrapolation and may be unreliable. Interpret predictions primarily over baseline values represented in the data.

Worked Example: Fitting and Reading a Quadratic ANCOVA Model

Suppose a hypothetical randomized study records a baseline test score and a follow-up score, both measured in points from 0 to 100. There are 120 participants, with baseline scores centered at \(c=50\). A quadratic ANCOVA fit gives the following illustrative coefficients:

$$ \widehat{Y}_i=48.0+3.0T_i+0.50(B_i-50)-0.012(B_i-50)^2. $$

The fitted coefficient on treatment assignment is 3.0 points. Because there is no treatment-by-baseline interaction, the model’s adjusted treatment-minus-control contrast is 3.0 points at every baseline score. The linear baseline coefficient is 0.50 points per baseline point at \(B=50\): it is the local slope of the fitted baseline relationship at the centering value. The quadratic coefficient, \(-0.012\), is in follow-up-score points per squared baseline point. Its negative sign indicates a concave-down fitted curve.

At a baseline score of 30, \(B-50=-20\), so the squared centered value is 400. The predicted control score is

$$ 48.0+0.50(-20)-0.012(400)=48.0-10.0-4.8=33.2\text{ points}. $$

The treatment prediction is \(33.2+3.0=36.2\) points. At a baseline score of 70, \(B-50=20\), and the control prediction is

$$ 48.0+0.50(20)-0.012(400)=48.0+10.0-4.8=53.2\text{ points}. $$

The treatment prediction at 70 is 56.2 points. At both baseline values, the treatment prediction exceeds the control prediction by 3.0 points. These figures illustrate what the fitted model says; they do not show that the quadratic model is necessarily preferable to a straight-line model.

Comparing Quadratic and Straight-Line Specifications

The straight-line ANCOVA specification omits the squared baseline term:

$$ Y_i=\beta_0+\beta_1T_i+\beta_2(B_i-c)+\varepsilon_i. $$

The two specifications can produce different fitted baseline patterns, predictions, and treatment estimates. They should be compared using the observed data and the purpose of the analysis, rather than assuming that adding a squared term must improve the analysis. A quadratic curve can represent a simple form of curvature, but it may still be a poor description of the relationship, especially if the data are sparse near the ends of the baseline range.

Worked Example: Comparing Predictions From Two Specifications

For the hypothetical study above, suppose a separate straight-line ANCOVA fit gives

$$ \widehat{Y}_i=47.6+2.8T_i+0.42(B_i-50). $$

At a baseline score of 30, the straight-line control prediction is

$$ 47.6+0.42(-20)=47.6-8.4=39.2\text{ points}. $$

Its treatment prediction is \(39.2+2.8=42.0\) points. The quadratic model instead predicts 33.2 points for control and 36.2 points for treatment at the same baseline. At a baseline score of 70, the straight-line predictions are \(47.6+0.42(20)=56.0\) points for control and 58.8 points for treatment. The quadratic predictions at that score are 53.2 and 56.2 points.

The difference between the two models’ predictions is not the same at all baseline values: the quadratic model bends, whereas the straight-line model does not. Their estimated treatment contrasts also differ slightly, 3.0 versus 2.8 points. Because these are estimates from separate fitted models, neither value should be treated as known without uncertainty. The example shows why model choice can affect the adjusted estimate and predictions; it does not establish which specification better describes any actual study.

Worked Example: Interpreting Centering and the Curvature

Use the quadratic fit \(\widehat{Y}=48.0+3.0T+0.50(B-50)-0.012(B-50)^2\). To see the role of centering, expand its baseline component:

$$ 0.50(B-50)-0.012(B-50)^2 =0.50B-25-0.012(B^2-100B+2500) =-0.012B^2+1.70B-55. $$

Thus the same fitted prediction can be written as \(\widehat{Y}=-7.0+3.0T+1.70B-0.012B^2\). For example, at \(T=0\) and \(B=50\), this expanded form gives \(-7.0+1.70(50)-0.012(2500)=-7.0+85.0-30.0=48.0\) points, the same prediction as the centered form.

In the centered form, the coefficient 0.50 has a useful interpretation: it is the slope of the fitted baseline curve at \(B=50\). The slope at any \(B\) is \(0.50-0.024(B-50)\), so it is 0.98 points per baseline point at \(B=30\) and 0.02 at \(B=70\). The curvature is the same throughout the range: the second derivative is \(2(-0.012)=-0.024\). Centering changes the coefficient representation, not the underlying curve or predictions.

When the Quadratic Adjustment Is Useful

A quadratic term is useful when a straight-line baseline relationship is not an adequate summary and a simple curved relationship is plausible over the observed range. It may be motivated by subject-matter knowledge or by inspection of the baseline–outcome pattern. Compare fitted predictions over meaningful baseline values, and consider whether the curvature is supported by the data rather than driven by a few observations. The squared term should not be used to justify extrapolating far beyond observed baseline scores.

Because the quadratic model adds a coefficient, its in-sample fit will not be worse than that of the otherwise identical straight-line model: ordinary least squares can set the squared-term coefficient to zero and recover the straight-line fit. But a better in-sample fit alone does not guarantee more trustworthy predictions or a better adjusted treatment estimate. The added complexity should be weighed against whether the curvature is substantively plausible and whether the available observations support estimating it.

A quadratic baseline term is also not evidence that treatment effects differ by baseline score. In the model used here, the treatment contrast remains \(\beta_1\). A model that allows the treatment contrast to vary across baseline values requires a treatment-by-baseline interaction, a different question from allowing the baseline–outcome relationship to curve.

Common Mistakes

  • Calling the squared term a changing treatment effect. The term \((B_i-c)^2\) changes the baseline adjustment shared by both groups. Without a treatment interaction, their predicted difference is still \(\hat{\beta}_1\).
  • Interpreting \(\hat{\beta}_2\) as the slope everywhere. In a quadratic model, the slope depends on baseline. At \(B=c\), it is \(\hat{\beta}_2\); elsewhere it is \(\hat{\beta}_2+2\hat{\beta}_3(B-c)\).
  • Assuming a quadratic model is automatically better. The additional term can improve in-sample fit, but that alone does not establish that the curve is a useful description or that its treatment estimate is preferable.
  • Using the model far outside the observed baseline range. A quadratic curve can bend sharply as it is extrapolated. Predictions beyond the data require particular caution.
Key takeaway: A quadratic ANCOVA adds a squared baseline term to allow curvature in the relationship between baseline and follow-up outcomes. Calculate predictions by inserting the same baseline value for each treatment assignment. With no treatment-by-baseline interaction, the adjusted treatment contrast is constant, even though the baseline adjustment is nonlinear.

Check Your Understanding

Try these questions before moving on.

  1. In a quadratic ANCOVA model with \(T=0\) for control and \(T=1\) for treatment, what is the fitted treatment-minus-control contrast at baseline \(B=b\)? Explain why it does not depend on \(b\).
  2. For \(\widehat{Y}=40+2T+0.6(B-25)-0.01(B-25)^2\), calculate the control and treatment predictions at \(B=35\).
  3. What does centering baseline at \(c\) make the linear baseline coefficient represent in a quadratic model?
  4. Explain why a negative squared-term coefficient does not, by itself, imply that the treatment effect becomes smaller at higher baseline values.
  5. Give one reason why a quadratic model’s improved in-sample fit does not automatically make it the better analysis.