residlife | R Documentation |
Calculates residual life values over a range of values. Allows the user to specify the distribution and the parameters.
residlife(values, distribution, parameters, p = 0.5, type = "mean")
values |
Range of values over which residual life is calculated.Usually given as a vector. |
distribution |
Name of the distribution. Needs to be one of 'weibull', 'gompertz', 'gamma', 'gengamma.orig', 'exponential', 'lnorm', or 'llogis', 'genf', or 'genf.orig'. |
parameters |
Parameters of the survival function. Needs to be inputted in order as a vector, with the name of the parameter included. |
p |
Percentile at which to calculate residual life. Default is .5. |
type |
Type of residual life outputted. Must be "mean", "median", "percentile", or "all". Default is "mean". |
The residual life for a specified sequence of values.
Jackson CH (2016). “flexsurv: a platform for parametric survival modeling in R.” Journal of statistical software, 70.
Poynor V (2010). “Bayesian inference for mean residual life functions in survival analysis.” Masters diss., University of California, Santa Cruz.
Prentice RL (1975). “Discrimination among some parametric models.” Biometrika, 62(3), 607–614.
Stacy EW (1962). “A generalization of the gamma distribution.” The Annals of mathematical statistics, pp. 1187–1192
residlife(values = 0:60, distribution= 'weibull', parameters = c(shape = 1.2, scale = 3))
residlife(values = 15:35, distribution= 'gamma', parameters = c(shape = 1.2, rate = 1.7),
p = .25, type ='all')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.