Skip to contents

Define a fitted survival models with a Kaplan-Meier estimator or parametric distributions

Usage

define_surv_fit(x)

Arguments

x

a survfit or flexsurvreg object

Value

A surv_object object.

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"