Session 2.2

Clone-censor-weighting approach

Louisa Smith

Returning to simple example of immortal time bias

Comparing mortality between:

  • long-term users of a medication (2+ years)
  • short-term users of a medication (<1 year)
  • non-users

The randomized trial solution

In randomized trials with full adherence:

  • People classified by assigned treatment duration
  • Not by observed treatment duration
    • People might not achieve the full treatment duration because they die! (Or because they have health problems that puts them more at risk for whatever you’re looking at, which is also a problem)
  • Dead people don’t deviate from assigned strategy

Hernán (2018) example: randomized trial

12 people randomly assigned to:

  • durA = 0: no aspirin
  • durA = 1: one year of aspirin
  • durA = 2: two years of aspirin

Because this is a randomized trial, we have the assigment labels

Person durA Aspirin year 1 Dead end year 1 Aspirin year 2 Dead end year 2
1 0 No No No No
2 0 No No No Yes
3 0 No No No Yes
4 0 No Yes - Yes
5 1 Yes No No No
6 1 Yes No No Yes
7 1 Yes No No Yes
8 1 Yes Yes - Yes
9 2 Yes No Yes No
10 2 Yes No Yes Yes
11 2 Yes No Yes Yes
12 2 Yes Yes - Yes

By assigned treatment

Two-year mortality by assigned treatment duration:

Assigned duration N Deaths at 2 years Mortality risk
0 4 3 0.75
1 4 3 0.75
2 4 3 0.75

No effects (again operating under the null!)

Moving to observational data

In observational data, we don’t observe durA (assigned treatment duration)

We only see:

  • what treatment people actually received
  • when they received it
  • when they died

By achieved treatment

Compare those who actually took aspirin for 2 years:

Person durA Aspirin year 1 Dead end year 1 Aspirin year 2 Dead end year 2
9 2 Yes No Yes No
10 2 Yes No Yes Yes
11 2 Yes No Yes Yes

Risk of death after 2 years = 2/3

By achieved treatment

To those who actually took it for 1 year:

Person durA Aspirin year 1 Dead end year 1 Aspirin year 2 Dead end year 2
5 1 Yes No No No
6 1 Yes No No Yes
7 1 Yes No No Yes
8 1 Yes Yes - Yes
12 2 Yes Yes - Yes

Risk of death after 2 years = 4/5

By achieved treatment

To those who took it for 0 years:

Person durA Aspirin year 1 Dead end year 1 Aspirin year 2 Dead end year 2
1 0 No No No No
2 0 No No No Yes
3 0 No No No Yes
4 0 No Yes - Yes

Risk of death after 2 years = 3/4

Why the bias occurs

People who achieved 2 years of treatment:

  • had to survive the first year (immortal time)
  • are a selected subset of those assigned to 2 years

The naive analysis treats survival to 2 years as if it were irrelevant to the outcome when it is in fact the outcome

The three-step solution

  • Step 1: cloning - assign people to treatment strategies at time zero (when they meet eligibility criteria)
  • Step 2: censoring - censor clones when they deviate from assigned strategy (in this case, they stop taking aspiring while still alive but before they were supposed to)
  • Step 3: weighting - adjust for selection bias from censoring

Step 1: cloning

For each person, create clones for all treatment strategies compatible with their observed data at time zero

scenario person durA aspirin_year1
Observed 5 ? Yes
Assigned to 1 year 5a 1 Yes
Assigned to 2 years 5b 2 Yes

Person 5 received treatment at time zero → gets cloned to both durA = 1 and durA = 2

Cloning all participants

Clone durA Aspirin year 1 Dead end year 1 Aspirin year 2 Dead end year 2
1 0 No No No No
2 0 No No No Yes
3 0 No No No Yes
4 0 No Yes - Yes
5a 1 Yes No No No
6a 1 Yes No No Yes
7a 1 Yes No No Yes
8a 1 Yes Yes - Yes
9a 1 Yes No Yes No
10a 1 Yes No Yes Yes
11a 1 Yes No Yes Yes
12a 1 Yes Yes - Yes
5b 2 Yes No No No
6b 2 Yes No No Yes
7b 2 Yes No No Yes
8b 2 Yes Yes - Yes
9b 2 Yes No Yes No
10b 2 Yes No Yes Yes
11b 2 Yes No Yes Yes
12b 2 Yes Yes - Yes

Step 2: censoring

Censor clones when their observed data becomes incompatible with assigned strategy:

  • durA = 1 clones censored if they take aspirin in year 2
  • durA = 2 clones censored if they don’t take aspirin in year 2

