Tutorials › Competing Risks and Multi-State Models › Deriving the Competing-Risk G-Formula

Causal Contrasts With Competing Events · Tutorial 193 of 699

Deriving the Competing-Risk G-Formula

Learn how conditional event probabilities across causes and time combine into treatment-specific cumulative incidence, and how baseline standardization turns that calculation into a causal risk.

Advanced 11 min read

What You'll Learn

  • Define cause-specific conditional event probabilities and event-free survival in discrete time.
  • Derive the cumulative-incidence g-formula from the event-free survival recursion.
  • State the assumptions that identify treatment-specific cumulative incidence from observed data.
  • Calculate risks by treatment and covariate stratum, then standardize to the target population.
  • Diagnose incoherent probability models and understand why a competing event cannot be treated as ordinary censoring.
  • Distinguish standardized cumulative incidence from a cause-specific hazard and from a net-risk calculation.

Why the Competing-Risk G-Formula Needs Every Cause

A cause-specific event probability at a particular time is conditional on remaining event-free up to that time. It is not, by itself, the probability of experiencing that cause by the end of follow-up. To obtain a cumulative incidence, we must combine the probability of reaching each time without any event with the probability of the event of interest at that time. Because any competing cause also removes a person from the event-free group, its conditional probability enters that calculation too.

The discrete-time g-formula makes this combination explicit. For each treatment level and baseline covariate profile, it chains together the conditional probabilities for all causes and times. It then averages the resulting treatment-specific risk over the covariate distribution of the target population. This is the competing-risk counterpart of standardization for a total causal effect.

Definition: Let \(A\) be a baseline treatment, \(X\) a vector of baseline covariates, \(T\) the discrete event time, and \(J\in\{1,\ldots,K\}\) the event cause. Cause \(K\) can be any competing cause; the cause of interest is denoted \(k\). Define \(q_j(t\mid a,x)=P(T=t,J=j\mid T\ge t,A=a,X=x)\). This is the conditional probability of cause \(j\) at time \(t\), among those still event-free just before \(t\), under treatment level \(a\) and covariate profile \(x\). The conditional event-free probability for that time is \(1-\sum_{j=1}^{K}q_j(t\mid a,x)\).

Define \(S^a(t\mid x)=P(T>t\mid\) the intervention setting \(A=a,X=x)\), with \(S^a(0\mid x)=1\). The treatment-specific cumulative incidence for cause \(k\) through time \(t\), conditional on \(X=x\), is \(F_k^a(t\mid x)=P(T\le t,J=k\mid\) the intervention setting \(A=a,X=x)\). In this discrete-time setup, the corresponding g-formula is

$$ S^a(t\mid x)=\prod_{u=1}^{t}\left\{1-\sum_{j=1}^{K}q_j(u\mid a,x)\right\}, \qquad F_k^a(t\mid x)=\sum_{s=1}^{t}S^a(s-1\mid x)q_k(s\mid a,x). $$

For a discrete baseline covariate distribution, the population risk under treatment \(a\) is

$$ F_k^a(t)=\sum_x P(X=x)F_k^a(t\mid x) =\sum_x P(X=x)\sum_{s=1}^{t} \left[ \prod_{u=1}^{s-1}\left\{1-\sum_{j=1}^{K}q_j(u\mid a,x)\right\} \right]q_k(s\mid a,x). $$

For continuous covariates, replace the sum over \(x\) by an integral with respect to the target population distribution of \(X\). A causal risk difference, for example, is \(F_k^1(t)-F_k^0(t)\). It compares the probability of cause \(k\) by time \(t\) under two treatment interventions, allowing competing events to occur as they naturally would under each intervention.

Why the Formula Holds

The derivation uses a simple recursion. For an individual with covariates \(x\) under treatment \(a\), being event-free after time \(t\) requires being event-free before time \(t\), then having no event of any cause at \(t\). Therefore, \(S^a(t\mid x)=S^a(t-1\mid x)\{1-\sum_j q_j(t\mid a,x)\}\). Starting from \(S^a(0\mid x)=1\) and applying this recursion successively gives the product expression for survival.

