Tutorials › Marginal Structural Models › Longitudinal TMLE for Survival Risk

Longitudinal Targeted Maximum Likelihood · Tutorial 384 of 501

Longitudinal TMLE for Survival Risk

Build a longitudinal TMLE for survival at a specified time by combining sequential survival regressions, treatment-policy targeting, and appropriate handling of censoring.

Advanced 12 min read

What You'll Learn

  • Represent event occurrence and censoring across discrete follow-up intervals.
  • Define survival and risk at a specified time under a longitudinal treatment policy.
  • State the assumptions that identify policy-specific survival from observed data.
  • Derive the backward survival recursion and explain its sequential targeting updates.
  • Work through survival calculations and a weighted logistic fluctuation.
  • Recognize censoring, positivity, and model-fit diagnostics relevant to survival TMLE.

Why survival requires a longitudinal target

A survival probability at a specified time is a marginal probability: it describes the proportion of a target population that would remain event-free under a treatment policy. It is not, in general, the survival probability among people whose event status happened to be observed. Follow-up can end before the target time, and treatment decisions or covariates may change over time. A longitudinal targeted maximum likelihood estimator (TMLE) represents these features as a sequence, then targets the sequential regressions to the survival parameter of interest.

We work in discrete time, with intervals \(t=1,\ldots,K\). This is natural when events are recorded at scheduled visits or when the scientific target is survival through a specified visit. The endpoint is the end of interval \(K\); other time points are handled by choosing the corresponding interval as the endpoint.

Definition: Let \(D_t\) indicate an event during interval \(t\), and let \(C_t\) indicate censoring after the event status for interval \(t\) is ascertained. Let \(R_t\) indicate that the person is observed and event-free at the start of interval \(t\), with \(R_1=1\). Then $$ R_{t+1}=R_t(1-D_t)(1-C_t). $$ The event time is \(T=\min\{t:D_t=1\}\), with \(T=\infty\) if no event occurs by \(K\). Survival through interval \(k\) is \(S(k)=P(T>k)\), and risk by that time is \(1-S(k)\).

This convention makes the order explicit: an event in interval \(t\) is observed before censoring after that interval. Someone censored after remaining event-free in interval \(t\) has known event-free status through \(t\), but their later event status is unknown. A person who has an event is no longer at risk in later intervals.

Policy-specific survival and its assumptions

Let \(W\) denote baseline covariates, \(A_t\) treatment in interval \(t\), and \(L_t\) time-varying covariates measured before that interval's treatment. Write \(\mathcal H_t\) for the observed covariate and treatment history available just before \(A_t\). A longitudinal treatment policy \(g\) specifies a distribution \(g_t(a\mid\mathcal H_t)\) for treatment at each time. A deterministic regime is the special case that assigns a single treatment value at each history.

The target \(S^g(K)=P(T^g>K)\) is survival through \(K\) if treatment were assigned according to \(g\). Its complement \(1-S^g(K)\) is the policy-specific event risk. Identification from observed data requires consistency, sequential exchangeability of treatment, positivity for treatment values assigned by \(g\), and conditionally independent censoring. In particular, conditional on the observed history and treatment, censoring must not carry additional information about future event outcomes. The corresponding censoring probabilities must also be positive on histories relevant under \(g\). These assumptions are substantive; targeting does not make them true.

Identification conditions: Consistency links observed outcomes to the outcomes under the treatment actually received. Sequential exchangeability states that, given the measured history, treatment assignment is independent of future counterfactual outcomes. Treatment positivity requires \(g_t(a\mid\mathcal H_t)>0\) only where the observed treatment probability \(p_t(a\mid\mathcal H_t)>0\). Conditional independent censoring and censoring positivity allow the event process after censoring to be recovered from those still observed.

Define a backward sequence of conditional survival regressions under the full-data law. Set \(q_{K+1}=1\). For \(t=K,\ldots,1\), define

