Tutorials › Multiple Imputation by Chained Equations (MICE) › Handling Treatment Switching in Time-Dependent Imputation

Survival and Time-Varying Data · Tutorial 399 of 497

Handling Treatment Switching in Time-Dependent Imputation

Represent treatment as an interval-specific history and impute missing states with models that respect time order, transition rules, and uncertainty.

Advanced 12 min read

What You'll Learn

  • Define interval-specific treatment states for initiation, discontinuation, and switching.
  • Specify time-ordered conditional models for missing treatment periods.
  • Distinguish a probabilistic imputation from copying a later observed state backward.
  • Apply structural transition rules without imposing unsupported restrictions.
  • Diagnose implausible treatment paths and compare imputation with simpler alternatives.

Why Treatment Switching Needs a Time-Ordered Representation

A treatment recorded once at baseline cannot describe a person who starts treatment later, stops it, or switches to another treatment during follow-up. In survival imputation, that distinction matters: the treatment assigned to one follow-up period may differ from the treatment assigned to another. A record that treats a later state as if it applied throughout follow-up can misrepresent when people were treated.

The practical starting point is to divide observed follow-up into intervals over which the treatment state is constant. The treatment value belongs to that interval, not to the person for all time. If a status is missing for an interval, impute that interval’s state; do not automatically copy a later observed state into it. A later record of treatment B establishes the state at its own time, not the state in an earlier gap.

Definition: Let \(A_{ij}\) denote the treatment state for person \(i\) during follow-up interval \(j\). A treatment history is the ordered sequence \(A_{i1}, A_{i2}, \ldots, A_{iK}\), where each value describes its corresponding interval. States may represent, for example, no treatment, treatment A, or treatment B. A missing treatment period means that \(A_{ij}\) is unknown for that interval; it does not mean that the person’s treatment state is unknown for all follow-up.

This representation assumes that the intervals are defined so treatment is constant within each one, and that the recorded transition times and states are accurate where observed. If an interval contains a known treatment start, stop, or switch, split it at that time. The relevant outcome and covariate records must also be associated with the correct intervals, as in start-stop data.

Time-Ordered Conditional Imputation

For a binary treatment, one possible conditional model for interval \(j\) is a logistic regression for treatment status. Write \(H_{i,j-1}\) for the person’s treatment history through the preceding interval, and \(X_i\) and \(Z_{ij}\) for measured baseline and interval-specific predictors. A time-ordered model has the form:

$$ \operatorname{logit}\{P(A_{ij}=1 \mid H_{i,j-1}, X_i, Z_{ij})\} = \beta_0 + \beta_1 A_{i,j-1} + \beta_2^\mathsf{T}X_i + \beta_3^\mathsf{T}Z_{ij}. $$

This is a model for the current interval’s state, conditional on information available through the preceding interval and other specified predictors. For a treatment with several states, use a suitable categorical model instead. The categories should distinguish clinically relevant states, such as no treatment, treatment A, and treatment B, rather than collapsing a switch into a generic “treated” value if the distinction matters to the analysis.

In multiple imputation by chained equations, the conditional model is fitted within the imputation procedure and missing values are drawn from its predictive distribution. In a complete implementation, parameter uncertainty is represented as well as uncertainty about the missing state: one does not simply replace each missing value by its fitted probability or most likely category. The model should include observed variables that are appropriate for explaining treatment and missingness, including relevant outcome information when justified by the analysis and imputation design.

Key principle: A treatment state is assigned to the interval it describes. A later observed treatment state does not, by itself, determine the treatment state in an earlier missing interval. The imputed earlier state must come from a specified model and its uncertainty, not from backward copying.

The missingness assumption is that, conditional on the variables included in the imputation model, the missing treatment states are adequately explained by the observed information (a conditional missing-at-random assumption). The model also needs adequate support: within relevant predictor patterns, the treatment states being imputed must be plausible and represented well enough to estimate their probabilities. In addition, the conditional model must be sufficiently well specified for the intended analysis. These assumptions cannot be established just by running the imputation algorithm.

Why the Ordering Is Coherent

A time-ordered factorization gives a direct justification for imputing a treatment path one interval at a time. For any joint distribution of the treatment history, the chain rule gives:

