fit_elife {longevity} | R Documentation |
Fit excess lifetime models by maximum likelihood
Description
This function is a wrapper around constrained optimization routines for different models with non-informative censoring and truncation patterns.
Usage
fit_elife(
time,
time2 = NULL,
event = NULL,
type = c("right", "left", "interval", "interval2"),
ltrunc = NULL,
rtrunc = NULL,
thresh = 0,
status = NULL,
family = c("exp", "gp", "weibull", "gomp", "gompmake", "extgp", "gppiece",
"extweibull", "perks", "perksmake", "beard", "beardmake"),
weights = NULL,
export = FALSE,
start = NULL,
restart = FALSE,
arguments = NULL,
check = FALSE,
...
)
Arguments
time |
excess time of the event of follow-up time, depending on the value of event |
time2 |
ending excess time of the interval for interval censored data only. |
event |
status indicator, normally 0=alive, 1=dead. Other choices are |
type |
character string specifying the type of censoring. Possible values are " |
ltrunc |
lower truncation limit, default to |
rtrunc |
upper truncation limit, default to |
thresh |
vector of thresholds |
status |
integer vector giving status of an observation. If |
family |
string; choice of parametric family |
weights |
weights for observations |
export |
logical; should data be included in the returned object to produce diagnostic plots? Default to |
start |
vector of starting values for the optimization routine. If |
restart |
logical; should multiple starting values be attempted? Default to |
arguments |
a named list specifying default arguments of the function that are common to all |
check |
logical; if |
... |
additional parameters, currently ignored |
Value
an object of class elife_par
Note
The extended generalized Pareto model is constrained
to avoid regions where the likelihood is flat so \xi \in [-1, 10]
in
the optimization algorithm.
The standard errors are obtained via the observed information matrix, calculated using the hessian. In many instances, such as when the shape parameter is zero or negative, the hessian is singular and no estimates are returned.
Examples
data(ewsim, package = "longevity")
fit1 <- fit_elife(
arguments = ewsim,
export = TRUE,
family = "exp")
fit2 <- fit_elife(
arguments = ewsim,
export = TRUE,
family = "gp")
plot(fit1)
summary(fit1)
anova(fit2, fit1)