Note that we could have cloned ids 5-12 to durA = 0 and “censored” them immediately, and cloned ids 1-4 to durA = 1 and durA = 2 and “censored” them immediately.

Censoring

Clone durA Aspirin year 2 (observed) Aspirin year 2 (required) Censored?
9a 1 Yes No Yes
10a 1 Yes No Yes
11a 1 Yes No Yes
9b 2 Yes Yes No
10b 2 Yes Yes No
11b 2 Yes Yes No

Clones 9a, 10a, 11a are censored because they didn’t adhere to their assigned strategy

In this example, no one started aspirin after not taking it in year 1, but that would be another reason for censoring

After censoring

Clone durA Aspirin year 1 Dead end year 1 Aspirin year 2 Dead end year 2
1 0 No No No No
2 0 No No No Yes
3 0 No No No Yes
4 0 No Yes - Yes
5a 1 Yes No No No
6a 1 Yes No No Yes
7a 1 Yes No No Yes
8a 1 Yes Yes - Yes
12a 1 Yes Yes - Yes
8b 2 Yes Yes - Yes
9b 2 Yes No Yes No
10b 2 Yes No Yes Yes
11b 2 Yes No Yes Yes
12b 2 Yes Yes - Yes

Step 3: weighting

Selection bias introduced by censoring must be corrected

Use inverse probability weighting:

  • weight = 1 / (probability of being uncensored)
    • This would be conditional on current values of covariates if we had them
    • Since censoring is generally due to taking treatment when you shouldn’t have, or not taking treatment when you should have, this is basically a propensity score (from a model for treatment at a given time point)
  • Transfers weight from censored to uncensored observations

Calculating weights

For durA = 0 strategy:

  • No one was censored → everyone has weight = 1

Calculating weights

For durA = 1 strategy:

  • Persons 8 and 12 died before they had the “opportunity” to be censored → weight = 1
    • We’re really only calculating weights for year 2
  • In year 2, persons 9, 10, and 11 were censored and persons 5, 6, and 7 were uncensored
    • Probability of being uncensored = 3/6 = 0.5 → weight = 2 for persons 5, 6, and 7

Calculating weights

For durA = 2 strategy:

  • Persons 8 and 12 died before they had the “opportunity” to be censored → weight = 1
  • In year 2, persons 5, 6, and 7 were censored and persons 9, 10, and 11 were uncensored
    • Probability of being uncensored = 3/6 = 0.5 → weight = 2 for persons 9, 10, and 11

Weighted data

Clone durA Aspirin year 1 Dead end year 1 Aspirin year 2 Dead end year 2 Weight
1 0 No No No No 1
2 0 No No No Yes 1
3 0 No No No Yes 1
4 0 No Yes - Yes 1
5a 1 Yes No No No 2
6a 1 Yes No No Yes 2
7a 1 Yes No No Yes 2
8a 1 Yes Yes - Yes 1
12a 1 Yes Yes - Yes 1
8b 2 Yes Yes - Yes 1
9b 2 Yes No Yes No 2
10b 2 Yes No Yes Yes 2
11b 2 Yes No Yes Yes 2
12b 2 Yes Yes - Yes 1

Weighted analysis

Treatment duration Weighted N Weighted deaths Mortality risk
0 4 3 0.75
1 8 6 0.75
2 8 6 0.75

Yay!

Why it works

The three steps:

  1. Cloning eliminates immortal time bias by assigning strategies at time zero
  2. Censoring ensures clones follow their assigned strategy
  3. Weighting corrects for selection bias introduced by censoring

Extensions

This approach can handle:

  • multiple time points
  • time-varying confounding
  • loss to follow-up
  • complex sustained treatment strategies

Additional inverse probability weighting may be needed for baseline confounding adjustment

When to use clone-censor-weighting

Use when studying:

  • treatment duration effects
  • sustained treatment strategies that evolve over time
  • any strategy where assignment isn’t identifiable at time zero

Alternative: g-formula

Key assumptions

Validity requires:

  • No unmeasured confounding (of baseline treatment and treatment continuation/discontinuation/changes)
  • Correct specification of treatment/censoring models
  • Positivity (some probability of continuing the treatment strategy – being uncensored – at each time)

Hernán, Miguel A. 2018. “How to Estimate the Effect of Treatment Duration on Survival Outcomes Using Observational Data.” BMJ 360 (February): k182. https://doi.org/10.1136/bmj.k182.