Lifedata.MLE {SPREDA} | R Documentation |
Parametric Fitting for Lifetime Data
Description
Fit parametric models (based on log-location-scale family of distributions) to right censored and/or left truncated data, with (dynamic) covariates.
Usage
Lifedata.MLE(formula, data, xt.dat = NULL, dist, method = "BFGS",
subset, truncation, na.action, weights, ref_time = NULL, starts = NULL, ...)
Arguments
formula |
A formula object, which has a |
data |
A data frame used to evaluate variables in the |
xt.dat |
A data frame contains dynamic covariates. The first and second columns must be sample id and time. If specified, cumulative exposure model will be used to fit the data. |
dist |
Distribution used in the model. Can be "weibull", "lognormal", "loglogistic", "frechet". |
method |
Default is "BFGS". This function calls optim to do optimization. Other options can be found in optim. |
subset |
This is an optional argument that specifies the subset of observations to be used in the fitting procedure. |
truncation |
An optional data frame contains truncation time and indicators. |
na.action |
Indicates what to be done when data contain missing values. |
weights |
An optional vector of weights for each observation. |
ref_time |
An optional vector of reference time (start time) of dynamic covariates. If it is |
starts |
Initial values for parameters. |
... |
Further arguments can be passed to optim. |
Details
The default method for choosing start values can sometimes failed, the user may need to try several start values to make the function work.
Value
This function returns an object of class "Lifedata.MLE". An "Lifedata.MLE" object is a list of
call |
Called function. |
formula |
Formula argument in the input. |
coef |
Vector of coefficients. |
vov |
Variance-covariance matrix of |
min |
|
surv |
Survival probabilities. |
dat |
Dataset used to fit the model. |
Author(s)
Yili Hong
References
Yili Hong and William Q. Meeker. Field-Failure Predictions Based on Failure-Time Data With Dynamic Covariate Information. Technometrics, 55(2), 135–149, 2013.
See Also
Surv, optim, summary.Lifedata.MLE. See methods(class="Lifedata.MLE") for all the functions related to "Lifedata.MLE" object.
Examples
#################################################################
### right censored data
data(shock)
res1=Lifedata.MLE(Surv(Distance, Censor)~1, data=shock, dist="weibull")
res1
summary(res1)
res2=Lifedata.MLE(Surv(Distance, Censor)~1, data=shock, dist="lognormal")
res2
summary(res2)
#################################################################
### left truncated right censoring data
data(testdata)
test=Lifedata.MLE(Surv(truncation.age, age, failure)~1, data=testdata,dist="weibull",
method="Nelder-Mead", subset=(group=="MC_Old"))
summary(test)
#################################################################
### dynamix covariates
data(Prod2.xt.dat)
data(Prod2.fai.dat)
test=Lifedata.MLE(Surv(failure.time, delta)~1, data=Prod2.fai.dat,xt.dat=Prod2.xt.dat,
starts=c(12, 3.5, log(2)), dist="weibull")
summary(test)