Treatment-by-Time Interaction: Which Coefficient Is the Treatment Effect?

Clinical Epidemiology ResearchMethodology and Research DesignUniqcret doctor knowledges
Treatment-by-Time Interaction: Which Coefficient Is the Treatment Effect?
On this page

อ่านฉบับภาษาไทย (Thai version)

Abstract

In a repeated-measures regression that holds treatment, time and a treatment-by-time interaction, the treatment main-effect coefficient β1 is the treatment effect at the reference time, not an average over visits and not the effect at the final visit. With baseline as the reference time and control coded 0, the time and interaction terms are zero at baseline, so β1 is the treatment-control difference at baseline. The interaction β3 is how much that difference changes by follow-up: with β1 = 2 and β3 = 3, the effect is 2 at baseline and 2 + 3 = 5 at follow-up. The time coefficient β2 is the change over time in the control group. Remove the interaction and β1 becomes one common treatment effect across visits, because the model forces parallel trajectories. This article derives each coefficient from the group means, maps all four, corrects three common misreadings and closes on one rule: no interaction, one common effect; interaction present, the main effect is conditional on the reference level.


Visual summary. No interaction: one common effect. Interaction present: the main effect is conditional on the reference level.

One coefficient, three readings

A trial team is checking the statistical analysis plan of a randomised trial. Each participant's outcome is measured at baseline, before the first dose, and again at follow-up. The plan fits a repeated-measures regression with three terms: treatment, visit time and a treatment-by-time interaction, with baseline coded as the reference time and control coded 0. Treatment and time are the model's main effects; the interaction is their product.

The team has to write one sentence on what the treatment main-effect coefficient means. One member reads it as the average treatment effect across all visits. Another reads it as the treatment effect at the final visit. A third says it is the change over time in the control group.

None of the three is right. In this parameterisation the treatment main-effect coefficient is the treatment effect at the reference time: the treatment-control difference at baseline.

The key is not simply recognising the words "repeated measures". The decisive feature is the presence of a treatment-by-time interaction, a term that lets the treatment-control difference change from visit to visit.

Start with the regression model

Suppose the model is

$$Y_{ij} = \beta_0 + \beta_1(\text{Treatment}) + \beta_2(\text{Time}) + \beta_3(\text{Treatment}\times\text{Time})$$

where:

The reference value (or reference level) of a variable is the value coded 0, the one every other value is compared with. With one follow-up visit, Time is 0 at baseline and 1 at follow-up, so the product Treatment × Time is 1 only for the treatment group at follow-up.

The meaning of each coefficient depends on the coding of the other variables [1].

Why the treatment coefficient is the baseline difference

At baseline, Time is at its reference level. Therefore the time term and the treatment-by-time interaction are both zero, and only $\beta_0$ and $\beta_1$ remain.

  1. Control group at baseline

    \[ Y_{\text{control, baseline}} = \beta_0 \]

    Treatment = 0 and Time is at its reference, so every term except the intercept drops out.

  2. Treatment group at baseline

    \[ Y_{\text{treatment, baseline}} = \beta_0 + \beta_1 \]

    Treatment = 1 adds $\beta_1$; the time term and the interaction are still zero.

  3. Subtract the two

    \[ Y_{\text{treatment, baseline}} - Y_{\text{control, baseline}} = \beta_1 \]

    The difference between the groups at baseline is $\beta_1$ alone.

Result: $\boxed{\beta_1 = \text{treatment effect at the reference time}}$. Since baseline is the reference time here, $\beta_1$ is the treatment effect at baseline.

What the interaction coefficient means

The interaction coefficient, $\beta_3$, tells us whether the treatment effect changes over time. Suppose there is one follow-up visit.

At baseline:

$$\text{Treatment effect} = \beta_1$$

At follow-up:

$$\text{Treatment effect} = \beta_1 + \beta_3$$

(At follow-up Time = 1, so the control group mean is $\beta_0 + \beta_2$ and the treatment group mean is $\beta_0 + \beta_1 + \beta_2 + \beta_3$.)

