The broom package exports a tidier for "survfit" objects.
This function adds on top of that and returns more information.
The function also utilizes additional information stored when the
survfit object is created with survfit2().
It's recommended to always use this function with survfit2().
Usage
tidy_survfit(
x,
times = NULL,
type = c("survival", "risk", "cumhaz", "cloglog")
)
Value
a tibble
Arguments
x
a 'survfit' object created with survfit2()
times
numeric vector of times. Default is NULL,
which returns all observed times.
type
type of statistic to report.
Available for Kaplan-Meier estimates only.
Default is "survival".
Must be one of the following or a function: