lifedata.MLE: Parametric Fitting for Lifetime Data

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Fit parametric models (based on log-location-scale family of distributions) to right censored and/or left truncated data, with (dynamic) covariates.

Usage

1
2
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 Surv object on the left of ~ and covariates on the right.

data

A data frame used to evaluate variables in the formula, subset and weights arguments.

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 NULL, ref_time is a vector of 0's.

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 coef.

min

-loglikelihood evaluated at coef.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#################################################################
### 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)

SPREDA documentation built on May 2, 2019, 4 p.m.