Tutorials › Bayesian Clinical Trials › Detecting Immortal-Time Bias

External and Real-World Controls · Tutorial 365 of 696

Detecting Immortal-Time Bias

Learn to detect guaranteed event-free time created by future-based treatment definitions and choose an analysis that aligns eligibility, exposure, and follow-up.

Advanced 12 min read

What You'll Learn

  • Define immortal time and explain how future-based exposure assignment can create it.
  • Trace eligibility, treatment, outcome, and follow-up dates to detect misalignment.
  • Calculate how guaranteed event-free time can distort risks and event rates.
  • Compare baseline assignment, landmark analysis, and time-varying exposure definitions.
  • Identify what each repair changes and which limitations remain.
  • Distinguish correction of immortal-time bias from control of confounding.

Why Treatment Timing Matters

In an external-control comparison, treatment may begin after a patient first becomes eligible for follow-up. If an analysis labels patients as treated because they receive treatment at any later point, it uses future information to assign their status at an earlier time. A patient must remain alive and under observation long enough to receive that treatment. The interval before treatment is therefore guaranteed to be free of the outcome of death for patients later classified as treated. Counting that interval as treated follow-up can make treatment appear more protective than it is.

The key design requirement is alignment: eligibility, assignment to a treatment strategy, and the start of outcome follow-up must refer to the same time origin, or the analysis must explicitly represent changes in exposure over time. Earlier material on setting time zero and defining treatment strategies provides the relevant vocabulary. Here the focus is the specific bias created when treatment or eligibility depends on what happens after time zero.

Definition: Immortal-time bias is bias that can arise when a period during which a patient must remain free of a specified outcome in order to be classified into an exposure group is incorrectly attributed to that group’s follow-up. For death as the outcome, a patient who must survive until treatment initiation has an event-free interval before initiation. The bias is especially likely when exposure is defined using future treatment receipt but follow-up begins earlier.

The word “immortal” is relative to the outcome and the exposure rule, not a claim that the patient cannot experience any adverse event. For example, if eligibility for a treatment group requires surviving until a prescription is recorded, the interval before that record is immortal with respect to death under that rule. An outcome that can occur during the interval does not necessarily have the same guaranteed-free property.

A useful way to audit a comparison is to write down, for each group, four dates: when a patient becomes eligible, when treatment status is determined, when follow-up begins, and when the outcome is counted. Then ask whether a patient can experience the outcome during any time that the analysis later assigns to the treated group. If treatment classification requires that the patient survive that interval, but the interval is nevertheless counted as treated time, the definition and analysis are misaligned.

How the Bias Enters the Calculation

Let \(t_0\) be the common eligibility and follow-up time, and let \(T_i\) be patient \(i\)'s treatment-initiation time. A common but problematic rule sets \(A_i=1\) if the patient initiates treatment at any time after \(t_0\), and then treats \(A_i\) as though it described exposure from \(t_0\) onward. For death, a patient classified this way must have survived to \(T_i\). Thus, before \(T_i\), the patient contributes no death event to the eventual-treatment group by construction.

$$ A_i=1 \text{ because treatment occurs at } T_i>t_0 \quad\Longrightarrow\quad \text{the patient was alive at every time from } t_0 \text{ to } T_i. $$

If the pre-treatment interval is counted as exposed follow-up, the treated group gains event-free time that is not comparable to follow-up in the untreated group. When estimating a risk from time zero, the same problem can appear as selection: patients who die before they could initiate treatment cannot enter the “ever treated” group. In either case, an apparent treatment advantage can arise even if treatment itself has no beneficial effect.

This argument identifies one source of bias; it does not establish that every difference between treatment groups is due to immortal time. Treatment choice, prognosis, calendar time, data availability, and censoring can also differ. Correcting the timing mismatch is necessary, but does not by itself make groups exchangeable or establish a causal treatment effect.

Worked Example: A Future-Based “Ever Treated” Group

Hypothetical data. Consider 100 patients eligible on day 0, with death followed through day 365. Forty patients initiate treatment on day 30, and all are alive at that time; 8 die between days 30 and 365. The other 60 never initiate treatment; 12 die by day 30 and 18 die after day 30. Compare the crude death risks when patients are classified at day 0 by whether they ever receive treatment.

The ever-treated group has 40 patients and 8 deaths, so its observed risk is \(8/40=0.200\), or 20.0%. The never-treated group has 60 patients and 30 deaths, giving \(30/60=0.500\), or 50.0%. The crude risk difference, ever-treated minus never-treated, is \(0.200-0.500=-0.300\), or 30.0 percentage points lower in the ever-treated group.

