Introduction
A standard Kaplan-Meier or Cox analysis treats every event that isn't the one you're studying as ordinary censoring — a subject simply leaves the risk set. When the endpoint is disease relapse and a subject instead dies of an unrelated cause, this is not "missing data" the way a lost-to-follow-up subject is: it's a real, informative outcome that permanently removes them from ever being able to relapse. This tutorial goes deep on what that does to a standard survival analysis — quantified with a real, substantial bias — and builds both standard approaches to fixing it (cause-specific hazards and the Fine-Gray subdistribution hazard model) from scratch, since no mainstream Python package implements Fine-Gray directly.
A Real, Quantified Bias
Simulating a 250-subject oncology trial with two possible event types — disease relapse (145 subjects, the event of interest) and death without relapse (69 subjects, a genuine competing risk, more common among older patients) — and comparing the standard "1 minus Kaplan-Meier" approach (treating competing deaths as ordinary censoring) against the statistically correct cumulative incidence function (Aalen-Johansen estimator, which properly accounts for the competing risk):
| Time (months) | Naive 1−KM | True CIF (Aalen-Johansen) | Bias |
|---|---|---|---|
| 6 | 0.2223 | 0.2160 | +0.0063 |
| 12 | 0.3559 | 0.3320 | +0.0239 |
| 18 | 0.4854 | 0.4360 | +0.0494 |
| 24 | 0.5680 | 0.4920 | +0.0760 |
| 30 | 0.6851 | 0.5640 | +0.1211 |
| 36 | 0.7153 | 0.5800 | +0.1353 |
By 36 months, the naive method reports a 71.5% apparent risk of relapse when the true cumulative incidence is 58.0% — a 13.5 percentage point overstatement. This isn't a subtle numerical footnote; it's the difference between telling a patient their relapse risk is roughly seven in ten versus roughly six in ten.
Why This Happens: The Mechanics
The Kaplan-Meier estimator's product-limit formula assumes that anyone who leaves the risk set (via censoring) remains, in principle, still capable of the event of interest — just unobserved. A subject who dies without relapsing violates this assumption completely: they cannot relapse afterward, by definition, not just "we don't know if they did." Treating their departure as if it were ordinary censoring inflates the apparent risk of relapse, because the KM math implicitly redistributes their "unresolved" risk onto the remaining at-risk subjects — exactly the wrong thing to do when that risk was actually foreclosed, not merely unobserved.
The Cumulative Incidence Function
The correct quantity is the cumulative incidence function (CIF), estimated via the Aalen-Johansen estimator — a direct generalization of the Kaplan-Meier product-limit approach to multiple competing event types:
where \(\hat S(t_{i-1})\) is the overall event-free survival probability (accounting for all event types, not just the one of interest) just before \(t_i\), and \(d_{1i}\) is the number of event-of-interest occurrences at \(t_i\). The key structural difference from ordinary KM: the overall survival probability \(\hat S(t_{i-1})\) already reflects every way a subject can leave the risk set, including the competing event — which is exactly the correction the naive method skips.
Cause-Specific Hazard vs. Subdistribution Hazard
Two genuinely different questions can be asked with competing-risks data, and they require different models:
Cause-Specific Hazard
"Among subjects still at risk (not yet relapsed or died), what is the instantaneous relapse rate?" — a standard Cox model fit on the event of interest, with competing-event subjects removed from the risk set at their event time, exactly as ordinary censoring would remove them. This answers a mechanistic, etiological question about the biology of relapse risk among the currently-at-risk population.
Subdistribution Hazard (Fine-Gray)
"How does a covariate affect the actual, real-world cumulative incidence of relapse, given that competing deaths are also happening?" — this requires a genuinely different risk-set construction. Fine & Gray's (1999) insight: keep subjects who experienced the competing event artificially in the risk set after their event time (rather than removing them), which directly links the resulting hazard ratio to the cumulative incidence function itself, not to a hypothetical world where competing events don't happen.
Both Models, Fit From Scratch, Same Data
Implementing both partial likelihoods directly — identical to the Cox partial likelihood machinery in the Cox Proportional Hazards tutorial, differing only in which subjects populate the risk set at each event time — and fitting both to the same 250-subject trial:
| Model | Treatment β̂ | Treatment HR | SE | Age β̂ | Age HR |
|---|---|---|---|---|---|
| Cause-Specific Cox (competing events removed from risk set) | −0.8557 | 0.425 | 0.171 | −0.0045 | 0.996 |
| Fine-Gray Subdistribution (competing events retained in risk set) | −0.6929 | 0.500 | 0.169 | −0.0079 | 0.992 |
These are genuinely different numbers, not noise: a 42.5% relapse hazard among those still at risk (cause-specific) versus a 50.0% effect on the actual population-level cumulative incidence of relapse (subdistribution). Both are correct — they're correct answers to two different questions. Reporting a single "the hazard ratio was X" without specifying which of these was used is a real, common source of confusion in competing-risks literature, precisely analogous to reporting "the treatment effect" in the estimand framework without specifying the intercurrent-event strategy (see the Estimands tutorial).
Which Model to Use
| Question | Model |
|---|---|
| What biologically drives relapse risk among currently-at-risk patients? | Cause-specific Cox |
| What is a patient's actual probability of relapsing, given competing mortality risk is real? | Fine-Gray subdistribution hazard |
| Reporting an absolute risk figure for patient communication or regulatory labeling | Cumulative Incidence Function (Aalen-Johansen), typically alongside Fine-Gray for covariate effects |
Shortcomings and Key Details
- The magnitude of the naive-method bias scales with the competing event rate. With a rare competing risk (say, under 5% of subjects), naive KM and the true CIF will be close; the 13.5-point gap demonstrated here reflects this trial's substantial (27.6%) competing-death rate. Always check how common the competing event actually is before assuming the naive approach is "close enough."
- Fine-Gray's risk-set trick assumes the timing of administrative censoring is unrelated to covariates — in datasets with additional loss-to-follow-up censoring beyond a fixed administrative cutoff, the full method requires inverse-probability-of-censoring weighting to keep the retained competing-event subjects properly representative, a refinement beyond what's implemented here (this tutorial's dataset uses only a fixed administrative censoring time, which is the case where the simplified version shown is exact).
- Subdistribution hazards don't have as clean a mechanistic interpretation as ordinary hazards — a Fine-Gray hazard ratio describes an effect on the cumulative incidence curve's shape, not an instantaneous biological rate, which can make it a harder number to explain to a non-statistical audience despite being the more clinically relevant one for absolute risk questions.
- More than two competing risks (e.g., relapse, cardiovascular death, other-cause death as three distinct outcomes) extend both frameworks directly, but require a separate cause-specific or subdistribution model fit per event type.
Summary
Treating a competing event as ordinary censoring isn't a minor simplification — on real data here it overstated relapse risk by 13.5 percentage points at 3 years, and the naive method's bias grows directly with how common the competing event is. Cause-specific Cox and Fine-Gray's subdistribution hazard model, both fit from scratch on the same trial, gave genuinely different hazard ratios (0.425 vs. 0.500) because they answer genuinely different scientific questions — and specifying which one a competing-risks analysis is actually using deserves the same care as specifying an estimand for any other endpoint.
References
Fine, J.P. & Gray, R.J. (1999). A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association.
Aalen, O.O. & Johansen, S. (1978). An empirical transition matrix for non-homogeneous Markov chains based on censored observations. Scandinavian Journal of Statistics.
Austin, P.C. & Fine, J.P. (2017). Practical recommendations for reporting Fine-Gray model analyses for competing risk data. Statistics in Medicine.
Latouche, A. et al. (2013). A competing risks analysis should report results on all cause-specific hazards and cumulative incidence functions. Journal of Clinical Epidemiology.