Tutorials › Marginal Structural Models › Immortal Time Bias from Misaligned Treatment Definitions

Target Trial Emulation · Tutorial 453 of 501

Immortal Time Bias from Misaligned Treatment Definitions

Learn to recognize immortal time created by future-based treatment classification and choose a design that gives both strategies a common, defensible time zero.

Intermediate 11 min read

What You'll Learn

  • Define immortal time and identify when future treatment status makes an earlier interval event-free by construction.
  • Calculate how misclassification of person-time changes descriptive event rates.
  • Distinguish a time-varying exposure description from a causal comparison of treatment strategies.
  • Repair misalignment by defining baseline initiation, using a common grace-period design, or choosing a landmark estimand.
  • Diagnose immortal time by auditing timelines and asking whether an event could occur during each classified interval.
  • Explain why correcting the time alignment does not, by itself, remove confounding or guarantee a causal interpretation.

Why Treatment Timing Must Match Time Zero

A common analysis labels people “treated” if they receive treatment at any point during follow-up, then compares them with people who never receive it. That label uses future information. A person who dies before they could start treatment will necessarily be classified as untreated, while a person classified as treated must have remained alive long enough to initiate. The interval before initiation is therefore guaranteed to be event-free for the eventual-treatment group, when the outcome is an event that prevents later initiation.

This is immortal time: a period during which the outcome of interest cannot occur for people assigned to a category by a future event such as treatment initiation. When that period is incorrectly credited to the treated group, the resulting comparison can make treatment look protective even when the difference is caused by the classification rule. The central design check is whether eligibility, treatment assignment, and the start of follow-up refer to the same time.

Definition: Let time zero be the start of follow-up, \(S\) the time of treatment initiation, and \(D\) the time of an event that precludes later initiation, such as death. If baseline exposure is defined using future initiation, a person is classified as treated only if they initiate before the event. Their time from time zero up to \(S\) is then guaranteed to be event-free by the definition of the group. If this time is counted as treated follow-up, it is immortal time misallocated to the treated group.

The definition depends on the way treatment groups are formed and on the event being studied. It does not mean that every period before treatment is immortal: a person can experience many outcomes before treatment, and some outcomes do not prevent later initiation. It also does not claim that all future-based exposure definitions produce bias of the same size or direction. The specific problem is a mismatch: group membership depends on surviving, remaining event-free, or otherwise staying eligible long enough to receive treatment, while follow-up is counted from an earlier time.

Worked Example: The Guaranteed Event-Free Interval

Worked Example: Counting Person-Time by Actual Treatment Status

Suppose three people enter follow-up at day 0. Person A starts treatment at day 40 and dies at day 55. Person B starts at day 50 and dies at day 65. Person C never starts and dies at day 40. For a simple descriptive rate calculation, count each person’s time at risk until death and classify each interval by treatment status at that time.

A contributes 40 untreated days and 15 treated days, followed by one death during treated time. B contributes 50 untreated days and 15 treated days, followed by one death during treated time. C contributes 40 untreated days and one death during untreated time. Therefore, untreated follow-up is \(40+50+40=130\) person-days, with \(1\) death; treated follow-up is \(15+15=30\) person-days, with \(2\) deaths.

$$ \text{Untreated rate}=\frac{1}{130}=0.00769 \quad\text{deaths per person-day}, \qquad \text{treated rate}=\frac{2}{30}=0.0667 \quad\text{deaths per person-day}. $$

Now instead classify people at day 0 as “ever treated” or “never treated” based on what happens before death. A and B are ever treated, so their combined 120 person-days are assigned to the treated group: 90 days before initiation and 30 days after initiation. They have 2 deaths. C contributes 40 person-days and 1 death to the never-treated group. The resulting crude rates are \(2/120=0.0167\) and \(1/40=0.025\) deaths per person-day.

$$ \frac{2}{120}<\frac{1}{40}, \qquad\text{whereas}\qquad \frac{2}{30}>\frac{1}{130}. $$

The contrast reverses because the ever-treated group has 90 event-free days before initiation incorrectly counted as treated time. The correct time-varying descriptive allocation is 1 death over 130 untreated person-days and 2 deaths over 30 treated person-days. Neither set of crude rates is, by itself, a causal treatment effect: confounding, differences in follow-up, and other design issues are not resolved by this arithmetic.