Thus $\beta_3$ is the amount by which the treatment-control difference at follow-up differs from the treatment-control difference at baseline.

Example: an effect of 2 at baseline and 5 at follow-up

For example, suppose $\beta_1 = 2$ and $\beta_3 = 3$.

  1. Treatment effect at baseline

    \[ \beta_1 = 2 \]

    At the reference time the treatment effect is the treatment coefficient alone.

  2. Treatment effect at follow-up

    \[ \beta_1 + \beta_3 = 2 + 3 = 5 \]

    At follow-up the interaction adds 3 to the baseline effect of 2.

Result: The treatment effect is 2 at baseline and 5 at follow-up. The treatment effect is therefore not assumed to be constant across time.

What if the treatment-by-time interaction is absent?

This is the critical follow-up question. Suppose instead that the model is

$$Y_{ij} = \beta_0 + \beta_1(\text{Treatment}) + \beta_2(\text{Time})$$

There is now no treatment-by-time interaction. This model assumes that the treatment-control difference is the same at every visit. Consider baseline and one follow-up visit.

Group means without the interaction

Notice that the treatment-control difference is always $\beta_1$.
TimeControlTreatmentTreatment − Control
Baseline$\beta_0$$\beta_0 + \beta_1$$\beta_1$
Follow-up$\beta_0 + \beta_2$$\beta_0 + \beta_1 + \beta_2$$\beta_1$

With versus without the interaction

The distinction worth memorising. T stands for Treatment.
AspectModel without interactionModel with interaction
Model$Y = \beta_0 + \beta_1 T + \beta_2\,\text{Time}$$Y = \beta_0 + \beta_1 T + \beta_2\,\text{Time} + \beta_3(T \times \text{Time})$
$\beta_1$Common treatment effect across timeTreatment effect at the reference time
$\beta_3$Not in the modelChange in the treatment effect relative to the reference time
Treatment effect over visitsAssumed constant: parallel treatment and control trajectoriesAllowed to vary across visits

What the time main effect means

Another common trap is confusing the treatment effect with the time effect. In the interaction model

$$Y = \beta_0 + \beta_1 T + \beta_2\,\text{Time} + \beta_3(T \times \text{Time})$$

the coefficient $\beta_2$ is the effect of time when Treatment = 0. If the control group is coded as 0, then $\beta_2$ describes the change over time in the control group.

So the third reading in the opening scene, "the change over time in the control group", describes the time main effect, not the treatment main effect. That is why it is an attractive but incorrect reading of $\beta_1$.

A coefficient map for fast interpretation

When baseline and control are the reference categories.
CoefficientInterpretation
$\beta_0$Mean outcome in the control group at baseline
$\beta_1$Treatment vs control difference at baseline
$\beta_2$Change from baseline over time in the control group
$\beta_3$Additional change over time in the treatment group compared with control

