Tutorials › Marginal Structural Models › Competing Risks Under Longitudinal Interventions

The Parametric g-Formula · Tutorial 313 of 501

Competing Risks Under Longitudinal Interventions

Derive and implement longitudinal g-computation for cause-specific cumulative incidence while keeping event types mutually exclusive.

Advanced 12 min read

What You'll Learn

  • Define cause-specific event probabilities among individuals still event-free at each interval.
  • Simulate competing event types as one mutually exclusive categorical outcome.
  • Calculate cumulative incidence by combining interval-specific event risks with survival from earlier intervals.
  • Identify the assumptions needed to interpret simulated risks under a treatment regime.
  • Diagnose probability incoherence, incorrect risk sets, and failures of treatment support.
  • Distinguish cause-specific cumulative incidence from hazard summaries and subdistribution-hazard analyses.

Why competing events need a joint simulation

In a competing-risks setting, a person can experience at most one first event type during follow-up. For example, a patient may die from cardiovascular disease or from another cause, but cannot experience both as the first cause of death. Under a longitudinal treatment intervention, the probability of each event type can depend on treatment and covariate history, which itself evolves over time. The target is often the cumulative incidence of each cause: the probability that the first event by a specified time is of that cause.

The crucial modeling choice is to treat the event in each interval as one categorical outcome: no event, cause 1, cause 2, and so on. Fitting and simulating separate binary event indicators can assign positive probability to two causes occurring in the same interval. A joint categorical model preserves the defining exclusivity of competing events.

Definition: Let \(T\) be the interval of the first event, and let \(J\in\{1,\ldots,C\}\) be its cause. For a longitudinal history \(H_t\) observed before treatment \(A_t\) in interval \(t\), the cause-specific discrete-time event probability is \(p_{jt}(h,a)=P(T=t,J=j\mid T\ge t,H_t=h,A_t=a)\). The no-event probability is \(p_{0t}(h,a)=P(T>t\mid T\ge t,H_t=h,A_t=a)=1-\sum_{j=1}^{C}p_{jt}(h,a)\). Thus all \(C+1\) probabilities are nonnegative and sum to one.

Here \(T\ge t\) defines the risk set at the start of interval \(t\). Histories \(H_t\) can contain baseline covariates and the covariate and treatment history available before the interval’s event. A regime specifies treatment \(A_t=a_t(H_t)\) at each time. Conditional covariate transition models describe how covariates evolve among people who remain event-free; after a first event, the person leaves the risk set and has no later first-event type to simulate.

Identification of regime-specific risks uses the standard g-formula conditions: consistency (the observed outcome under the received treatment history equals the corresponding counterfactual outcome), sequential exchangeability (given the measured past, treatment assignment is independent of future counterfactual outcomes), and positivity (treatments specified by the regime have support at histories that occur under that regime). The conditional event and covariate-transition distributions must also be correctly specified for a parametric g-formula estimate to be consistent. These conditions do not make competing events censoring: each competing event is an outcome category.

From conditional event probabilities to cumulative incidence

