library("flexsurv")
fit1 <- flexsurv::flexsurvreg(formula = Surv(endpoint1_time, endpoint1_status) ~ age,
data = psm4_exdata$survival,
dist = "weibull")
fit2 <- flexsurv::flexsurvreg(formula = Surv(endpoint2_time, endpoint2_status) ~ age,
data = psm4_exdata$survival,
dist = "weibull")
fsreg_list <- flexsurvreg_list(endpoint1 = fit1, endpoint2 = fit2)
fits <- partsurvfit(fsreg_list, data = psm4_exdata$survival)
class(fits)
Run the code above in your browser using DataLab