residlife {reslife} | R Documentation |
Calculating Residual Life Values
Description
Calculates residual life values over a range of values. Allows the user to specify the distribution and the parameters.
Usage
residlife(values, distribution, parameters, p = 0.5, type = "mean")
Arguments
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". |
Value
The residual life for a specified sequence of values.
References
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
Examples
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')