Competing Risks (Cause-Specific Hazard, Cumulative Incidence, and Fine-Gray)
Time-to-event methods that distinguish the rate of an event among people still event-free (cause-specific hazard), the probability of that event before a competing event (cumulative incidence), and a regression model linked to cumulative incidence (Fine–Gray subdistribution hazard).
On this page
Some events stop another event from happening: a patient who dies cannot later have a first hospitalization. Competing-risk analysis tracks these events separately. The cumulative incidence is the probability of hospitalization before death; hazard models describe different rate comparisons and must not be read as absolute probabilities.
A competing event precludes the event of interest under the stated endpoint definition. Death before a first hospitalization is the standard example. Treatment switching or transplantation is not automatically a competing event: it may instead be an intercurrent event, a censoring rule for a specified estimand, or a transition in a multistate model. Decide from the scientific question before coding the event indicator.
Three quantities, three interpretations
- Cause-specific hazard: the instantaneous event rate among people still free of all first events. A cause-specific Cox model codes competing events as censored at their occurrence. This is a valid way to fit that model even when competing events are common or differ across groups. It does not require independent latent event times for the competing causes. Independent observation censoring, conditional on modeled covariates, and model assumptions remain relevant.
- Cumulative incidence function (CIF): the probability of the event of interest before a competing event by time t. Aalen–Johansen estimates it by adding the event-of-interest hazard increments weighted by the probability of remaining free of all events just beforehand. People leave the observed risk set at either event. For two causes, CIF1(t) + CIF2(t) + event-free survival(t) = 1.
- Fine–Gray subdistribution hazard: a hazard defined using an extended risk set that includes people with prior competing events, with weights accounting for observation censoring when needed. Its regression coefficient is a subdistribution hazard ratio. Under the model it indicates the direction of the CIF association, but is neither a risk ratio nor a probability difference. Predict the CIF at a specified horizon to report absolute risk.
The cause-specific and subdistribution hazard ratios can differ in direction because the CIF depends on hazards for every competing cause. A treatment associated with fewer competing deaths can leave more people able to experience the event of interest. Neither hazard ratio by itself establishes a biological mechanism or a causal effect: conditioning on remaining event-free can select different survivors across groups (Hernán 2010).
Pros, cons, and trade-offs
- CIF versus 1 minus Kaplan–Meier with competing events censored: use CIF for observed-world absolute incidence. The Kaplan–Meier complement generally overestimates that incidence when competing events occur. There is no universal 10% threshold below which competing events may be ignored; relevance depends on the estimand and the size of the discrepancy.
- Cause-specific Cox versus Fine–Gray: choose the hazard scale that answers the question. Cause-specific models can also generate adjusted CIF predictions by combining models for all causes. Fine–Gray provides another route to modeling a CIF. Neither is universally mandatory; reporting absolute risks and relevant cause-specific results can help interpretation.
- CIF versus restricted mean time lost: CIF is probability by a horizon; integration of the CIF yields expected time lost to that cause over a specified horizon. Report the scale useful for the decision rather than treating these summaries as interchangeable.
When NOT to use — and when interpretation is misleading
- Do not use Fine–Gray simply because deaths occur. For all-cause mortality, death is the event itself. For repeated hospitalizations followed by death, first-event CIF discards recurrent burden; consider recurrent-event or multistate methods.
- Do not recode informative loss to follow-up as a competing event. The event may still happen after observation stops. Address censoring with assumptions and, where justified, methods such as IPCW.
- Do not describe a subdistribution HR of 0.79 as a 21% reduction in absolute risk or a risk ratio of 0.79. Obtain predicted risks first.
- Do not interpret a cause-specific HR as an automatic causal effect on biology. Confounding, measurement, model fit, and survivor selection remain relevant.
Data-source operational depth
- Claims: build mutually exclusive first-event records from reconciled event, death, and end-of-observation dates. An inpatient discharge-death flag misses out-of-hospital deaths. Assess the specific mortality source. Medicare enrollment mortality and FFS utilization have different capture mechanisms; lack of FFS medical claims during Medicare Advantage enrollment does not itself prove death is missing.
- EHR: assess deaths outside the health system and visit-driven outcome capture. A missing visit is not proof of event-free survival. Interval-observed progression requires additional attention beyond an ordinary exact-date competing-risk model.
- Registry: distinguish adjudicated cause of death from all-cause mortality and uncertain causes. Linkage may improve ascertainment, but assess its completeness and selection.
- Linked data: specify date precedence, same-day event/death rules, source agreement, and sensitivity analyses. Loss of linkage and competing death are different mechanisms.
Worked claims example
The five records below are synthetic. For first febrile-neutropenia (FN) hospitalization by day 180 after chemotherapy initiation, death before FN is competing and data end is censoring. Compare Aalen–Johansen CIF with the incorrect use of 1 minus Kaplan–Meier as the FN probability. If comparing actual treatment groups, additional design and confounding work would be required; this arithmetic example makes no treatment-effect claim.
Interpreting the output
A cause-specific HR of 0.68 is a comparison of FN rates among the respective groups still event-free. A Fine–Gray HR of 0.79 is a comparison on the subdistribution-hazard scale. These illustrative values do not specify either group's absolute FN risk. Report estimated CIFs, a defined time horizon and uncertainty before translating results into a risk comparison.
Decision diagram
flowchart TD S["Start: alive and event-free"] --> E["Event of interest"] S --> D["Competing death"] S --> C["Observation ends before either event"] D --> AJ["Aalen-Johansen: leave event-free risk set; update all-event survival"] D --> CS["Cause-specific Cox: code as censored at death"] D --> FG["Fine-Gray: remain in extended risk set"] C --> O["Observation-censoring assumptions remain necessary"]
flowchart TD
Q{"What quantity answers the question?"} -->|Probability before a competing event| CIF["Cumulative incidence at a defined horizon"]
Q -->|Rate among those still event-free| CS["Cause-specific hazard model"]
CIF --> AJ["Descriptive: Aalen-Johansen"]
CIF --> AD["Adjusted: combine cause-specific models or use a CIF model"]
AD --> FG["Fine-Gray is one option; its HR is not a risk ratio"]
CS --> R["Report model assumptions and avoid automatic causal interpretation"]
AJ --> R
FG --> RWorked example
Scenario
Five synthetic patients begin follow-up at chemotherapy initiation. Two have FN admissions, two die first, and one reaches day 180 event-free. Estimate FN probability before death, distinguishing it from the Kaplan–Meier complement with deaths censored.
Dataset
Synthetic first-event records; event type 1 = FN, 2 = death, 0 = observation ends.
| person_id | fu_days | event_type | event_label |
|---|---|---|---|
| 1001 | 45 | 1 | FN hospitalization |
| 1002 | 60 | 2 | Death (competing) |
| 1003 | 90 | 1 | FN hospitalization |
| 1004 | 120 | 2 | Death (competing) |
| 1005 | 180 | 0 | Censored (end of window) |
Steps
Result
FN cumulative incidence by day 180 is 0.40 (40%). The Kaplan–Meier complement is 0.4667 (46.7%), an overstatement of approximately 6.7 percentage points for this synthetic dataset.
Trade-offs
Code example
Execution not verified · inspect inputs and dependencies before use
Arm-stratified Aalen-Johansen cumulative incidence from a claims-shaped, one-row-per-person analytic table. Required input (already cleaned, mutually-exclusive first-event coding done upstream): cohort : person_id, arm (str), fu_time (days from index to first event/censor, float), event_type (int) where 0 =...
import pandas as pd
from lifelines import AalenJohansenFitter, CoxPHFitter
EOI = 1 # event of interest
HORIZONS = [365, 730] # 12 and 24 months, in days
def cif_by_arm(cohort: pd.DataFrame, horizons=HORIZONS) -> pd.DataFrame:
"""Aalen-Johansen CIF of the event of interest, per arm, at fixed horizons.
The CIF weights each event-of-interest hazard increment by survival free
of all events just before that time. A competing event reduces this
survival and removes that person from subsequent observed risk sets.
"""
rows = []
for arm, g in cohort.groupby("arm"):
ajf = AalenJohansenFitter(calculate_variance=True)
# event_of_interest=1 tells lifelines which code is the EOI; all other
# non-zero codes are handled as competing (not as censoring).
ajf.fit(g["fu_time"], g["event_type"], event_of_interest=EOI)
cif = ajf.cumulative_density_
ci = ajf.confidence_interval_
for h in horizons:
# step function: value at the last observed time <= horizon
at = cif.loc[cif.index <= h]
lo = ci.loc[ci.index <= h]
rows.append({
"arm": arm, "horizon_days": h,
"cif_eoi": float(at.iloc[-1, 0]) if len(at) else 0.0,
"cif_lower": float(lo.iloc[-1, 0]) if len(lo) else 0.0,
"cif_upper": float(lo.iloc[-1, 1]) if len(lo) else 0.0,
})
return pd.DataFrame(rows)
def cause_specific_cox(cohort: pd.DataFrame, covariates: list[str]) -> CoxPHFitter:
"""Cause-specific HR for the EOI: code competing events as censored (0),
EOI as the event (1). This models the conditional cause-specific event rate
among people still event-free,
NOT the probability scale -- pair it with cif_by_arm()."""
d = cohort.copy()
d["event"] = (d["event_type"] == EOI).astype(int) # competing -> 0 (censored)
cph = CoxPHFitter()
cph.fit(d[["fu_time", "event"] + covariates], duration_col="fu_time", event_col="event")
return cphExecution not verified · inspect inputs and dependencies before use
Cumulative incidence (Aalen-Johansen), cause-specific Cox, and the Fine-Gray subdistribution model on a one-row-per-person claims table. Required input columns: d$fu_time numeric, days from index to first event or censor d$event_type factor/int: 0 = censored, 1 = event of interest, 2 = competing death d$arm factor:...
library(survival)
library(cmprsk)
# event_type must be a factor with the censoring level first for finegray():
d$event_f <- factor(d$event_type, levels = c(0, 1, 2),
labels = c("censor", "eoi", "competing"))
## 1. Non-parametric CIF by arm (Aalen-Johansen). multi-state survfit handles competing risks.
aj <- survfit(Surv(fu_time, event_f) ~ arm, data = d)
print(summary(aj, times = c(365, 730))) # 12- and 24-month CIF, with CIs
## 2. Cause-specific Cox for the EOI: competing events are censored (status == "eoi" only).
cs_eoi <- coxph(Surv(fu_time, event_f == "eoi") ~ arm + age + sex, data = d)
summary(cs_eoi) # cause-specific HR (conditional event rate among those still event-free)
## 3. Fine-Gray subdistribution model via finegray() + coxph().
fg_data <- finegray(Surv(fu_time, event_f) ~ ., data = d, etype = "eoi")
fg <- coxph(Surv(fgstart, fgstop, fgstatus) ~ arm + age + sex,
weights = fgwt, data = fg_data)
summary(fg) # subdistribution HR; predict CIF for absolute risk, not a risk ratio
## 3b. Equivalent with cmprsk::crr (failcode = EOI, cencode = censoring code).
covs <- model.matrix(~ arm + age + sex, data = d)[, -1]
fg2 <- crr(ftime = d$fu_time, fstatus = d$event_type,
cov1 = covs, failcode = 1, cencode = 0)
summary(fg2)Execution not verified · inspect inputs and dependencies before use
Cumulative incidence (PROC LIFETEST plots=cif), cause-specific Cox, and the Fine-Gray subdistribution model (PROC PHREG eventcode=, SAS/STAT 14.2+ / SAS 9.4 M3+) on a one-row-per-person analytic dataset.
/* 1. Non-parametric CIF (Aalen-Johansen) by arm. plots=cif gives the
cumulative incidence for EACH non-zero event code; event=1 is the EOI,
event=2 reduces all-event survival and leaves the observed risk set. */
proc lifetest data=work.analytic plots=cif(test) timelist=365 730;
time fu_time*event(0) / eventcode=1; /* CIF of the EOI at 12 and 24 mo */
strata arm;
run;
/* 2. Cause-specific Cox for the EOI: censor BOTH admin (0) and competing (2),
so only event=1 contributes -- the conditional event rate among those still event-free. */
proc phreg data=work.analytic;
class arm (ref='0') sex (ref='0');
model fu_time*event(0 2) = arm age sex / ties=efron rl;
hazardratio arm / diff=ref; /* cause-specific HR */
run;
/* 3. Fine-Gray subdistribution model for the CIF of the EOI.
eventcode=1 switches PHREG to the subdistribution hazard; competing events
are retained in the (weighted) risk set rather than censored. The HR maps to
the cumulative incidence scale and is NOT a biological rate. */
proc phreg data=work.analytic;
class arm (ref='0') sex (ref='0');
model fu_time*event(0) = arm age sex / eventcode=1 rl;
hazardratio arm / diff=ref; /* subdistribution HR */
run;
/* 4. Event-count and crude-rate audit table -- always produced alongside the
survival output so reviewers can see how many EOI vs competing events occurred. */
proc sql;
create table event_summary as
select arm,
count(*) as n,
sum(case when event=1 then 1 else 0 end) as eoi_n,
sum(case when event=2 then 1 else 0 end) as competing_n,
sum(case when event=0 then 1 else 0 end) as censored_n,
sum(fu_time)/365.25 as person_years
from work.analytic
group by arm;
quit;Citations
- [1]Fine JP, Gray RJ. A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association. 1999;94(446):496-509.
- [2]Austin PC, Lee DS, Fine JP. Introduction to the analysis of survival data in the presence of competing risks. Circulation. 2016;133(6):601-609.
- [3]Hernán MA. The hazards of hazard ratios. Epidemiology. 2010;21(1):13-15.