Learn R Programming

hesim (version 0.2.3)

params_joined_surv_list: Parameters of joined lists of survival models

Description

Create a list containing the parameters of multiple sets of survival models, each joined at specified time points. See joined for more details.

Usage

params_joined_surv_list(..., times)

Arguments

...

Objects of class params_surv_list, which can be named.

times

A list of sorted numeric vectors, with the length of each list element equal to the number of sets of models.

Value

An object of class "params_joined_surv_list", which is a list containing two elements:

models

A list of params_surv_list, each containing codeparams_surv objects to be joined.

times

Equivalent to the argument times.

Examples

Run this code
# NOT RUN {
library("flexsurv")
fit_exp <- flexsurv::flexsurvreg(formula = Surv(futime, fustat) ~ 1, 
                                 data = ovarian, dist = "exp")
fit_wei <- flexsurv::flexsurvreg(formula = Surv(futime, fustat) ~ 1, 
                                 data = ovarian, dist = "weibull")
fit_lnorm <- flexsurv::flexsurvreg(formula = Surv(futime, fustat) ~ 1, 
                                  data = ovarian, dist = "lognormal")

params_exp <- create_params(fit_exp, n = 2)
params_wei <- create_params(fit_wei, n = 2)
params_lnorm <- create_params(fit_lnorm, n = 2)

params_list1 <- params_surv_list(params_exp, params_wei)
params_list2 <- params_surv_list(params_exp, params_lnorm)
params_joined <- params_joined_surv_list(model1 = params_list1,
                                         model2 = params_list2,
                                         times = list(3, 5))
print(params_joined)
# }

Run the code above in your browser using DataLab