calc_rmd | R Documentation |
Calculates the restricted mean duration, given the form of a parametric distribution of Royston-Parmar splines
calc_rmd(Tw, type = NA, spec = NA, survobj = NULL)
Tw |
is the time horizon (weeks) over which the mean should be calculated. |
type |
is either "par" for regular parametric form (exponential, weibull etc) or "spl" for Royston-Parmar splines. |
spec |
is a list comprising:
If type=="par":
|
survobj |
is a survival fit object from flexsurv::flexsurvspline or flexsurv::flexsurvreg |
the restricted mean duration, a numeric value.
calc_rmd(Tw=200,
type="spl",
spec=list(gamma=c(0.1,0.2,0.1), knots=c(-5,2,4), scale="normal")
)
calc_rmd(Tw=250,
type="par",
spec=list(dist="lnorm", pars=c(3,1))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.