The probability of cause \(k\) at time \(s\), conditional on \(x\), is the probability of being event-free just before \(s\) multiplied by the conditional probability of cause \(k\) at \(s\). Thus the probability of cause \(k\) at that time is \(S^a(s-1\mid x)q_k(s\mid a,x)\). The events \(\{T=s,J=k\}\) for \(s=1,\ldots,t\) are mutually exclusive, so their probabilities add. This gives \(F_k^a(t\mid x)\). Averaging these conditional risks over the baseline distribution of \(X\) gives the population g-formula.

Identification conditions: The formula identifies a causal treatment-specific risk from observed data under the following conditions. Treatment is well-defined and consistency holds: a person receiving \(A=a\) has the event outcome that would occur under the intervention setting \(A=a\). Conditional exchangeability holds: given measured baseline \(X\), treatment assignment is independent of the potential event time and cause under each treatment. Positivity holds: each treatment being compared has positive probability at every covariate profile with positive probability in the target population. Censoring is absent or conditionally independent of the future event process given treatment, baseline covariates, and relevant observed history, with adequate probability of remaining uncensored. The conditional event probabilities and the covariate distribution must also be estimated adequately.

These conditions connect observed conditional probabilities to the intervention risks; the product-and-sum calculation alone does not remove confounding or repair unsupported extrapolation. In practice, the event probabilities may be estimated with a discrete-time model, separately within covariate strata, or by another suitable approach. Whatever the estimation method, the probabilities must describe all event causes among those still event-free. The causal interpretation comes from the identification assumptions, not from the algebraic form of the formula.

Worked Calculations

Worked Example: Two Causes Across Two Time Points

Suppose, hypothetically, that under a fixed treatment and covariate profile the conditional probabilities are as follows. At time 1, \(q_1=0.10\) and \(q_2=0.20\). Among those event-free at the start of time 2, \(q_1=0.15\) and \(q_2=0.10\). Find the cumulative incidence of cause 1 by time 2.

At time 1, the probability of remaining event-free is \(1-0.10-0.20=0.70\). The cause 1 event probability at time 1 is \(1.00(0.10)=0.10\). At time 2, the probability of having remained event-free until then is \(0.70\), so the cause 1 contribution at time 2 is \(0.70(0.15)=0.105\).

Therefore, \(F_1(2)=0.10+0.105=0.205\). The cause 1 cumulative incidence by time 2 is 0.205, or 20.5%. As a check, cause 2 cumulative incidence is \(0.20+0.70(0.10)=0.27\), and event-free probability after time 2 is \(0.70(1-0.15-0.10)=0.525\). These sum to \(0.205+0.270+0.525=1.000\).

Worked Example: Standardizing Over a Baseline Covariate

Consider a hypothetical target population in which 60% have covariate profile \(L\) and 40% have profile \(H\). At a fixed horizon, the following conditional probabilities apply under treatment \(a=1\). For \(L\), time 1 probabilities are \(q_1=0.08,q_2=0.12\), and time 2 probabilities are \(q_1=0.12,q_2=0.08\). For \(H\), the corresponding values are \(0.20,0.10\) at time 1 and \(0.10,0.15\) at time 2. Calculate the standardized cause 1 risk.

For profile \(L\), event-free probability after time 1 is \(1-0.08-0.12=0.80\), so \(F_1^1(2\mid L)=0.08+0.80(0.12)=0.176\). For profile \(H\), event-free probability after time 1 is \(1-0.20-0.10=0.70\), so \(F_1^1(2\mid H)=0.20+0.70(0.10)=0.270\).

Average the two conditional risks using the target population proportions: \(F_1^1(2)=0.60(0.176)+0.40(0.270)=0.1056+0.1080=0.2136\). Thus the standardized cause 1 risk under treatment \(a=1\) is 21.36% by time 2. It is not the unweighted mean of the two stratum-specific risks: the target population has more people in profile \(L\) than in profile \(H\).

Worked Example: Three Time Points and the Event-Free Check

Suppose, hypothetically, that for a particular treatment and covariate profile the conditional probabilities at times 1, 2, and 3 are respectively \((q_1,q_2)=(0.05,0.15),(0.10,0.10),(0.20,0.10)\). Find the two cumulative incidences and the event-free probability after time 3.

