Session 3.1

Grace periods and treatment timing

Louisa Smith

Today’s examples

We’ll walk through two clone-censor-weighting examples:

  1. Grace period example: Treatment vs. no treatment within first trimester

  2. Treatment timing example: Comparing three strategies specifying gestational age at treatment

Both illustrate how to handle situations where treatment assignment and initiation are not instantaneous

Example 1: grace period

Research question: Does first-trimester treatment (started by week 14) vs. no treatment affect risk of pregnancy loss?

  • Time zero: 6 weeks gestation
  • Grace period: 8 weeks (until week 14)
  • Strategies:
    • Strategy 0: Don’t start treatment within first trimester
    • Strategy 1: Start treatment by week 14

The data

ID Week treatment started Gestational week at end of pregnancy
1 1000 18
2 36 40
3 1000 19
4 10 11
5 12 39
6 16 41
7 8 17
8 1000 36
9 13 38
10 1000 16
11 15 40
12 11 39

Create clones

ID Treatment strategy Time zero Week treatment started Gestational week at end of pregnancy
1 0 6 1000 18
1 1 6 1000 18
2 0 6 36 40
2 1 6 36 40
3 0 6 1000 19
3 1 6 1000 19
4 0 6 10 11
4 1 6 10 11
5 0 6 12 39
5 1 6 12 39
6 0 6 16 41
6 1 6 16 41
7 0 6 8 17
7 1 6 8 17
8 0 6 1000 36
8 1 6 1000 36
9 0 6 13 38
9 1 6 13 38
10 0 6 1000 16
10 1 6 1000 16
11 0 6 15 40
11 1 6 15 40
12 0 6 11 39
12 1 6 11 39

Each person gets cloned into both treatment strategies at time zero

Clone 0 censoring rules

Clone 0 (never treat strategy): censored if they start treatment during grace period

ID Week treatment started Gestational week at end of pregnancy Censored Censoring time Outcome Outcome time
1 1000 18 0 14 1 18
2 36 40 0 14 1 40
3 1000 19 0 14 1 19
4 10 11 1 10 0 10
5 12 39 1 12 0 12
6 16 41 0 14 1 41
7 8 17 1 8 0 8
8 1000 36 0 14 1 36
9 13 38 1 13 0 13
10 1000 16 0 14 1 16
11 15 40 0 14 1 40
12 11 39 1 11 0 11

Clone 1 censoring rules

Clone 1 (treat by week 14 strategy): censored if they don’t start treatment by end of grace period

ID Week treatment started Gestational week at end of pregnancy Censored Censoring time Outcome Outcome time
1 1000 18 1 14 0 14
2 36 40 1 14 0 14
3 1000 19 1 14 0 14
4 10 11 0 11 1 11
5 12 39 0 12 1 39
6 16 41 1 14 0 14
7 8 17 0 8 1 17
8 1000 36 1 14 0 14
9 13 38 0 13 1 38
10 1000 16 1 14 0 14
11 15 40 1 14 0 14
12 11 39 0 11 1 39

Combined results

ID Treatment Week treatment started Censoring time Censored Outcome time Outcome
1 0 1000 14 0 18 1
1 1 1000 14 1 14 0
2 0 36 14 0 40 1
2 1 36 14 1 14 0
3 0 1000 14 0 19 1
3 1 1000 14 1 14 0
4 0 10 10 1 10 0
4 1 10 11 0 11 1
5 0 12 12 1 12 0
5 1 12 12 0 39 1
6 0 16 14 0 41 1
6 1 16 14 1 14 0
7 0 8 8 1 8 0
7 1 8 8 0 17 1
8 0 1000 14 0 36 1
8 1 1000 14 1 14 0
9 0 13 13 1 13 0
9 1 13 13 0 38 1
10 0 1000 14 0 16 1
10 1 1000 14 1 14 0
11 0 15 14 0 40 1
11 1 15 14 1 14 0
12 0 11 11 1 11 0
12 1 11 11 0 39 1

Looking only at people who adhered through follow-up

ID Treatment Week treatment started Censoring time Censored Outcome time Outcome
1 0 1000 14 0 18 1
2 0 36 14 0 40 1
3 0 1000 14 0 19 1
4 1 10 11 0 11 1
5 1 12 12 0 39 1
6 0 16 14 0 41 1
7 1 8 8 0 17 1
8 0 1000 14 0 36 1
9 1 13 13 0 38 1
10 0 1000 14 0 16 1
11 0 15 14 0 40 1
12 1 11 11 0 39 1