$$ m_t(\mathcal H_t,a) = E\!\left[(1-D_t)q_{t+1}(\mathcal H_{t+1}) \mid \mathcal H_t,A_t=a,R_t=1\right], \qquad q_t(\mathcal H_t) = \sum_a g_t(a\mid\mathcal H_t)m_t(\mathcal H_t,a). $$

For continuous treatment, the sum is an integral. In the final interval \(q_{K+1}=1\), so \(m_K\) is the conditional probability of surviving interval \(K\). At earlier times, the regression averages the probability of surviving the current interval and all remaining intervals. Censoring makes some later outcomes unobserved; fitting and targeting these regressions therefore requires appropriate censoring adjustment.

Theorem: Under consistency, sequential exchangeability, treatment and censoring positivity, and conditional independent censoring, the policy-specific survival probability is $$ S^g(K)=E[q_1(\mathcal H_1)]. $$

Proof. Under policy \(g\), conditional on the history before treatment in interval \(t\), treatment is drawn from \(g_t\). Conditional on the treatment value \(a\), surviving the interval and all subsequent intervals has probability equal to the conditional expectation of \((1-D_t)q_{t+1}(\mathcal H_{t+1})\). Averaging first over the policy's treatment distribution gives \(q_t(\mathcal H_t)\). Starting at \(t=K\), where the probability of surviving beyond \(K\) after interval \(K\) is represented by \(q_{K+1}=1\), and iterating this argument backward yields the probability of surviving all \(K\) intervals conditional on the initial history. Averaging over the baseline history gives \(E[q_1(\mathcal H_1)]\). Exchangeability and consistency replace the counterfactual conditional distributions in this recursion by the corresponding observed-data distributions; positivity and independent censoring ensure those distributions are estimable from observed histories. \(\square\)

How longitudinal targeting enters

An initial estimate is obtained by fitting the sequence of regressions from the last interval backward, substituting each fitted \(q_{t+1}\) into the regression for interval \(t\), and integrating over the policy \(g_t\). The final initial plug-in estimate is the sample average of the fitted \(q_1\). A longitudinal TMLE then updates these regressions so that their empirical score equations target the policy-specific survival parameter.

For a binary survival outcome, a standard fluctuation is logistic. At step \(t\), let \(Z_t=(1-D_t)q_{t+1}(\mathcal H_{t+1})\), using the updated later regression. The conditional mean model is fluctuated as

$$ \operatorname{logit}m_t^\epsilon = \operatorname{logit}\widehat m_t +\epsilon_t\mathsf H_t. $$

Here \(\mathsf H_t\) is the clever covariate: it incorporates the likelihood ratio for following \(g\) rather than the observed treatment mechanism and the inverse probability of remaining uncensored for the required outcome. A common schematic form on the relevant observed risk set is

$$ \mathsf H_t = \frac{\prod_{s=1}^{t}g_s(A_s\mid\mathcal H_s)/p_s(A_s\mid\mathcal H_s)} {G_{t+1}}, $$

where \(p_s\) is the observed treatment probability and \(G_{t+1}\) is the conditional probability of remaining uncensored long enough to observe the outcome needed at this step. Exact risk-set indicators and the censoring survival term must match the data's event/censoring timing convention. The fluctuation parameter is chosen to solve the weighted score equation, schematically \(P_n[\mathsf H_t(Z_t-m_t^{\epsilon})]=0\) over records contributing an observed outcome to that step. If an event makes the continuation outcome known to be zero, that known outcome can be used without requiring later follow-up.

After updating \(m_t\), integrate it under \(g_t\) to obtain the updated \(q_t\); then use that updated regression in the preceding step. The final estimate is the average of the updated baseline predictions. This backward procedure ensures that changes at a later step are propagated into earlier predictions rather than being added only to the terminal estimate.

