Time-varying exposures and treatment
What question does this help answer?
The effect of a treatment STRATEGY sustained over time, such as always treat versus never treat, or treat once a marker crosses a threshold. That is usually the clinical question when a drug is taken continuously.
Why ordinary adjustment fails
Consider a drug whose dose responds to a laboratory value, and where that laboratory value also predicts the outcome and was itself affected by earlier doses. The value confounds later treatment, so it must be adjusted for; but it lies on the causal path from earlier treatment to the outcome, so adjusting for it in a regression removes part of the effect. No single regression can do both, because these are contradictory requirements for the same term.
What treatment-confounder feedback looks like
Methods that can
- Inverse probability of treatment weighting, fitting a marginal structural model: reweight the population so that treatment at each time is independent of the measured history, then estimate the effect in the reweighted pseudo-population.
- The parametric g-formula: model the whole time-varying process and simulate the outcome under each strategy.
- G-estimation of structural nested models: estimate the effect of treatment at each time given the history.
- All three require the measured covariates to capture the confounding at every time point, which is a strong and uncheckable assumption. They also require positivity: everyone must have some chance of each treatment at each time.
The clone-censor-weight framing
A useful way to specify the question is to imagine each person cloned into the strategies being compared, followed under each, and censored when their actual data stop conforming to a clone's strategy, with weights correcting for that censoring. Setting the question up this way makes the time-zero definition explicit and prevents the retrospective assignment that creates immortal time.
Why Mallard may recommend it
Mallard may name these methods when the description involves treatment that starts, stops or is titrated during follow-up, and where a marker both drives the treatment and predicts the outcome.
When there is no feedback: a Cox model with time-varying exposure
When exposure starts or stops during follow-up, but nothing affected by earlier exposure also drives later exposure, an ordinary Cox model can handle it, provided each person's follow-up is split at the moment their exposure changes. In counting-process form each row is a period (start, stop] carrying the exposure status that held during it, so a patient contributes unexposed time before starting treatment and exposed time afterwards, and the hazard ratio compares current exposure with no current exposure. The error this prevents is classifying a patient as exposed from time zero because they started treatment later, which credits the treatment with the event-free time before it began: immortal time bias, which makes a treatment look protective. The model still needs the confounders measured, and when a time-varying confounder is itself affected by earlier exposure, the methods above are needed instead.
What to watch out for
When a variable is both a confounder of later treatment AND affected by earlier treatment, adjusting for it in the usual way is wrong in BOTH directions: leaving it out leaves confounding, and putting it in a regression blocks part of the effect you are trying to measure and can open a collider path. This is not a subtlety at the margins; in the founding example, standard adjustment reported a treatment as tripling mortality when the appropriate analysis showed benefit. The other trap is assigning exposure retrospectively, which creates immortal time.
Clinical example
Question: Does sustained anticoagulation reduce stroke, when INR drives dosing and also predicts bleeding and stroke? Analysis: A marginal structural Cox model with inverse probability weights for treatment and censoring, with the strategies and time zero defined in advance.
- Marginal structural models and causal inference in epidemiology (opens in a new tab) · Epidemiology · doi 10.1097/00001648-200009000-00011
- Marginal structural models to estimate the causal effect of zidovudine on the survival of HIV-positive men (opens in a new tab) · Epidemiology · doi 10.1097/00001648-200009000-00012
- Immortal time bias in pharmaco-epidemiology (opens in a new tab) · Am J Epidemiol · doi 10.1093/aje/kwm324