Tutorials › Marginal Structural Models › Lagged Treatment Effects in Pooled Logistic MSMs

Fitting MSMs for Survival Outcomes · Tutorial 204 of 501

Lagged Treatment Effects in Pooled Logistic MSMs

Learn to encode treatment histories with lagged indicators and translate fitted coefficients into interval-specific contrasts under delayed treatment effects.

Advanced 12 min read

What You'll Learn

  • Define lagged treatment indicators relative to an event interval.
  • Encode a fixed delay and a distributed-lag treatment model.
  • Interpret lag coefficients as contrasts in counterfactual interval-specific odds.
  • Calculate the effect of a treatment pulse or sustained treatment from lag coefficients.
  • Diagnose timing, support, and model-specification problems in weighted fits.

Why Lag the Treatment?

A treatment does not always change event risk immediately. A therapy may need time to take effect, or its effect may build or fade across several intervals. A pooled logistic model that includes only treatment in the current interval cannot represent these patterns when past exposure matters. Lagged treatment indicators let the model associate the event hazard in interval \(k\) with treatment in earlier intervals.

The lag convention must be explicit: it determines which treatment assignment is connected to which event interval. Here, treatment \(A_{ik}\) is measured at the start of interval \(k\), and \(Y_{ik}=1\) indicates that individual \(i\) experiences the event during that interval. The risk set for that row consists of individuals event-free at its start. Lag 0 is treatment assigned at the start of the event interval; lag 1 is treatment assigned one interval earlier.

Definition: For lag \(\ell\geq 0\), the lagged treatment indicator in interval \(k\) is \(A_{i,k-\ell}\). A lag-\(\ell\) coefficient describes the model component associated with treatment \(\ell\) intervals before the event interval, holding the other included lagged indicators fixed.

For clarity, define the counterfactual discrete hazard under treatment history \(\bar a_k=(a_1,\ldots,a_k)\) as \(h_k(\bar a_k)=P(T^{\bar a}=k\mid T^{\bar a}\geq k)\). A lagged-treatment marginal structural model (MSM) specifies this hazard as

$$ \operatorname{logit}\{h_k(\bar a_k)\} =\alpha_k+\sum_{\ell=0}^{L}\beta_\ell a_{k-\ell}. $$

Here, \(\alpha_k\) represents the baseline log odds for interval \(k\), and the \(\beta_\ell\) are lag coefficients. In a weighted pooled logistic fit, the corresponding rows are the observed at-risk person-intervals, with treatment weights applied to the pooled logistic score or likelihood. The fitted model targets the counterfactual hazard relation when consistency, sequential exchangeability, and treatment positivity hold, the weights correctly account for treatment assignment, and the MSM is correctly specified. The lag structure itself is a modeling assumption, not a consequence of weighting.

Encoding a Fixed Delay

Suppose scientific knowledge suggests that treatment has no effect until \(d\) full intervals after assignment. With our convention, the first interval in which treatment assigned at \(j\) can affect risk is \(j+d\). A fixed-delay model omits lags earlier than \(d\):

$$ \operatorname{logit}\{h_k(\bar a_k)\} =\alpha_k+\sum_{\ell=d}^{L}\beta_\ell a_{k-\ell}. $$

For example, a delay of two intervals excludes \(a_k\) and \(a_{k-1}\); the first included treatment history term is \(a_{k-2}\). An omitted term is constrained to have no effect in this model. This is stronger than merely failing to estimate its coefficient precisely, so the delay should have a substantive rationale.

Worked Example: Building a Two-Interval Delay

Treatment begins at the start of interval 2 and continues. Suppose a two-interval delay is specified. The lag columns needed to check the encoding are \(A_k\), \(A_{k-1}\), and \(A_{k-2}\).

Event interval \(k\)\(A_k\) (lag 0)\(A_{k-1}\) (lag 1)\(A_{k-2}\) (lag 2)Included treatment term
2100None
3110None
4111\(A_{k-2}=1\)
5111\(A_{k-2}=1\)

The treatment is assigned in interval 2, but it first appears in an included lag column for the event hazard in interval 4. Thus, the coding matches the stated delay. This check is especially important when the data are expanded to person-interval rows: shifting the treatment column by one row too many or too few changes the scientific model.

