📊 CompetingRisk - Fine-Gray Subdistribution Risk Model

CIF estimation + Gray's test + Fine-Gray regression | Competing risks analysis for time-to-event data

1. Data Input

2. Variable Selection

Downloads








Competing Risks Analysis Guide

What is Competing Risks Analysis?

In standard survival analysis, each subject can experience only one type of event (or censoring). In competing risks analysis, subjects may experience one of several mutually exclusive event types. For example, in a cancer study, patients may die from cancer (event of interest) or from other causes (competing event). The occurrence of one event precludes the other.

Cumulative Incidence Function (CIF)

The CIF estimates the probability of experiencing the event of interest by time t, in the presence of competing risks. Unlike the Kaplan-Meier estimate (which treats competing events as censored and overestimates the event probability), the CIF correctly accounts for competing events.

  • Solid lines: CIF for the event of interest (each group in a different color).
  • Dashed lines: CIF for competing events.
Gray's Test

Gray's test compares CIF curves across groups, analogous to the log-rank test in standard survival analysis. A significant p-value (p < 0.05) indicates that the cumulative incidence differs between groups.

Fine-Gray Subdistribution Hazard Model

The Fine-Gray model (Fine & Gray, 1999) regresses the subdistribution hazard on covariates. The subdistribution hazard for event type k is:

  • lambda_k(t) = -d/dt log(1 - CIF_k(t))
  • sHR (Subdistribution Hazard Ratio): sHR > 1 means higher risk of the event of interest; sHR < 1 means lower risk.
  • Interpretation: sHR reflects the effect on the cumulative incidence function, not the cause-specific hazard. It answers: 'Does this covariate increase the probability of experiencing the event of interest?'
Forest Plot

Visualizes sHR with 95% CI for each covariate. Red points are statistically significant (p < 0.05); gray points are not significant. The dashed vertical line at sHR = 1 represents no effect.

Predicted CIF

Shows the predicted cumulative incidence curve for a reference covariate pattern (numeric variables set to mean, categorical variables set to mode). This is a representative subject's risk profile, not the population-averaged CIF. For nonlinear models, mean covariates do not necessarily yield the average CIF.

Schoenfeld Residuals PH Test

An approximate test based on Schoenfeld residuals from the weighted Cox model for the subdistribution hazard. This is a diagnostic heuristic, not a formal test of the proportional subdistribution hazards assumption. Not a formal test; for diagnosis only. A significant p-value (p < 0.05) suggests potential time-varying effects and warrants further investigation (e.g., time-dependent covariates or stratification).

Data Requirements
  • Time: Survival/follow-up time (numeric, >= 0).
  • Status: Event indicator (0 = censored, 1 = event of interest, 2+ = competing events). Must be integer.
  • Event Code: Which status code represents the event of interest (default = 1).
  • Group: Optional grouping variable for CIF comparison and Gray's test. Supports 2+ groups.
  • Covariates: Variables for Fine-Gray regression model.
  • Categorical: Select covariates that should be treated as categorical (factors). Others are treated as continuous.
  • Missing values: Rows with NA in selected variables are removed before analysis.
Status Variable Coding

The status variable must use integer coding:

  • 0 = Censored (no event observed)
  • 1 = Event of interest (e.g., disease progression)
  • 2 = Competing event (e.g., death from other causes)
  • If there are multiple competing events (2, 3, ...), they are all pooled as 'competing' in the CIF plot.
Reference

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.

Gray RJ. A class of K-sample tests for comparing the cumulative incidence of a competing risk. Annals of Statistics. 1988;16(3):1141-1154.

九方思乐 · math81.com · 粤ICP备2026092768号