Result: In the logistic fluctuation above, the derivative of the weighted Bernoulli log-likelihood with respect to \(\epsilon_t\) is proportional to \(P_n[\mathsf H_t(Z_t-m_t^\epsilon)]\). Thus solving the fluctuation score equation sets this empirical weighted residual to zero.

Derivation. For one contribution with outcome \(Z\), fitted mean \(\mu_\epsilon=\operatorname{expit}(\operatorname{logit}\widehat m+\epsilon\mathsf H)\), and weight \(w\), the Bernoulli log-likelihood contribution is \(w\{Z\log\mu_\epsilon+(1-Z)\log(1-\mu_\epsilon)\}\). Since \(\partial\mu_\epsilon/\partial\epsilon=\mathsf H\mu_\epsilon(1-\mu_\epsilon)\), differentiating gives

$$ w\left(\frac{Z}{\mu_\epsilon}-\frac{1-Z}{1-\mu_\epsilon}\right) \mathsf H\mu_\epsilon(1-\mu_\epsilon) = w\mathsf H(Z-\mu_\epsilon). $$

Summing over observations gives the stated score. If \(Z\) is a fitted continuation probability rather than a binary value, the same equation is the score of the corresponding weighted Bernoulli quasi-likelihood. This derivation explains the score being solved; it does not by itself establish asymptotic normality or cure misspecified nuisance models. \(\square\)

Worked Example: Encoding Events and Censoring

Suppose a patient is event-free at the start of interval 1, has no event in that interval, and is censored immediately afterward. Then \(R_1=1,D_1=0,C_1=1\), so

$$ R_2=1(1-0)(1-1)=0. $$

The patient's event-free status through interval 1 is known. Their event status in interval 2 is not. If instead an event occurs in interval 1, then \(D_1=1\), and \(R_2=0\) regardless of \(C_1\). For example, \(R_2=1(1-1)(1-C_1)=0\). The event is an observed failure, not a censored event-free outcome. This distinction determines which records contribute to each later risk set.

Worked Example: Two-Interval Survival Under a Policy

Consider one policy that fixes treatment at the prescribed value in both intervals. Under that policy, suppose the probability of surviving interval 1 is \(0.9\). Among those who survive, an intermediate covariate \(L_2\) is good with probability \(0.6\) and poor with probability \(0.4\). Conditional on that covariate and the policy treatment in interval 2, survival in interval 2 is \(0.9\) for good \(L_2\) and \(0.5\) for poor \(L_2\).

The final regression values are \(m_2(\text{good})=0.9\) and \(m_2(\text{poor})=0.5\). Averaging over the policy-induced distribution of \(L_2\) gives the interval-2 continuation probability among interval-1 survivors:

$$ q_2=0.6(0.9)+0.4(0.5)=0.54+0.20=0.74. $$

The earlier recursion multiplies by the probability of surviving interval 1:

$$ S^g(2)=q_1=0.9(0.74)=0.666, \qquad 1-S^g(2)=1-0.666=0.334. $$

Thus estimated survival through interval 2 under the policy is \(66.6\%\), and risk by that time is \(33.4\%\). The multiplication is not optional: \(0.74\) is conditional on having reached the second interval, not the marginal probability of surviving both intervals.

Worked Example: A Weighted Logistic Targeting Update

At one targeting step, suppose four observed outcomes are \(Z=(1,1,1,0)\), their clever-covariate weights are \(\mathsf H=(1,2,1,2)\), and all initial predictions equal \(0.5\). The logistic fluctuation has a common offset, so the updated prediction is \(p=\operatorname{expit}(\epsilon)\). Its score equation is

$$ \sum_{i=1}^4\mathsf H_i(Z_i-p)=0. $$

The weighted outcome total is \(1(1)+2(1)+1(1)+2(0)=4\), while the total weight is \(1+2+1+2=6\). Therefore \(4-6p=0\), so \(p=4/6=2/3\). Since \(\operatorname{logit}(0.5)=0\), the fluctuation parameter is

