Why Interactions Matter in Marginal Mean Models
A treatment effect may vary over follow-up: it could be small soon after treatment begins and larger later, or it could diminish with time. A marginal mean model represents this kind of effect modification by including an interaction between treatment and time. The interaction is not merely an extra coefficient. It changes the modeled treatment effect across time, and its interpretation depends on the link function and how time is coded.
Let \(Y_{it}\) denote the response for individual \(i\) at measurement occasion \(t\), and let \(\mu_{it}=E[Y_{it}\mid A_i,t]\) denote the population-average mean at the specified treatment and time values. A marginal mean model specifies this mean through a link function \(g\). For a binary treatment \(A_i\), coded \(0\) for control and \(1\) for treatment, and numeric time \(t\), a basic interaction model is
The product \(A_i t\) is the interaction term. The coefficient \(\beta_{At}\) describes how the treatment effect on the link scale changes with a one-unit increase in time. The lower-order terms \(A_i\) and \(t\) remain in the model: including them makes the treatment and time effects interpretable at their reference values.
Deriving the Subgroup-Specific Effects
Write \(\eta_{it}=g(\mu_{it})\) for the linear predictor. Under the displayed model, the control-group predictor at time \(t\) is \(\beta_0+\beta_t t\); the treated-group predictor is \(\beta_0+\beta_A+(\beta_t+\beta_{At})t\). Thus the two groups have different time slopes on the link scale whenever \(\beta_{At}\ne 0\).
To verify the result, set \(A_i=1\) and subtract the predictor for \(A_i=0\):
The control slope follows from the coefficient of \(t\) when \(A_i=0\), namely \(\beta_t\). When \(A_i=1\), the terms involving time are \(\beta_t t+\beta_{At}t\), so the slope is \(\beta_t+\beta_{At}\). Their difference is \(\beta_{At}\). In particular, the treatment effect at \(t=0\) is \(\beta_A\); if zero is not a meaningful reference time, centering time at a relevant value makes the treatment coefficient refer to that value.
Worked Example: Treatment Effects That Change Linearly Over Time
Suppose a continuous outcome has an identity-link marginal mean model \(E[Y_{it}\mid A_i,t]=10-2A_i+1.5t+0.8A_i t\), with \(t=0,1,2\). Find the mean in each treatment group and the treatment effect at each time.
With the identity link, the linear predictor is the mean itself. For control, \(A_i=0\), so \(\mu(0,t)=10+1.5t\). For treatment, \(A_i=1\), so \(\mu(1,t)=10-2+(1.5+0.8)t=8+2.3t\).
At \(t=0\), the control mean is \(10\) and the treatment mean is \(8\), giving a treatment-minus-control difference of \(8-10=-2\). At \(t=1\), the means are \(11.5\) and \(10.3\), giving \(10.3-11.5=-1.2\). At \(t=2\), they are \(13\) and \(12.6\), giving \(12.6-13=-0.4\).
The link-scale treatment effect is \(\beta_A+\beta_{At}t=-2+0.8t\), which gives \(-2,-1.2,-0.4\) at the three times. Because the identity link leaves means unchanged, these link-scale differences are also the differences in the outcome means. The treated time slope, \(2.3\), exceeds the control slope, \(1.5\), by the interaction coefficient \(0.8\).
Interactions with Categorical Time and Other Covariates
When measurement occasions are not well represented by a straight-line trend, time can be represented by indicators. Suppose there are three occasions, \(0,1,2\), and occasion \(0\) is the reference. The model can include indicators \(I(t=1)\) and \(I(t=2)\), along with their products with treatment:
At occasion \(0\), the treatment effect on the link scale is \(\beta_A\). At occasion \(1\), it is \(\beta_A+\gamma_1\); at occasion \(2\), it is \(\beta_A+\gamma_2\). Here \(\gamma_1\) and \(\gamma_2\) compare each occasion's treatment effect with the effect at the reference occasion. Unlike the numeric-time model, this specification does not require the effects to change linearly across occasions.
The same interpretation applies when the modifying covariate is not time. For example, a model may include \(A_i Z_i\), where \(Z_i\) is a numeric baseline covariate. In a model containing \(\beta_A A_i+\beta_Z Z_i+\beta_{AZ}A_iZ_i\), the treatment effect on the link scale at \(Z_i=z\) is \(\beta_A+\beta_{AZ}z\). For categorical \(Z_i\), indicator coding gives a separate treatment-effect change for each nonreference category.
Worked Example: Interactions for Three Categorical Visits
For a binary outcome, suppose the logit marginal mean model is \(\operatorname{logit}(\mu)=-1+0.7A+0.4I(t=1)+0.2I(t=2)+0.5A I(t=1)-0.3A I(t=2)\). Calculate each group’s mean at each visit and the treatment effect on the log-odds scale.
At visit \(0\), the control linear predictor is \(-1\), so its mean is \(1/(1+e^1)\approx0.269\). The treated predictor is \(-1+0.7=-0.3\), so its mean is \(1/(1+e^{0.3})\approx0.426\). The treatment effect on the log-odds scale is \(0.7\).
At visit \(1\), the control predictor is \(-1+0.4=-0.6\), giving mean \(1/(1+e^{0.6})\approx0.354\). The treated predictor is \(-1+0.7+0.4+0.5=0.6\), giving mean \(1/(1+e^{-0.6})\approx0.646\). The log-odds treatment effect is \(0.7+0.5=1.2\).
At visit \(2\), the control predictor is \(-1+0.2=-0.8\), giving mean \(1/(1+e^{0.8})\approx0.310\). The treated predictor is \(-1+0.7+0.2-0.3=-0.4\), giving mean \(1/(1+e^{0.4})\approx0.401\). The log-odds treatment effect is \(0.7-0.3=0.4\).
The interaction coefficients allow the link-scale treatment effect to differ by visit: it is \(0.7\), \(1.2\), and \(0.4\), rather than being constrained to the same value at all three visits. The calculated probabilities also show that these coefficients are not probability differences.
How the Link Determines the Interpretation
The same interaction structure leads to different response-scale interpretations under different links. With an identity link, the treatment effect on the link scale is the difference between group means. With a log link, it is a log ratio of means. With a logit link, it is a log odds ratio. These interpretations follow directly by applying the inverse link; they do not make the response-scale treatment difference constant across covariate values.
To derive this, subtract the control log mean from the treated log mean. The difference is \(\beta_A+\beta_{At}t\), so exponentiating gives \(\mu(1,t)/\mu(0,t)=\exp(\beta_A+\beta_{At}t)\). At \(t+1\), the ratio is \(\exp(\beta_A+\beta_{At}(t+1))\). Dividing the latter by the former gives \(\exp(\beta_{At})\), as claimed.
Worked Example: A Time-Varying Mean Ratio Under a Log Link
Suppose a count outcome has model \(\log(\mu)=\log(2)+\log(1.5)A+\log(1.2)t+\log(0.8)At\), for \(t=0,1,2\). The control mean is \(2(1.2)^t\). The treated mean is \(2(1.5)(1.2\times0.8)^t=3(0.96)^t\).
At \(t=0\), the control and treated means are \(2\) and \(3\), so their ratio is \(3/2=1.5\). At \(t=1\), the means are \(2.4\) and \(2.88\), giving ratio \(2.88/2.4=1.2\). At \(t=2\), the means are \(2.88\) and \(2.7648\), giving ratio \(2.7648/2.88=0.96\).
The model gives the same ratios directly: \(\exp(\beta_A+\beta_{At}t)=1.5(0.8)^t\), which evaluates to \(1.5,1.2,0.96\). The interaction coefficient is \(\log(0.8)\), so each one-unit increase in time multiplies the treatment-to-control mean ratio by \(0.8\).
Under the logit link, the corresponding treatment effect is a log odds ratio. In the categorical-time example, the treatment odds ratio is \(\exp(0.7)\) at visit \(0\), \(\exp(1.2)\) at visit \(1\), and \(\exp(0.4)\) at visit \(2\). This does not imply that the probability difference is the same at each visit. The inverse logit is nonlinear, so the same change in log odds can yield different changes in probability at different baseline probabilities.
Common Pitfalls and Practical Interpretation
- Reading the treatment coefficient as the effect at every time. In the numeric-time model, \(\beta_A\) is the link-scale treatment effect only at \(t=0\). At another time \(t\), use \(\beta_A+\beta_{At}t\).
- Calling \(\beta_{At}\) the treatment effect. It is the change in that effect per time unit, not the effect itself. The treatment effect at a specified time includes both \(\beta_A\) and the interaction contribution.
- Interpreting a link-scale effect as a response-scale difference. This is appropriate for the identity link, but not generally for log or logit links. Under the log link the natural effect is a mean ratio; under the logit link it is an odds ratio.
- Omitting lower-order terms. A treatment-by-time product ordinarily belongs with the treatment and time terms. Without them, the model imposes a different structure and the interaction coefficients no longer have the reference-based interpretation described here.
- Ignoring coding and units. A treatment coefficient is tied to the reference time or covariate value, and a numeric-time interaction is per unit of the time scale used. Changing days to weeks changes the numerical value of a per-unit interaction.
Interactions matter because a single treatment coefficient can conceal how a modeled effect varies across subgroups or occasions. A careful interpretation identifies the link, states the covariate value or category, and then computes the subgroup-specific effect from the relevant main-effect and interaction terms. When the goal is to report means, evaluate the linear predictor for the treatment and time combination and apply the inverse link.
Check Your Understanding
For each question, identify the link-scale quantity before interpreting it on the response scale.
- In a binary-treatment numeric-time model, what is the treatment effect on the link scale at time \(t=3\)?
- In a log-link model, what does \(\exp(\beta_{At})\) represent when time increases by one unit?
- With categorical time and visit \(0\) as reference, what does the treatment-by-visit-2 coefficient add to the treatment effect?
- Why can a constant treatment effect on the logit scale correspond to different probability differences at different baseline probabilities?
- If time is centered so that its new value zero corresponds to the original time \(t=c\), at what original time does the treatment main-effect coefficient apply?