Interpreting Lag Coefficients and History Contrasts

A coefficient is most precisely interpreted through a contrast in counterfactual hazards. Under the specified logistic MSM, compare two treatment histories \(\bar a_k\) and \(\bar a'_k\). Subtract their linear predictors to obtain the log odds contrast. Exponentiating gives the odds ratio:

Result: If the model includes lags \(0,\ldots,L\), then
$$ \frac{h_k(\bar a_k)/\{1-h_k(\bar a_k)\}} {h_k(\bar a'_k)/\{1-h_k(\bar a'_k)\}} = \exp\left\{\sum_{\ell=0}^{L} \beta_\ell(a_{k-\ell}-a'_{k-\ell})\right\}. $$

To derive this, write the log odds for each history using the MSM. Their difference is \(\alpha_k+\sum_\ell\beta_\ell a_{k-\ell}- [\alpha_k+\sum_\ell\beta_\ell a'_{k-\ell}]\). The common \(\alpha_k\) cancels, leaving the sum in the exponent after exponentiation. In particular, if the histories differ only in treatment at lag \(\ell\) by one unit, the odds ratio is \(\exp(\beta_\ell)\). For binary treatment, this is the interval-specific counterfactual odds ratio for changing that lagged treatment from 0 to 1 while holding the other included history components fixed. \(\square\)

This is an odds ratio for the event in a particular interval among those counterfactually event-free at its start. It is not a risk ratio, and it does not by itself describe a cumulative survival contrast. A fitted interval hazard can be converted to survival by combining interval hazards, but the lag coefficients themselves are not cumulative effects.

Worked Example: Reading a Lag-Specific Odds Ratio

Suppose the model has a two-interval delay and \(\beta_2=\log(1.5)\). In interval 5, compare two histories identical at all included lags except that one has \(A_3=1\) and the other has \(A_3=0\). Since \(A_3=A_{5-2}\), the histories differ only at lag 2. The odds ratio is

$$ \exp\{\beta_2(1-0)\}=\exp\{\log(1.5)\}=1.5. $$

If the reference history has hazard \(0.10\), its odds are \(0.10/0.90=1/9\). The contrasted history has odds \(1.5/9=1/6\), and therefore hazard

$$ \frac{1/6}{1+1/6}=\frac{1}{7}\approx 0.143. $$

Thus this contrast raises the interval-5 hazard from \(0.10\) to about \(0.143\), under the model. The calculation also shows why an odds ratio of 1.5 does not mean a 50% increase in risk.

Distributed Lags and Sustained Exposure

A delayed effect may develop over several intervals rather than appearing at just one lag. A distributed-lag model includes multiple coefficients, for example \(\beta_1,\beta_2,\beta_3\), allowing the treatment association to vary with time since assignment. If treatment begins at interval \(j\) and remains on, then at event interval \(k\), every included lag \(\ell\) for which \(k-\ell\geq j\) has treatment value 1. The log odds contrast against never-treated history is consequently the sum of those coefficients.

Result: For a sustained binary treatment beginning at \(j\), the model-implied interval-\(k\) odds ratio against never treatment is
$$ \exp\left\{\sum_{\ell=d}^{L} \beta_\ell I(k-\ell\geq j)\right\}, $$

where \(I(\cdot)\) is 1 when its condition holds and 0 otherwise. This follows directly from the history-contrast formula: the never-treated history has zero in every included lag column, and the sustained-treatment history has one exactly when the corresponding treatment interval is on or after \(j\). The formula identifies when each coefficient begins contributing and prevents treating a single \(\beta_\ell\) as the effect of an entire sustained regimen. \(\square\)

Worked Example: A Pulse Versus Sustained Treatment

Consider a model with lags 1 and 2, coefficients \(\beta_1=-0.4\) and \(\beta_2=-0.2\), and no lag-0 effect. At event interval 4, compare never treatment with treatment beginning in interval 2. If treatment is a pulse in interval 2 only, then \(A_2=1\) occupies lag 2, while \(A_3=0\) occupies lag 1. The log odds contrast is \(-0.2\), so the odds ratio is

$$ \exp(-0.2)\approx 0.819. $$

If treatment instead continues through interval 4, then \(A_3=1\) at lag 1 and \(A_2=1\) at lag 2. The log odds contrast is \(-0.4-0.2=-0.6\), giving an odds ratio \(\exp(-0.6)\approx0.549\). For a never-treated interval-4 hazard of \(0.20\), the reference odds are \(0.20/0.80=0.25\). Under sustained treatment, the odds are \(0.25(0.549)=0.13725\), and the hazard is \(0.13725/(1+0.13725)\approx0.121\). The pulse and sustained histories therefore have different predicted hazards, even though both include treatment in interval 2.

Fitting, Diagnostics, and Alternatives

Construct one record per individual and event interval in which the individual is at risk. Include the event indicator, the interval-specific baseline-hazard terms, and the chosen lagged treatment columns. In a weighted pooled logistic fit, each such row receives its treatment weight for that risk-set time. The weighted estimating equation has the usual logistic form, with each row’s score multiplied by its weight; lag construction changes the design vector, not the definition of the risk set.

Before interpreting coefficients, check that the lag columns represent the intended assignment times and that each coefficient has data support. Strong persistence in treatment can make adjacent lag columns highly correlated, leading to unstable estimates and wide uncertainty. Sparse treatment changes, few events in relevant histories, or extreme weights can make some lag contrasts effectively unsupported. A coefficient may then be numerically available but poorly identified by the observed weighted data.

  • Check timing: print several individuals’ treatment histories beside their person-interval lag columns, including the first intervals of follow-up.
  • Check support: tabulate events and at-risk rows across the treatment histories that identify the lag contrasts; inspect weight concentration and coefficient uncertainty.
  • Check the delay restriction: compare the scientific rationale for excluding early lags with estimates from a less constrained model when the data can support it.
  • Check the hazard fit: examine fitted and observed interval patterns across histories. A delay model that systematically misses early or later event patterns may have the wrong lag structure or baseline hazard.

The main alternatives answer different questions. A current-treatment-only model assumes that only treatment in the event interval matters. A cumulative-exposure model replaces separate lags with a summary such as total prior exposure; it is more parsimonious but cannot distinguish histories with the same total and different timing. A distributed-lag model allows timing-specific associations but uses more parameters and can be unstable when treatment histories are highly correlated. Treatment-by-time interactions can allow effects to vary with follow-up time, but they are not the same as treatment lags: the former vary an effect by event time, while the latter associate risk with time since treatment assignment.

A lagged MSM does not establish that a biological delay is true. Its interpretation depends on correct treatment timing, identification assumptions, an adequate baseline-hazard specification, and a credible lag structure. If pre-follow-up exposure can affect risk, setting unavailable pre-entry treatment values to zero is not automatically valid; those histories must be defined or the analysis must be restricted or parameterized accordingly.

Common pitfall: Treating \(\exp(\beta_2)\) as the odds ratio for “starting treatment and staying on it” is generally wrong. It is the odds ratio for a contrast that changes the lag-2 indicator while holding other included lag indicators fixed. For a sustained history, add all the applicable lag coefficients in the linear predictor, then exponentiate the sum.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. With treatment measured at each interval’s start, which treatment assignment enters as lag 2 for the event hazard in interval 6?
  2. A model includes \(\beta_2=\log(1.4)\). What is the odds ratio for histories differing only by a one-unit increase in the lag-2 treatment indicator?
  3. A delayed model has \(\beta_1=-0.3\) and \(\beta_2=-0.2\). At an interval where both lag indicators are 1, what is the odds ratio against a history with both equal to 0?
  4. Why can highly persistent treatment make separate lag coefficients difficult to estimate?

Solutions. (1) Treatment assigned in interval \(6-2=4\), so the indicator is \(A_4\). (2) The odds ratio is \(\exp\{\log(1.4)\}=1.4\). (3) The log odds contrast is \(-0.3-0.2=-0.5\), so the odds ratio is \(\exp(-0.5)\approx0.607\). (4) If treatment rarely changes, adjacent lag indicators tend to have the same values. Their columns then contain little independent information for separating the lag-specific coefficients, producing unstable estimates or large standard errors.

Clinical Biostats