
Kaplan-Meier Survival and Fine-Gray Competing Risks Cumulative Incidence (CIF) Estimator
Source:R/survival.R
estimate_km_survival.RdEstimates non-parametric Kaplan-Meier survival curves, Greenwood standard errors, confidence intervals, and cause-specific Aalen-Johansen / Fine-Gray Cumulative Incidence Functions (CIF) for 3-state competing risks data.
Usage
estimate_km_survival(
df_or_list,
time_col = NULL,
status_col = NULL,
ci_type = c("log-log", "linear"),
alpha = 0.05
)Arguments
- df_or_list
A
data.frameor output list fromprepare_competing_risks_data().- time_col
Character column name for event times (auto-detected if
NULL).- status_col
Character column name for status indicators (auto-detected if
NULL).- ci_type
Type of confidence interval:
"log-log"(default) or"linear".- alpha
Significance level for confidence intervals (default
0.05).
Value
An object of class c("omop_survival_result", "list") containing:
- timeline
Tidy
data.framewith time, n_at_risk, events, survival, std_err, CI bounds, and CIFs.- summary
List of summary metrics including total events, censoring, and median survival.
- has_competing_risks
Logical flag indicating whether competing risks were evaluated.