Last chance! 50% off unlimited learning
Sale ends in
Fit parametric models (based on log-location-scale family of distributions) to right censored and/or left truncated data, with (dynamic) covariates.
Lifedata.MLE(formula, data, xt.dat = NULL, dist, method = "BFGS",
subset, truncation, na.action, weights, ref_time = NULL, starts = NULL, ...)
This function returns an object of class "Lifedata.MLE". An "Lifedata.MLE" object is a list of
Called function.
Formula argument in the input.
Vector of coefficients.
Variance-covariance matrix of coef
.
-loglikelihood
evaluated at coef
.
Survival probabilities.
Dataset used to fit the model.
A formula object, which has a Surv
object on the left of ~
and covariates on the right.
A data frame used to evaluate variables in the formula
, subset
and weights
arguments.
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.
Distribution used in the model. Can be "weibull", "lognormal", "loglogistic", "frechet".
Default is "BFGS". This function calls optim to do optimization. Other options can be found in optim.
This is an optional argument that specifies the subset of observations to be used in the fitting procedure.
An optional data frame contains truncation time and indicators.
Indicates what to be done when data contain missing values.
An optional vector of weights for each observation.
An optional vector of reference time (start time) of dynamic covariates. If it is NULL
, ref_time
is a vector of 0's.
Initial values for parameters.
Further arguments can be passed to optim.
Yili Hong
The default method for choosing start values can sometimes failed, the user may need to try several start values to make the function work.
Yili Hong and William Q. Meeker. Field-Failure Predictions Based on Failure-Time Data With Dynamic Covariate Information. Technometrics, 55(2), 135--149, 2013.
#################################################################
### 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)
# \donttest{
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)
# }
Run the code above in your browser using DataLab