fc_fit {failCompare} | R Documentation |
Routines for fitting a common failure time model or models
fc_fit(time, model, SEs = TRUE, censorID = NULL, rc.value = NULL, ...)
time |
numeric vector of failure times |
model |
character string specififying the model(s) to be fit |
SEs |
logical for whether standard errors should be estimated |
censorID |
binary or logical variable the same length as |
rc.value |
rc.value right-censoring cutoff value (i.e.,only observations with times > rc.value are censored due to termination of the experiment or study) |
... |
additional arguments passed to optimizer |
This is a model fitting routine used to fit one or a set of failure time models:
"weibull"
= 2-parameter Weibull
"weibull3"
= 3-parameter Weibull
"gompertz"
= Gompertz Model
"gamma"
= Gamma distribution (2-parameter)
"lognormal"
= Log-Normal distribution
"llogis"
= Log-Logistic distribution
"gengamma"
= Generalized Gamma Distribution (3-parameter; Prentice 1974 parameterization)
"vitality.ku"
= 4-parameter vitality model from Li and Anderson (2009)
"vitality.4p"
= 4-parameter vitality model from Li and Anderson (2013)
"kaplan-meier"
= Kaplan-Meier nonparametric estimate (NOTE: this model cannot be specified in a list with any other model
Details on the parameterization of these distributions can be found in the appendix of the
failCompare user manual .
If a single model is specified, a "fc_obj"
is created, which can be
used to adjust a CJS model in the "cbrATLAS" package.
If multiple models are specified, a "fc_list"
is created containing
output from all models that could be fit with default optimizer settings.
A warning will appear if any of the models could not be fit, in which case
the user should either remove the model from consideration or specifiy initial parameter values.
Objects of class fc_list
may serve as an input in the
fc_rank() function, which ranks the performance of the model using
the Skalski and Whitlock (2020) GOF measure.
Printing a fc_obJ
will display
parameter estimates and accompanying standard errors, if available.
Each fc_obJ
is a list of the following extractable objects:
"mod_choice" = model name
"times" = dataframe of failure time, survival fraction, and censoring binary var
"fit_vals" = failure times and predicted survival under the model, 95% LCL an UCL if available
"mod_objs" = actual model object created by "flexsurvdist" or "vitality package"– much more to extract from "flexsurvdist
"par_tab" = table of parameter estimates and SE in failCompare recognized order
"KM_DF" = table of product limit (Kaplan-Meier) estimates for plotting (Kaplan and Meier 1954)
"KM_mod" = survival package K-M model estimates
'censored' = binary/logical variable the length of the data describing individual observations that are censored
Returns failure model object of class "fc_obj"
if one model specified OR
a failure model list object of class "fc_list"
if multiple models are specified.
Kaplan, E.L., and Meier, P. 1958. Nonparametric estimation from incomplete observations. Journal of the American Statistical Association 53(282):457-481.
Li, T., and Anderson, J.J. 2009. The vitality model: a way to understand population survival and demographic heterogeneity. Theoretical Population Biology 76(2):118-131.
Li, T., and Anderson, J.J. 2013. Shaping human mortality patterns through intrinsic and extrinsic vitality processes. Demographic Research 28:341-372.
Prentice, R. L. 1974. A Log Gamma Model and Its Maximum Likelihood Estimation. Biometrika: 61(3):539-544.
Skalski, J. R., and S. L. Whitlock. 2020. Vitality models found useful in modeling tag-failure times in acoustic-tag survival studies. Animal Biotelemetry 8(1):1-10.DOI:10.1186/s40317-020-00213-z.