That difference cannot be read as a treatment effect. Every one of the 40 ever-treated patients had to survive from day 0 to day 30 to receive treatment. By contrast, the 12 deaths before day 30 are necessarily counted among the never-treated patients. The comparison gives the ever-treated group guaranteed survival time and counts it from day 0 as though those patients were already treated. The calculation is correct for the stated classification; the classification is unsuitable for estimating the effect of treatment beginning on day 30.

Repairs That Align Time and Exposure

There is no single repair for every question. The appropriate approach depends on the treatment strategies of interest and on when those strategies are defined. Three common approaches make the alignment explicit: define treatment at a shared baseline, begin a landmark comparison among patients who reach that landmark, or represent exposure as changing over follow-up.

1
State the time origin and strategies.
Specify when patients are eligible, what it means to follow each treatment strategy, and when outcomes begin to count. Avoid defining baseline treatment status by a future event unless the analysis explicitly handles the intervening period.
2
Choose an exposure representation that matches the question.
Use treatment assigned at baseline for strategies defined at baseline, a landmark for a comparison among landmark survivors, or a time-varying exposure when treatment can start during follow-up.
3
Recheck event and follow-up accounting.
Confirm that no interval is credited to a group only because its members had to survive through that interval. State the population and follow-up period to which the resulting comparison applies.

Baseline strategy assignment

When the scientific question concerns strategies assigned at eligibility, treatment strategies should be defined at that time. For instance, “initiate now” and “do not initiate now” are baseline strategies; a patient’s later treatment receipt must not be used to retroactively assign baseline status. In some settings, treatment is permitted to start within a prespecified grace period. That creates a more complex design problem: the strategies and the handling of events during the grace period must be specified in advance. Simply labeling everyone who eventually initiates as treated from day 0 does not solve it.

Landmark analysis

A landmark analysis chooses a fixed time after eligibility, includes patients who are alive and eligible at that time, classifies exposure using information available by that time, and begins outcome follow-up at the landmark. This removes guaranteed pre-landmark survival time from the outcome comparison because that time is not included in follow-up. The estimand changes: the comparison is among patients who reached the landmark, not among everyone eligible at the original time zero. The landmark and exposure rule should be clinically justified rather than selected after inspecting which choice gives a preferred result.

Worked Example: Repeating the Comparison at Day 30

Use the hypothetical data above. At day 30, the 40 patients who initiated treatment are alive. Of the 60 never-treated patients, 12 have died, leaving 48 alive. Begin follow-up at day 30 and compare these day-30 survivors by whether they initiated treatment by that time.

Among treated day-30 survivors, the subsequent risk through day 365 is \(8/40=0.200\), or 20.0%. Among untreated day-30 survivors, it is \(18/48=0.375\), or 37.5%. The landmark risk difference is \(0.200-0.375=-0.175\), or 17.5 percentage points lower in the treated group.

The treated group no longer receives credit for days 0–30 in its outcome follow-up. The denominator of the comparison also changes: the 12 patients who died before day 30 are outside the landmark population, as are any other patients who did not reach day 30. The lower treated-group risk is therefore a descriptive comparison among day-30 survivors, not a risk difference for all 100 patients from day 0 and not, by itself, a causal effect. Differences in prognosis or treatment selection can remain.

Time-varying exposure

If treatment can start during follow-up and the question concerns exposure as it changes, represent each patient as unexposed before initiation and exposed after initiation. A patient who starts on day 30 contributes unexposed time from day 0 to day 30 and treated time only thereafter. This prevents pre-initiation time from being attributed to treatment. The approach requires accurate treatment dates and a clearly specified outcome-time calculation. A time-varying exposure definition addresses the timing error, but alone does not address confounding that changes over time or differences in patient prognosis.

Worked Example: Reclassifying Person-Time When Exposure Changes

Hypothetical person-time summary. Twenty patients eventually start treatment. Together they contribute 20 person-years before initiation, with no deaths during that pre-initiation time, and 20 person-years after initiation, with 4 deaths. Sixty patients never start treatment and contribute 60 person-years with 12 deaths. Compare a fixed “ever treated” rate calculation with a time-varying calculation. Assume the stated person-time and events are complete for this illustration.

With the fixed ever-treated label, all 40 person-years from the eventual initiators are put in the treated group. Its rate is \(4/40=0.100\) deaths per person-year. The never-treated rate is \(12/60=0.200\) deaths per person-year. The crude rate ratio is \(0.100/0.200=0.500\).