$$ P(A_{i1}, \ldots, A_{iK} \mid X_i) = P(A_{i1} \mid X_i) \prod_{j=2}^{K} P(A_{ij} \mid A_{i1}, \ldots, A_{i,j-1}, X_i). $$

This identity follows by repeatedly applying \(P(U,V \mid X)=P(U \mid X)P(V \mid U,X)\). It does not, by itself, assume that treatment depends only on the immediately preceding state. A model using only \(A_{i,j-1}\) instead of the full preceding history makes that additional simplification; it should be used only when reasonable for the treatment process and analysis.

The factorization explains why a sequence of conditional draws can represent a joint history. It does not guarantee that a particular set of fitted conditional models is compatible with one common joint distribution, nor that the models are correctly specified. In practice, examine the resulting histories and assess whether the imposed transition structure and the observed data support them.

Worked Example: Imputing a Missing Binary Treatment Interval

Suppose a hypothetical patient has no treatment in interval 1, a missing treatment status in interval 2, and treatment A observed in interval 3. For illustration, assume a fitted binary model uses the previous interval’s status and a measured symptom indicator. Its hypothetical coefficients are \(\beta_0=-1.00\), \(\beta_1=1.20\), and \(\beta_2=0.80\), where the symptom indicator equals 1 when symptoms are present. In interval 2, the previous treatment status is 0 and symptoms are present.

The model’s linear predictor is \(-1.00 + 1.20(0) + 0.80(1)=-0.20\). Therefore, the fitted probability of treatment in interval 2 is:

$$ P(A_{i2}=1 \mid A_{i1}=0, Z_{i2}=1) = \frac{\exp(-0.20)}{1+\exp(-0.20)} = 0.4502. $$

For a simplified demonstration with the model parameters held fixed, draw a uniform value \(u=0.31\). Because \(0.31<0.4502\), impute treatment in interval 2. In an actual multiple-imputation procedure, the model parameters would also be drawn to reflect their uncertainty. The treatment observed in interval 3 is not copied into interval 2: the interval-2 draw follows the stated conditional model. The model and its predictors must be substantively appropriate; a numerical draw alone does not establish that.

Representing Switching and Structural Constraints

When treatment can take several states, the conditional model should distinguish the transitions that matter. Depending on the treatment process, no treatment might be followed by A or B; A might be followed by continued A, discontinuation, or a switch to B. These are not universal rules. For example, a study protocol may prohibit switching in one direction, while clinical practice may allow restarting after discontinuation. Encode only transition restrictions supported by the protocol or substantive knowledge. Do not impose “once stopped, always stopped” merely because it simplifies the model.

Observed transition times should be used to split follow-up into intervals with a single state. When a treatment start or switch time itself is missing, it may not be sufficient to impute a single interval label without a model for the uncertain transition time or its interval. A status imputation cannot resolve timing information that was never represented in the data. Define the target of imputation and the interval boundaries before fitting conditional models.

Worked Example: Drawing a Treatment Switch

Consider a hypothetical three-state treatment variable: 0 for no treatment, A for treatment A, and B for treatment B. At the start of a missing interval, the recorded state is A. Suppose a fitted categorical model, conditional on the preceding state and recorded covariates, assigns probabilities 0.25 to no treatment, 0.55 to continued A, and 0.20 to B. These probabilities sum to 1. Suppose a uniform draw is \(u=0.68\), and the categories are ordered as no treatment, A, B.

The cumulative probability ranges are 0 to 0.25 for no treatment, 0.25 to 0.80 for A, and 0.80 to 1.00 for B. Since \(0.25 \leq 0.68 < 0.80\), the draw assigns A in the missing interval. A draw of \(u=0.88\) would assign B, representing a switch. The model permits that switch because B has positive probability; if a protocol ruled out A-to-B switching, the model would need to represent that restriction. The probabilities and draws here are hypothetical and illustrate the mechanism, not evidence about any real treatment process.

Worked Example: Imputing Two Consecutive Missing States

Suppose a hypothetical person has state A in interval 1, while intervals 2 and 3 are missing. For illustration, use a transition model with these hypothetical probabilities: after A, interval 2 is A with probability 0.70 and no treatment with probability 0.30; after A, interval 3 is A with probability 0.70 and no treatment with probability 0.30; after no treatment, interval 3 is A with probability 0.20 and no treatment with probability 0.80. Assume the model allows only these two states for this example.

