Define a fitted survival models with a Kaplan-Meier estimator or parametric distributions
Examples
library(survival)
define_surv_fit(
survfit(Surv(time, status) ~ 1, data = colon)
)
#> survfit(Surv(time, status) ~ 1, data = colon)
#> attr(,"class")
#> [1] "surv_fit" "surv_object"
define_surv_fit(
flexsurv::flexsurvreg(Surv(time, status) ~ 1, data = colon, dist = "exp")
)
#> flexsurv::flexsurvreg(Surv(time, status) ~ 1, data = colon, dist = "exp")
#> attr(,"class")
#> [1] "surv_fit" "surv_object"