powered by
Calculates Kaplan-Meier estimates for survival data and returns summary statistics, plots, and additional outputs.
get_km( data, time, event, group = NULL, group_labels = NULL, just_km = FALSE, ... )
A list containing Kaplan-Meier estimates, summary statistics, and plots.
A data frame containing the survival data.
The name of the column in data containing the time-to-event information.
data
The name of the column in data indicating whether the event of interest occurred.
(Optional) The name of the column in data defining the grouping variable. Default is NULL.
NULL
Optional character vector containing the names of the strata (default is NULL). Provide in a consistent order with levels(as.factor(data$group)).
levels(as.factor(data$group))
Logical. If TRUE, only the Kaplan-Meier estimates are returned. Default is FALSE.
TRUE
FALSE
(Optional) Parameters to pass to ggsurvfit.
km_results <- get_km( data = easysurv::easy_bc, time = "recyrs", event = "censrec", group = "group", risktable_symbols = FALSE ) km_results
Run the code above in your browser using DataLab