Why the Misclassification Creates a Distortion

The logic can be written directly. Suppose a person is called treated if they initiate before an event that would prevent initiation. For a person classified as treated, \(S<D\). Thus no event occurs in the interval from time zero to \(S\). If an analysis labels all of that interval treated, it adds event-free time to the treated denominator even though treatment had not yet begun.

Result: If a future-defined treated group consists of people with \(S<D\), then every member of that group has zero events in \([0,S)\). If the group’s event count after initiation is \(d\), its post-initiation person-time is \(v>0\), and its pre-initiation person-time is \(u>0\), the rate calculated by assigning both intervals to treated status is \(d/(u+v)\). When \(d>0\), this is strictly less than the post-initiation rate \(d/v\).

Proof. By the group definition, a person can enter the treated group only if treatment begins before the event. Therefore, for every group member, the event count during the pre-initiation interval is zero. Summing across people gives zero events in \(u\) pre-initiation person-time and \(d\) events in \(v\) post-initiation person-time. If both intervals are incorrectly labelled treated, the calculated rate is \(d/(u+v)\). Since \(u>0\), \(v>0\), and \(d>0\), we have \(u+v>v\), so

$$ \frac{d}{u+v}<\frac{d}{v}. $$

This proves dilution of the treated rate in this setup. It does not prove that every estimated treatment contrast will favor treatment: the other group’s rate, the outcome process, and the classification rule all matter. It establishes the mechanical contribution of the guaranteed event-free interval. \(\square\)

Worked Example: A Grace Period and an Event Before Initiation

Worked Example: Keeping the Strategies at a Common Time Zero

Suppose eligible patients are followed from day 0. The clinical question is whether starting treatment within 30 days is preferable to following a strategy of not starting during those 30 days. Patient P starts on day 12 and has no event during follow-up. Patient Q has the outcome on day 8 and, as a result, never starts treatment.

Under an “ever treated” comparison from day 0, P is labelled treated and Q untreated. P’s 12 pre-initiation days are credited to the treated group, although P had not yet received treatment. Q’s event is credited to the untreated group, even though Q’s status reflects an event that occurred before the treatment decision could be completed. The classification is based on what happened after time zero, not on a baseline assignment to strategies.

For a target trial asking about initiation within a 30-day grace period, define both strategies at day 0 and begin outcome follow-up for both at day 0. A participant may be compatible with either strategy while the grace period is open. In a cloning approach, the participant is represented under each strategy initially; a clone is artificially censored when the observed course becomes incompatible with that strategy, with the appropriate adjustment for this censoring handled by the design. Q’s day-8 event is recorded from the shared time zero rather than used to label Q retrospectively as a baseline non-initiator. This avoids assigning P’s pre-initiation days exclusively to a future-defined treated group.

The example illustrates alignment, not a complete analysis. The grace-period strategies must be precisely specified, and the resulting causal estimate still depends on the assumptions and methods needed for the emulation.

Three Ways to Align the Design

The appropriate repair depends on the clinical question. In each case, the goal is to make treatment definition and follow-up refer to a coherent time origin, rather than to use future treatment status as if it were known at baseline.

1
Define baseline initiation.
If the question concerns starting treatment now, identify eligible new users and comparators at a common time zero. Classify treatment using information available at that time, and start follow-up for both groups then.
2
Specify a grace-period strategy.
If treatment may begin within a stated window, define strategies at the start of that window. The earlier material on cloning and artificial censoring provides a way to represent and compare these strategies without assigning the pre-initiation interval to a future-defined group.
3
Use a landmark only when it answers the intended question.
Choose a fixed landmark, restrict the comparison to people eligible and event-free then, classify treatment using information available by that time, and begin follow-up at the landmark for everyone. The estimand now concerns that landmark population, not everyone eligible at the original time zero.

A fourth descriptive option is to treat exposure as time-varying: a person contributes untreated time before initiation and treated time afterward. This correctly allocates person-time, as in the first example. But changing the exposure variable does not automatically identify a causal effect. Treatment initiation can depend on changing health status or other prognostic factors, so a causal analysis may require methods for time-varying confounding, such as the marginal structural model methods taught in this course.

Worked Example: What a Landmark Changes

