rmst_generic | R Documentation |
Generic function to find the restricted mean of a distribution, given the equivalent probability distribution function, using numeric integration.
rmst_generic(pdist, t, start = 0, matargs = NULL, scalarargs = NULL, ...)
pdist |
Probability distribution function, for example,
|
t |
Vector of times at which rmst is evaluated |
start |
Optional left-truncation time or times. The returned restricted mean survival will be conditioned on survival up to this time. |
matargs |
Character vector giving the elements of |
scalarargs |
Character vector naming scalar arguments of the distribution function that cannot be vectorised. This is used, for example, for the arguments |
... |
The remaining arguments define parameters of the distribution
|
This function is used by default for custom distributions for which an
rmst
function is not provided.
This assumes a suitably smooth, continuous distribution.
Vector of restricted mean survival times of the distribution at
p
.
Christopher Jackson <chris.jackson@mrc-bsu.cam.ac.uk>
rmst_lnorm(500, start=250, meanlog=7.4225, sdlog = 1.1138)
rmst_generic(plnorm, 500, start=250, meanlog=7.4225, sdlog = 1.1138)
# must name the arguments
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.