Let \(\mu_t^a\) be the subprobability distribution of histories \(H_t\) among individuals still event-free at the start of interval \(t\) under regime \(a\). Its total mass is the probability of remaining event-free through the preceding intervals. Let \(Q_{t+1}^a(dh'\mid h)\) denote the conditional transition distribution for the next history among those who have no event in interval \(t\). The distribution \(\mu_t^a\) is updated by allowing no event and then generating the next covariate history:

$$ \mu_{t+1}^a(dh') = \int \mu_t^a(dh)\,p_{0t}\{h,a_t(h)\}\, Q_{t+1}^a(dh'\mid h). $$

The cumulative incidence for cause \(j\) through interval \(K\) is the sum of the cause-\(j\) event probability in each interval over the histories still at risk in that interval:

$$ F_j^a(K) = \sum_{t=1}^{K} \int \mu_t^a(dh)\,p_{jt}\{h,a_t(h)\}. $$

This recursion gives both a precise estimand and a direct simulation procedure. Start with the baseline history distribution. In each interval, assign treatment according to the regime, draw exactly one event category from the \(C+1\) probabilities, and, only for those with no event, draw the next covariate history. Repeating this for many baseline individuals and averaging the indicators of first events of cause \(j\) by \(K\) estimates \(F_j^a(K)\). Fitting a multinomial event model is one way to ensure the category probabilities form a valid joint distribution; other parameterizations are possible if they enforce the same constraints.

Theorem: Suppose the initial distribution, covariate-transition distributions among event-free individuals, and conditional event-category probabilities are correctly specified under a regime \(a\), with \(p_{jt}\ge 0\) and \(\sum_{j=0}^{C}p_{jt}=1\) at every at-risk history. The recursion above yields the regime-specific cumulative incidence of each cause, and \(\sum_{j=1}^{C}F_j^a(K)+P^a(T>K)=1\).

Proof. At the beginning of interval 1, \(\mu_1^a\) is the population distribution of baseline histories, and its total mass is one. Given an at-risk history \(h\) in interval \(t\), the mutually exclusive event categories have probabilities \(p_{0t},p_{1t},\ldots,p_{Ct}\). Thus the mass experiencing cause \(j\) in that interval is \(\int\mu_t^a(dh)p_{jt}\), and the mass continuing event-free is \(\int\mu_t^a(dh)p_{0t}\). The transition kernel \(Q_{t+1}^a\) has total probability one, so the update preserves that continuing mass:

$$ \mu_{t+1}^a(\mathcal H) = \int\mu_t^a(dh)p_{0t}\{h,a_t(h)\}. $$

Adding the cause-specific event masses in interval \(t\) to the continuing mass gives \(\int\mu_t^a(dh)\sum_{j=0}^{C}p_{jt}=\mu_t^a(\mathcal H)\). Applying this identity successively through interval \(K\) partitions the initial mass one into the mass experiencing each cause by \(K\) and the mass still event-free after \(K\). The event masses sum to the stated cumulative incidences by their definition, proving the result. \(\square\)

Worked Example: Two Causes With Constant Interval Risks

Suppose there are two intervals and two causes. At every at-risk history, interval 1 probabilities are \(p_{11}=0.10\), \(p_{21}=0.20\), and \(p_{01}=0.70\). In interval 2 they are \(p_{12}=0.20\), \(p_{22}=0.10\), and \(p_{02}=0.70\). Calculate both cumulative incidences and the probability of remaining event-free through interval 2.

In interval 1, the cause-specific event probabilities in the population are \(0.10\) and \(0.20\), because everyone is initially at risk. The fraction reaching interval 2 event-free is \(0.70\). Therefore the interval-2 increment for cause 1 is \(0.70(0.20)=0.14\), and for cause 2 it is \(0.70(0.10)=0.07\). Hence \(F_1(2)=0.10+0.14=0.24\) and \(F_2(2)=0.20+0.07=0.27\).

The probability of no event in either interval is \(0.70(0.70)=0.49\). The partition check is \(0.24+0.27+0.49=1.00\), as required. Notice that the second-interval risks are not simply added to the first-interval risks: they apply only to people who survived event-free to that interval.

Longitudinal histories and regime-specific risks

With evolving covariates, the at-risk history distribution changes over time. Both survival to the interval and the covariate transition affect which histories contribute to its event probabilities. Under an intervention, g-computation simulates treatment by the regime rather than by the observed treatment-assignment model, while still simulating covariate evolution and competing events conditional on the generated history.

Worked Example: Updating Risk Across Covariate Histories

Consider two intervals and two causes under a fixed treatment regime. At baseline, \(L_0=0\) or \(1\), each with probability \(0.5\). In interval 1, the event probabilities \((p_1,p_2,p_0)\) are \((0.05,0.10,0.85)\) when \(L_0=0\), and \((0.15,0.10,0.75)\) when \(L_0=1\). Among those event-free after interval 1, the probability \(L_1=1\) is \(0.20\) if \(L_0=0\), and \(0.80\) if \(L_0=1\). In interval 2, the probabilities are \((0.10,0.05,0.85)\) for \(L_1=0\), and \((0.20,0.15,0.65)\) for \(L_1=1\). Find the two cumulative incidences through interval 2.

The interval-1 contribution to cause 1 is \(0.5(0.05)+0.5(0.15)=0.10\); the contribution to cause 2 is \(0.5(0.10)+0.5(0.10)=0.10\).

For \(L_0=0\), the interval-1 surviving mass is \(0.5(0.85)=0.425\). Its conditional mean interval-2 cause-1 probability is \(0.80(0.10)+0.20(0.20)=0.12\), giving increment \(0.425(0.12)=0.051\). For \(L_0=1\), the surviving mass is \(0.5(0.75)=0.375\); its mean cause-1 probability is \(0.20(0.10)+0.80(0.20)=0.18\), giving increment \(0.375(0.18)=0.0675\). Thus \(F_1(2)=0.10+0.051+0.0675=0.2185\).

For cause 2, the mean interval-2 probabilities are \(0.80(0.05)+0.20(0.15)=0.07\) for \(L_0=0\), and \(0.20(0.05)+0.80(0.15)=0.13\) for \(L_0=1\). The corresponding increments are \(0.425(0.07)=0.02975\) and \(0.375(0.13)=0.04875\). Thus \(F_2(2)=0.10+0.02975+0.04875=0.1785\).

As a check, the event-free mass after interval 2 is \(0.425[0.80(0.85)+0.20(0.65)]+0.375[0.20(0.85)+0.80(0.65)]\) \(=0.425(0.81)+0.375(0.69)=0.34425+0.25875=0.603\). The three totals add to \(0.2185+0.1785+0.603=1\). This calculation shows why averaging the interval-2 probabilities over the original baseline distribution, rather than over the histories of survivors, would be incorrect.

Why the categorical event draw matters

Worked Example: Separate Binary Draws Create Impossible Events

Suppose the intended one-interval probabilities are \(P(\text{cause 1})=0.20\), \(P(\text{cause 2})=0.30\), and \(P(\text{no event})=0.50\). A proposed simulation instead draws independent Bernoulli indicators with probabilities \(0.20\) and \(0.30\). Calculate the chance of an invalid overlap and what happens if cause 1 is given priority.

The probability of both indicators being one is \(0.20(0.30)=0.06\). This assigns six percent probability to two first causes in the same interval, contradicting the competing-risks definition. The probability of neither indicator is \(0.80(0.70)=0.56\), not the intended \(0.50\).

If the programmer gives cause 1 priority whenever both indicators are one, then cause 1 is recorded with probability \(0.20\). Cause 2 is recorded only when its indicator is one and cause 1's is zero, so its recorded probability is \(0.80(0.30)=0.24\). No event is recorded with probability \(0.56\). The resulting distribution \((0.20,0.24,0.56)\) differs from the intended \((0.20,0.30,0.50)\). The correct simulation draws one categorical outcome with the intended three probabilities.

Diagnostics, alternatives, and limitations

Useful checks follow directly from the event-process definition. At every modeled at-risk history, verify that each event probability is between zero and one and that the cause probabilities sum to at most one, leaving a nonnegative no-event probability. In simulated data, verify that no individual experiences more than one first-event cause, that event histories stop after the first event, and that the cause-specific cumulative incidences plus the event-free probability sum to one at each follow-up time. Also check that the event models use only people at risk in the relevant interval and that the treatment regime is supported by observed histories. Sparse causes or rare history combinations can make the fitted probabilities unstable even when their arithmetic is valid.

A cause-specific hazard model describes the conditional probability of a particular cause among those still event-free. It can be useful for cause-specific questions, but a hazard is not itself the population cumulative incidence: the other causes reduce the number remaining at risk. A subdistribution-hazard approach, such as the Fine–Gray model, parameterizes a different representation aimed at the cumulative-incidence function. For longitudinal interventions, forward g-computation instead simulates covariate histories and the full mutually exclusive event process under each regime. The choice depends on the estimand and modeling purpose; these approaches are not interchangeable interpretations of the same coefficient.

Parametric g-computation remains vulnerable to misspecified conditional event or covariate models, inadequate treatment support, and Monte Carlo error. Correctly summing categories does not guarantee that the fitted probabilities are scientifically credible. And when censoring occurs, it must be represented and handled under appropriate assumptions; a competing event is not ordinary loss to follow-up and should not be relabeled as censoring merely to keep someone in a later risk set.

Key takeaway: For competing risks under a longitudinal intervention, model or construct one valid event-category distribution per interval, simulate it only among those still at risk, and accumulate each cause’s probability over the histories that survive to that interval.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. In one interval, the cause probabilities are \(0.12\), \(0.08\), and \(0.25\). What is the no-event probability?
  2. With two causes, interval-1 risks are \(0.10\) and \(0.20\), and interval-2 risks among survivors are \(0.15\) and \(0.10\). Find both cumulative incidences through interval 2.
  3. Why must the covariate distribution used for a later interval reflect survival free of every competing event?
  4. What problem arises if separate independent Bernoulli indicators are used for two mutually exclusive first-event causes?

Solutions. (1) \(1-0.12-0.08-0.25=0.55\). (2) The interval-1 survival probability is \(0.70\), so \(F_1=0.10+0.70(0.15)=0.205\) and \(F_2=0.20+0.70(0.10)=0.27\). The remaining survival is \(0.70(1-0.15-0.10)=0.525\), and \(0.205+0.27+0.525=1\). (3) Later event risks apply only to people still event-free; competing events remove people from the risk set, so the history distribution among survivors generally differs from the original population distribution. (4) The draws can both equal one, creating an impossible overlap; a joint categorical draw preserves exclusivity and the intended probabilities.

Clinical Biostats