Worked Example: Choosing a Valid Landmark Interpretation

Imagine 100 eligible people at day 0. By day 30, 20 have had the outcome or died, and 80 are alive and outcome-free. Among those 80, 30 have initiated treatment by day 30 and 50 have not. An investigator compares subsequent outcomes in the 30 and 50 people, starting follow-up at day 30.

This can avoid assigning days 0 through 30 to groups defined by treatment status at day 30, because both groups start follow-up at the same landmark. However, the comparison is explicitly among the 80 people who remained alive and outcome-free to day 30. It does not estimate the effect of treatment strategies in the original 100-person population from day 0, and it does not count the 20 earlier events as outcomes in either post-landmark group.

To describe its estimand accurately, state the eligibility condition at day 30, the treatment classification rule at day 30, and the outcome follow-up window after day 30. Merely moving the start of follow-up to day 30 without defining that population and question is not a complete repair.

Diagnostics, Alternatives, and Limits

An effective audit starts with a timeline for each participant: eligibility, time zero, treatment initiation, outcome, and end of observation. Check whether the group label at time zero uses information that occurs later. Then ask whether a person in that group could have experienced the outcome before treatment initiation. If an event would have prevented the person from entering the future-treated group, the period before initiation is event-free by construction.

  • Tabulate events before initiation. If the future-treated group has no events in a pre-initiation interval because any such event would have made treatment impossible, that is a warning about the definition, not evidence that the interval was biologically protected.
  • Reconstruct person-time. Separate time before initiation from time after initiation. Confirm that event counts are allocated to the treatment status at the event time; in the first example, A and B die during treated time, while only C dies during untreated time.
  • Inspect the protocol and code. Compare the stated time zero and exposure rule with the actual dates used to assign groups and start follow-up. Look for rules such as “ever treated during follow-up” combined with follow-up beginning before treatment.
  • Check the outcome’s role. The guaranteed interval requires that the outcome, or a related event, prevent later treatment classification. If an outcome does not prevent initiation, the exact immortal-time argument may not apply, although future-based classification can still create other problems.

These repairs answer different questions. Baseline initiation designs target effects of initiating at time zero. Grace-period designs target strategies that permit treatment to start during a specified window. Landmark designs target people who are eligible and event-free at the landmark. Time-varying exposure descriptions track actual treatment status over time, but do not alone address confounding. No choice is automatically superior: the design must reflect the clinical decision being studied.

A common mistake is to say, “The treated group received treatment eventually, so its follow-up can start at cohort entry; the time before treatment is still part of their treated experience.” That reasoning confuses future membership with treatment received at a given time. Before initiation, the person is untreated. If the person’s survival until initiation is required for treated-group membership, counting that period as treated builds event-free time into the treated group. Align the treatment rule and follow-up first; then address confounding, measurement, and other assumptions separately.

Key takeaway: Never classify baseline treatment using future initiation and then count earlier follow-up as treated time without a design that explicitly handles the treatment window. Set a common time zero, specify the strategy at that time, and make sure that group membership does not require surviving through time already credited to the group.

Check Your Understanding

Answer each question, then check the short solutions below.

  1. A cohort labels patients treated if they initiate within 90 days, but starts outcome follow-up at eligibility. What timeline feature should you investigate first?
  2. In a future-treated group, pre-initiation person-time is 40 person-days, post-initiation time is 60 person-days, and there are 3 post-initiation events. Compare the rate when all time is labelled treated with the post-initiation rate.
  3. Why does counting time-varying untreated and treated person-time correctly not, by itself, establish a causal effect?
  4. What population does a day-30 landmark comparison address if it includes only people alive and outcome-free at day 30?

Solutions. For question 1, check whether an event before initiation would prevent treatment and thereby force the patient into the non-treated group; if so, the treated group’s pre-initiation interval is guaranteed event-free. For question 2, the mislabelled rate is \(3/(40+60)=0.03\) events per person-day, while the post-initiation rate is \(3/60=0.05\); the larger denominator dilutes the rate. For question 3, correct exposure-time allocation does not remove confounding by factors that affect both treatment initiation and outcome. For question 4, it addresses only the population eligible, alive, and outcome-free at day 30, with follow-up beginning at that landmark—not the full population from day 0.

Clinical Biostats