For interval 2, draw \(u_2=0.81\). Since \(0.81>0.70\), the imputed state is no treatment. For interval 3, use the transition probability conditional on the newly imputed interval-2 state: \(P(A_{i3}=A \mid A_{i2}=0)=0.20\). Draw \(u_3=0.14\); because \(0.14<0.20\), impute A in interval 3. The resulting path is A, no treatment, A. This calculation shows how a later missing state can depend on an earlier imputed state; it does not require copying one state across all periods or assuming that discontinuation is permanent. A real model must use transition probabilities and state restrictions that fit the actual treatment process.

Diagnostics, Alternatives, and Limitations

After imputation, inspect both the interval-level distributions and the full treatment paths. Compare observed and imputed state frequencies by interval and by relevant predictors. Count transitions such as initiation, discontinuation, restart, and switching, and check for paths that violate documented rules. Look for implausible jumps, excessive persistence, or nearly deterministic predictions that may signal sparse data, separation, or an over-restrictive model. A plausible overall proportion of treated intervals does not guarantee plausible individual histories.

Other approaches have different strengths and weaknesses:

ApproachWhat it doesMain concern
Time-ordered conditional imputationDraws each missing interval’s state from a conditional model using specified information through the preceding interval.Depends on adequate models and predictors; fitted conditionals may not represent a coherent or plausible path.
Last observation carried forwardFills a missing interval with the most recently observed treatment state.Assumes no change during the gap and understates uncertainty; it cannot represent an unobserved start, stop, or switch.
Complete-case analysisExcludes records with missing treatment information.Can lose information and may be biased when inclusion depends on treatment or outcome-related factors.
Joint trajectory modelModels the treatment path as a whole rather than specifying separate interval conditionals.May require stronger structural assumptions and more complex estimation.

The time-ordered approach is not automatically superior in every application. It can perform poorly when treatment changes are rare, important predictors are absent, missingness depends on unobserved reasons for switching, or the conditional models do not capture the treatment process. Sparse transitions can produce unstable probabilities. If a transition is structurally impossible, a model that assigns it positive probability is inappropriate; if it is merely uncommon, forbidding it without evidence can also distort histories. Compare imputed paths with clinical knowledge and observed data, and assess sensitivity to plausible modeling choices.

Common Mistake

Wrong reasoning: “Treatment B is observed after the gap, so the missing earlier interval must also have been B.” This treats a later state as if it were a record of the earlier period and erases the possibility of initiation or switching within the gap.

Correction: Assign treatment states to their own intervals. Impute a missing earlier state from a specified conditional model and draw, using defensible predictors and transition rules. A later observed state does not itself justify assigning that state to the missing interval. Conversely, do not force a treatment path to be monotone unless the treatment protocol or substantive process warrants that restriction.

Key takeaway: Imputation of treatment switching is imputation of an ordered history, not a single timeless treatment label. Interval definitions, conditional models, and transition constraints should preserve the distinction between what was observed in each period and what remains uncertain.

Check Your Understanding

Answer each question, then compare with the brief solutions.

  1. A person has no treatment in interval 1, a missing status in interval 2, and treatment B observed in interval 3. Does the later observation alone establish treatment B in interval 2?
  2. A fitted binary model gives probability 0.35 of treatment in a missing interval. With a uniform draw of 0.42, what state is drawn if 1 means treated and the rule is to draw 1 when \(u\) is less than the probability?
  3. Why might a model using only the immediately previous treatment state be more restrictive than a model using the full previous history?
  4. A study protocol rules out switching from A to B. What should the imputation model do, and what should it not assume without further evidence?

Solutions: (1) No. The interval-3 record describes interval 3; interval 2 needs its own model-based imputation. (2) Draw 0, because \(0.42\) is not less than \(0.35\). (3) It assumes that, conditional on the immediately previous state and included predictors, more distant treatment history adds no further information; this is a simplifying modeling assumption. (4) The model should exclude the prohibited transition. It should not also assume that discontinuation is permanent or that other transitions are impossible unless the protocol or substantive evidence supports those restrictions.

Clinical Biostats