With time-varying exposure, the 20 pre-initiation person-years are added to unexposed time, not treated time. The treated rate becomes \(4/20=0.200\) deaths per person-year. The unexposed group includes 20 pre-initiation person-years with 0 deaths and 60 never-treated person-years with 12 deaths, so its rate is \(12/(20+60)=0.150\) deaths per person-year. The crude rate ratio is \(0.200/0.150=1.33\).

The contrast changes because 20 event-free person-years have moved out of the treated denominator. These rates are descriptive, and the reversal does not establish that treatment increases mortality: the groups’ follow-up times or underlying risks may differ. The calculation demonstrates why future-based “ever treated” classification can distort an event rate even when all arithmetic is performed correctly.

Diagnostics, Alternatives, and Limitations

A practical audit should use the dates and rules in the actual analysis, not only its group labels. For each patient, compare eligibility, first treatment, outcome, end of follow-up, and censoring dates. Summarize how much follow-up occurs before treatment among patients labeled treated, and determine whether events in that interval are excluded, counted as untreated, or incorrectly assigned to treatment. Tabulate deaths or other outcomes during any interval that treatment-group membership requires patients to survive. Large amounts of pre-treatment follow-up assigned to the treated group are a warning sign.

The main approaches answer different questions and require different data. The table summarizes their distinction.

ApproachExposure definition and follow-upPopulation and key limitation
Baseline strategy assignmentDefine strategies at the shared eligibility time; count outcomes from that time under the specified strategies.Targets a baseline strategy question. A grace period needs explicit rules for events and treatment initiation; future receipt alone is not a valid baseline assignment.
Landmark analysisClassify exposure by a fixed landmark and begin outcome follow-up there.Targets patients who survive and remain eligible to the landmark. Results may depend on the landmark choice and do not describe all baseline-eligible patients.
Time-varying exposureCount time before initiation as unexposed and time after initiation as exposed.Represents treatment changes over follow-up. It does not by itself remove confounding or ensure that exposure and outcome dates are measured correctly.

Common warning signs include an “ever treated” variable determined using the full follow-up period, an exposure group whose members cannot experience the outcome before their treatment date, and a treatment group with substantial follow-up that precedes initiation. A null result does not rule out the problem: bias may alter a contrast in either direction depending on the data and analysis. Conversely, a difference between groups is not proof that immortal-time bias occurred. The date rules must establish the mechanism.

A Bayesian model does not automatically repair this design error. A posterior distribution can quantify uncertainty conditional on the data, likelihood, and model, but it cannot make a future-defined exposure equivalent to baseline assignment. The time origin and exposure definition need to be corrected before interpreting a posterior treatment-effect estimate. Likewise, a timing repair does not automatically correct confounding, measurement error, or informative censoring.

Common Mistakes

  • Calling later treatment “baseline treatment.” The fact that a patient eventually receives treatment does not mean the patient was exposed from eligibility onward. Use the actual initiation date or define a strategy at baseline.
  • Thinking a larger sample fixes the problem. More patients can make a biased estimate more precise. Precision does not remove guaranteed event-free time.
  • Treating a landmark result as the original-cohort effect. A landmark comparison excludes people who did not reach that time and answers a question about landmark survivors.
  • Assuming a time-varying exposure solves all bias. It corrects the attribution of pre-initiation time, but confounding and other design problems may remain.
  • Assuming every pre-treatment interval is immortal for every outcome. The guaranteed-free property depends on the outcome and the rule used to define exposure or eligibility.
Key takeaway: If treatment-group membership depends on future treatment receipt, ask whether patients had to remain free of the outcome to enter that group. Align eligibility, exposure, and follow-up; then interpret the resulting comparison only for the population and treatment strategies it actually represents.

Check Your Understanding

Answer each question, then check the brief solutions below.

  1. A study labels patients treated if they begin a drug within 60 days of eligibility, but starts treated-group follow-up on the eligibility date. What timing question should be checked first?
  2. In a landmark analysis at day 60, what happens to patients who die on day 20, and what population does the analysis describe?
  3. In a time-varying analysis, a patient starts treatment on day 18. How should the interval from day 0 through day 18 be classified?
  4. Why does correcting immortal-time bias not prove that a treatment comparison is causal?

Solutions. (1) Check whether patients must survive and remain observed until treatment initiation to be labeled treated, and whether pre-initiation time is incorrectly counted as treated follow-up. (2) A patient who dies before day 60 is not a day-60 survivor and is excluded from the landmark risk comparison; the analysis describes eligible patients who reached day 60, not everyone eligible at baseline. (3) Count the pre-initiation interval as unexposed and count exposed follow-up only after treatment starts, according to the stated timing convention. (4) The repair addresses the attribution of guaranteed event-free time, but groups may still differ in prognosis, treatment selection, measurement, or censoring.

Clinical Biostats