$$ \epsilon=\operatorname{logit}(2/3)-\operatorname{logit}(0.5) =\log\!\left(\frac{2/3}{1/3}\right)-0 =\log 2\approx0.693. $$

Checking the score directly, \(1(1-2/3)+2(1-2/3)+1(1-2/3)+2(0-2/3)=1/3+2/3+1/3-4/3=0\). The update is therefore the exact score solution. In an actual longitudinal analysis, the weights are not chosen arbitrarily: they encode the intervention-to-observed-treatment likelihood ratio and the relevant censoring adjustment.

Diagnostics, alternatives, and limitations

Several checks are especially important for survival targeting. Inspect estimated treatment and censoring probabilities over the histories that contribute to the policy target. Very small probabilities create large clever covariates, so a few people can dominate the update. Check the number at risk and the number censored in each interval; sparse late risk sets can make conditional regressions unstable. Also verify that fitted conditional survival probabilities lie in \([0,1]\), that the backward recursion uses the updated later regressions, and that the final risk is exactly one minus the final survival estimate.

A useful comparison is with the parametric g-formula, which also models sequential conditional distributions and averages under a policy, but does not by itself perform the TMLE targeting step. Inverse-probability-weighted estimation instead relies directly on treatment and censoring weights. Kaplan–Meier estimation is a standard option for an unadjusted survival curve under its censoring assumptions, but it does not generally identify survival under a time-varying treatment policy with confounding. These approaches answer different questions and rely on different modeling or design conditions; TMLE is not automatically superior when its assumptions fail.

  • Common mistake: treating observed event statuses as a random sample. The observed-status event proportion need not estimate the full-cohort risk under independent censoring alone. For example, if half the cohort has an event at \(\tau/4\) and half has no event by \(\tau\), and independent censoring occurs at \(\tau/2\) for half the cohort, all events are observed but only half of event-free people have known status through \(\tau\). The observed-status event proportion is \(0.5/(0.5+0.25)=2/3\), while the full-cohort risk is \(1/2\). Use a suitable survival or censoring-adjusted procedure; a crude observed-status fraction needs additional assumptions, such as complete follow-up independent of event time.
  • Confusing survival among survivors with survival in the original population. A conditional interval survival probability must be multiplied through the recursion and averaged over the appropriate policy-induced histories.
  • Assuming targeting repairs poor overlap. If the policy assigns treatments rarely observed at relevant histories, the likelihood ratios can be unstable or undefined. Targeting cannot recover information absent from the data.

The method also depends on a correctly specified event and censoring time convention, sufficient measurements of confounders, and nuisance estimates adequate for the target. A discrete-time analysis may be inappropriate if visit intervals are too coarse for the scientific question. TMLE's bounded plug-in form is useful, but it does not eliminate bias from unmeasured confounding, informative censoring left unaccounted for, or severe positivity violations.

Check Your Understanding

Try each question, then compare with the brief solutions.

  1. In the stated convention, what does \(R_{t+1}=0\) mean if \(D_t=1\)?
  2. If \(q_2=0.8\) among interval-1 survivors and \(P(D_1=1)=0.2\), what is survival through interval 2, assuming the interval-1 event-free probability is \(0.8\)?
  3. What two mechanisms are represented in the longitudinal clever covariate?
  4. Why is a crude event proportion among people with observed status not generally a valid fixed-time risk estimator?

Solutions. (1) The person does not enter the next risk set because an event occurred, whatever the censoring indicator after the interval. (2) \(S(2)=0.8(0.8)=0.64\); the second factor is conditional on surviving the first interval. (3) The treatment-policy-to-observed-treatment likelihood ratio and the inverse probability of remaining uncensored for the required outcome. (4) Censoring can leave event-free individuals' later status unknown, so the observed-status group need not represent the full cohort; independent censoring alone does not make its crude event fraction valid.

Clinical Biostats