
Convert estimates from a survfit object to a tibble (dataframe)
convert_survfit2tibble.RdThis function takes a survfit object and extracts time estimates, together
with the number of events and number of risk. Based on the user specification
of time units - either days or years - the function then creates a full
sequence of time and event/risk number estimates from 0 to a user-specified
maximum age.
Usage
convert_survfit2tibble(
obj_survfit,
time_in = c("days", "years"),
age_max_years = 120L
)Arguments
- obj_survfit
A
survfitobject generated usingsurvival::survfit()orsurvival::survfit0().- time_in
Unit in which time is reported. Either
daysoryears.- age_max_years
Maximum age, in years, to which data should be extrapolated. Defaults to 120.