The event-free probabilities before times 1, 2, and 3 are \(1.00\), \(1.00(1-0.05-0.15)=0.80\), and \(0.80(1-0.10-0.10)=0.64\). Therefore, \(F_1(3)=1.00(0.05)+0.80(0.10)+0.64(0.20)=0.258\). For cause 2, \(F_2(3)=1.00(0.15)+0.80(0.10)+0.64(0.10)=0.294\).

After time 3, event-free probability is \(0.64(1-0.20-0.10)=0.448\), not 0.576. The totals are \(0.258+0.294+0.448=1.000\). This check also catches arithmetic mistakes: the cause-specific risks plus the remaining event-free probability must account for everyone by the horizon.

Reading the Result and Checking the Calculation

The g-formula is useful because a treatment can change both the event of interest and the competing event, thereby changing who remains at risk at later times. The formula accounts for this changing event-free fraction at every time point. It produces the probability of the cause of interest in the presence of competing events, under each treatment intervention and in the stated target population.

Several checks help identify problems in an implementation:

  • For each treatment, covariate profile, and time, every \(q_j(t\mid a,x)\) must be between 0 and 1, and their sum across causes must not exceed 1.
  • The calculated event-free probability must be nonincreasing over time, and each cause-specific cumulative incidence must be nondecreasing.
  • At each horizon, the sum of the cause-specific cumulative incidences and the event-free probability should equal 1, apart from rounding.
  • Examine whether treatment and censoring information support the covariate profiles being standardized to. Sparse data, extreme model predictions, and poor calibration of event probabilities can undermine the calculation.

The principal alternative summaries answer different questions or use different information. A cause-specific hazard describes the conditional event probability among people still event-free; it is not a cumulative risk. A net-risk calculation that removes the competing event as if it were censoring does not give the observed-world cumulative incidence. An unadjusted cumulative-incidence estimate summarizes the observed treatment groups, while standardization uses conditional risks and a common target covariate distribution to address measured baseline confounding. Inverse probability weighting is another way to adjust for treatment assignment, but its estimation and diagnostics are separate topics.

Common pitfall: Do not calculate cause \(k\)'s cumulative incidence by multiplying only \(1-q_k(t)\) across time and taking the complement. That calculation acts as though a competing event leaves a person available to experience cause \(k\) later. Instead, event-free survival at each step uses \(1-\sum_j q_j(t)\), because an event of any cause ends the event-free period.

The formula does not eliminate the need to choose an appropriate target population, measure adequate confounders, or assess whether the fitted conditional probabilities are credible. It also does not identify risks for covariate profiles with no treatment support. When censoring depends on evolving observed history, a model using only baseline covariates may not be enough to identify the desired risks. These are limitations of the identification and estimation strategy, not issues that can be fixed by rearranging the g-formula.

Check Your Understanding

Try each problem, then compare your reasoning with the short solutions below.

  1. At time 1, \(q_1=0.08\) and \(q_2=0.12\). At time 2, among those event-free, \(q_1=0.10\) and \(q_2=0.20\). Find \(F_1(2)\).
  2. Why does the event-free survival recursion use the sum of conditional probabilities across all causes?
  3. Two covariate profiles have target population weights 0.25 and 0.75, with cause 1 risks 0.10 and 0.30. Find the standardized risk.
  4. Is a treatment-specific cause-specific hazard the same quantity as a treatment-specific cumulative incidence? Explain.

Solutions. (1) Event-free probability after time 1 is \(1-0.08-0.12=0.80\), so \(F_1(2)=0.08+0.80(0.10)=0.160\). (2) Any cause ends the event-free period, so the probability of no event at a time is one minus the sum of the cause-specific probabilities. (3) The standardized risk is \(0.25(0.10)+0.75(0.30)=0.250\), or 25.0%. (4) No. The cause-specific hazard is conditional on being event-free at a particular time; cumulative incidence adds that cause's event probabilities over time, weighted by the probability of reaching each time event-free.

Clinical Biostats