Three misreadings of the treatment coefficient

  • "The treatment coefficient is the average treatment effect across all visits."

    That is not what the treatment main-effect coefficient means when a treatment-by-time interaction is included. Once the interaction is present, there is no single treatment effect that automatically applies to every time point. The treatment effect at baseline is $\beta_1$, while at another visit it is $\beta_1$ + the relevant interaction coefficient.

    Fix: An average treatment effect across visits requires a separate contrast, a marginal mean comparison (comparing the model's predicted group means averaged over the visits) or another explicitly defined estimand, the precise quantity the study sets out to estimate [3].

  • "The treatment coefficient is the treatment effect at the final visit."

    This would only be true if the final visit had been chosen as the reference time. The meaning of the treatment main effect changes when the reference category changes: if the final visit were coded as the reference level, $\beta_1$ would be the treatment-control difference at the final visit.

    Fix: Check which visit is the reference time before reading $\beta_1$. Coefficient interpretation is inseparable from the variable coding.

  • "The treatment coefficient is the change over time in the control group."

    That describes $\beta_2$, the time main effect: the effect of time when Treatment = 0, which is the control group when control is coded 0.

    Fix: Read $\beta_1$ as a difference between groups at the reference time, and $\beta_2$ as a change over time within the control group.

The deeper lesson: a main effect is conditional

The phrase "main effect" can be misleading when an interaction is present.

Without interaction, it is often reasonable to think of a main effect as a general effect across levels of another variable. With interaction, however, the effect of one variable depends on the value of the other variable [2].

For treatment × time, the effect of treatment depends on time: $\beta_1$ at baseline, $\beta_1 + \beta_3$ at follow-up. Likewise, the effect of time depends on treatment group: $\beta_2$ in the control group, $\beta_2 + \beta_3$ in the treatment group.

That is the conceptual reason why the reference category becomes so important. The same two-way dependence holds for any interaction between two variables; the article on interaction and effect modification follows it beyond regression coefficients.

Putting it together

The decision in the opening scene turns on interpreting coefficients in the presence of an interaction, not merely on knowing repeated-measures regression. With

$$Y_{ij} = \beta_0 + \beta_1 T + \beta_2\,\text{Time} + \beta_3(T\times\text{Time})$$

and baseline as the reference time,

$$\boxed{\beta_1 = \text{treatment effect at baseline}}$$

so the treatment main effect is the treatment effect at the reference time. But if the interaction term is removed,

$$Y_{ij} = \beta_0 + \beta_1 T + \beta_2\,\text{Time}$$

then the interpretation changes conceptually:

$$\boxed{\beta_1 = \text{common treatment effect assumed across all visits}}$$

Glossary

main effect
The coefficient of one variable on its own. In a model with an interaction it is read at the reference value of the other variable.
reference level
The category coded 0, against which the other categories are compared; here baseline for Time and control for Treatment.
treatment-by-time interaction (ปฏิกิริยาสัมพันธ์ระหว่างการรักษากับเวลา)
The model term that lets the treatment-control difference change across visits.
difference in differences
The change in the treatment group minus the change in the control group.
contrast
A difference of model quantities that answers one question, such as the treatment-control difference at a named visit.
estimand (ปริมาณเป้าหมายของการประมาณ)
The precise quantity a study aims to estimate.

References

  1. Fitzmaurice GM, Laird NM, Ware JH. Applied longitudinal analysis. 2nd ed. Wiley; 2011. doi:10.1002/9781119513469 https://doi.org/10.1002/9781119513469
  2. Vittinghoff E, Glidden DV, Shiboski SC, McCulloch CE. Regression methods in biostatistics: linear, logistic, survival, and repeated measures models. 2nd ed. Springer; 2012. doi:10.1007/978-1-4614-1353-0 https://doi.org/10.1007/978-1-4614-1353-0
  3. International Council for Harmonisation (ICH). ICH E9(R1): Addendum on estimands and sensitivity analysis in clinical trials to the guideline on statistical principles for clinical trials. ICH Harmonised Guideline, Step 4; 2019. https://database.ich.org/sites/default/files/E9-R1_Step4_Guideline_2019_1203.pdf

Key takeaways

  • With a treatment-by-time interaction in the model, the treatment main effect β1 is the treatment effect at the reference time; with baseline as the reference, it is the treatment-control difference at baseline.
  • The interaction β3 is the change in the treatment effect from the reference time: the effect at follow-up is β1 + β3, for example 2 + 3 = 5.
  • Without the interaction, β1 is one common treatment effect across time, because the model forces parallel treatment and control trajectories.
  • β2 is the change over time in the control group, and β3 is the change in the treatment group minus the change in the control group, a difference in differences.
  • No interaction means one common effect; with an interaction the main effect is conditional on the reference level, so first ask what the reference time is.

Related in the wiki: [[repeated-measures-modeling-guide]] [[mixed-model-series-guide]]

0
Message for International and Thai ReadersUnderstanding My Medical Context in ThailandRead more →Message for International and Thai ReadersUnderstanding My Broader Content Beyond MedicineRead more →

Comments

No comments yet. Be the first to share your thoughts.

Sign in to comment