hesim-dev / hesim

Health economic simulation modeling and decision analysis
https://hesim-dev.github.io/hesim/
62 stars 15 forks source link

Mixing survival model sources in PSM #78

Closed heor-andreas closed 2 years ago

heor-andreas commented 3 years ago

Hi Devin,

I am looking for a way to combine different survival models in the PSM. I have for each endpoint and each strategy one parametric model (as a flexsurvreg object), I also have rates for an exponential model and would like to combine these. I am looking for a way to combine them into the create_PsmCurves.

What I have tried so far is the following (ignore the data):

pfs_1 <- create_params(flexsurvreg(Surv(futime, fustat) ~ 1, data = ovarian[rx==1], dist = "weibull"), n=1) pfs_2 <- create_params(flexsurvreg(Surv(futime, fustat) ~ 1, data = ovarian[rx==2], dist = "exp"), n=1) os_1 <- create_params(flexsurvreg(Surv(futime, fustat) ~ 1, data = ovarian[resid.ds==1], dist = "gamma"), n=1) os_2 <- create_params(flexsurvreg(Surv(futime, fustat) ~ 1, data = ovarian[resid.ds==2], dist = "gengamma"), n=1) par_list <- params_surv_list(pfs_1, pfs_2, os_1, os_2) survmods_data <- hesim::expand(hesim_dat, by = c("patients", "strategies")) create_PsmCurves(par_list, n=1, input_data = survmods_data)

I also tried using the params_surv function to set up my parameters manually, but can only specify one distribution.

params_surv( coefs = coef_rate_pfs, dist = c("exp", "weibull") )

So I am looking for a way to basically link the 4 models I have (1 for each strategy and each endpoint) to generate survival curves for and pass into the wider PSM model.

Is there a way to do this?

dincerti commented 3 years ago

Hi Andreas,

If distributions vary by strategy, then your best bet in this case probably to predict survival curves "manually" and then to use hesim to compute state probabilities, costs and QALYs. Note that this feature is only available in the development version (although the plan is to release to CRAN very soon) --- an example is here.

That said, I might ask why you want distributions to vary by treatment strategies? Typically we use a single distribution for the reference category and then estimate relative treatment effects. You can model pretty flexible time-varying treatment effects by putting covariates on the ancillary parameters of parametric models. The most flexible option would be to use flexsurvspline(), which would let you estimate a a baseline hazard that is effectively non-parametric as well as time-varying hazard ratios (by putting covariates on the "ancillary" parameters).

Lastly, note that in your example the exponential distribution is a special case of the Weibull and the gamma distribution is a special case of the generalized gamma. So you could model PFS with a Weibull and OS with a generalized gamma.