Grace periods handle uncertainty

During weeks 6-14, we don’t know who will ultimately be “treated” or “untreated”

  • Each person contributes to both strategies until their status is determined
  • Early pregnancy losses are properly attributed to both groups
  • Eliminates immortal time bias

Example 2: treatment timing

Research question: What is the optimal timing for treatment initiation?

  • Time zero: 8 weeks gestation
  • Strategies:
    • Strategy 1: Start treatment at week 12
    • Strategy 2: Start treatment at week 14
    • Strategy 3: Start treatment at week 16

Treatment timing data

ID Week treatment started Gestational week at end of pregnancy
1 12 40
2 1000 11
3 10 11
4 14 39
5 18 41
6 8 17
7 1000 36
8 16 38
9 12 13
10 15 39
11 17 42
12 1000 15

Create three clones

Each person gets cloned into all three treatment timing strategies

ID Planned week treatment started Time zero Week treatment started Gestational week at end of pregnancy
1 12 8 12 40
1 14 8 12 40
1 16 8 12 40
2 12 8 1000 11
2 14 8 1000 11
2 16 8 1000 11
3 12 8 10 11
3 14 8 10 11
3 16 8 10 11
4 12 8 14 39
4 14 8 14 39
4 16 8 14 39
5 12 8 18 41
5 14 8 18 41
5 16 8 18 41
6 12 8 8 17
6 14 8 8 17
6 16 8 8 17
7 12 8 1000 36
7 14 8 1000 36
7 16 8 1000 36
8 12 8 16 38
8 14 8 16 38
8 16 8 16 38
9 12 8 12 13
9 14 8 12 13
9 16 8 12 13
10 12 8 15 39
10 14 8 15 39
10 16 8 15 39
11 12 8 17 42
11 14 8 17 42
11 16 8 17 42
12 12 8 1000 15
12 14 8 1000 15
12 16 8 1000 15

Clone 1: treat at week 12

ID Week treatment started Gestational week at end of pregnancy Censored Censoring time Outcome Outcome time
1 12 40 0 12 1 40
2 1000 11 0 11 1 11
3 10 11 1 10 0 10
4 14 39 1 12 0 12
5 18 41 1 12 0 12
6 8 17 1 8 0 8
7 1000 36 1 12 0 12
8 16 38 1 12 0 12
9 12 13 0 12 1 13
10 15 39 1 12 0 12
11 17 42 1 12 0 12
12 1000 15 1 12 0 12

Clone 2: treat at week 14

ID Week treatment started Gestational week at end of pregnancy Censored Censoring time Outcome Outcome time
1 12 40 1 12 0 12
2 1000 11 0 11 1 11
3 10 11 1 10 0 10
4 14 39 0 14 1 39
5 18 41 1 14 0 14
6 8 17 1 8 0 8
7 1000 36 1 14 0 14
8 16 38 1 14 0 14
9 12 13 1 12 0 12
10 15 39 1 14 0 14
11 17 42 1 14 0 14
12 1000 15 1 14 0 14

Clone 3: treat at week 16

ID Week treatment started Gestational week at end of pregnancy Censored Censoring time Outcome Outcome time
1 12 40 1 12 0 12
2 1000 11 0 11 1 11
3 10 11 1 10 0 10
4 14 39 1 14 0 14
5 18 41 1 16 0 16
6 8 17 1 8 0 8
7 1000 36 1 16 0 16
8 16 38 0 16 1 38
9 12 13 1 12 0 12
10 15 39 1 15 0 15
11 17 42 1 16 0 16
12 1000 15 0 15 1 15

All clones who followed their assigned strategy

ID Planned week treatment started Week treatment started Outcome time
1 12 12 40
2 12 1000 11
2 14 1000 11
2 16 1000 11
4 14 14 39
8 16 16 38
9 12 12 13
12 16 1000 15

Cloning-censoring-weighting tips

  • Descriptive analysis beforehand will help tell you what treatment strategies you have positivity for
    • i.e., anyone has a chance of following
  • It’s really easy to mess up – start with a few examples to develop your code
    • Be sure they cover all different posssibilities
  • Time-to-event outcomes are nice because you get to use clones’ data until they’re censored
    • Same with outcomes that you can estimate with time-to-event models, like pregnancy loss by 20 weeks or preterm birth by 37 weeks
    • If looking at a continuous outcome (e.g., birthweight), you only get to use data for people who followed a strategy through the end of follow-up