chjackson / flexsurv

The flexsurv R package for flexible parametric survival and multi-state modelling
http://chjackson.github.io/flexsurv/
55 stars 27 forks source link

`standsurv`: contrast time to certain quantiles of events #154

Closed hezht3 closed 1 year ago

hezht3 commented 1 year ago

Hi, thank you for this amazing package. As shown in this vignette, standsurv function allows contrasts of difference/ratio between exposure groups. I wonder if there's any way to calculate the contrast of time to certain quantiles of events (time ratio/time difference), and derive the standard errors of this contrast using delta method/bootstrapping. Thanks very much!

chjackson commented 1 year ago

In general in flexsurv, you can use bootstrapping to get uncertainty for any function of model parameters via passing a user-defined function to summary() - see the section "Custom model summaries" in the vignette. @mikesweeting did you want to give a more focused answer to this for the easiest way to do this in standsurv?

mikesweeting commented 1 year ago

Currently standsurv doesn't have type="quantile" but I will look to implement it. It should be relatively easy to add.

You can use summary() as described by @chjackson but not sure how easy it would be to get standard errors of the contrasts out

hezht3 commented 1 year ago

Dear Chris and Mike, Thank you very much for getting back to me and suggestions. Look forward to see this implemented in future release. Thanks!

hezht3 commented 1 year ago

Thanks very much for incorporating quantile type in standsurv function. I will close this issue as it has been resolved.