parfm {parfm} | R Documentation |
Parametric Frailty Models
Description
Fits parametric Frailty Models by maximizing the marginal likelihood.
Usage
parfm(formula, cluster = NULL, strata = NULL, data,
inip = NULL, iniFpar = NULL,
dist = c("weibull", "inweibull", "frechet", "exponential",
"gompertz", "loglogistic", "lognormal", "logskewnormal"),
frailty = c("none", "gamma", "ingau", "possta",
"lognormal", "loglogistic"),
method = "nlminb",
maxit = 500, Fparscale = 1, showtime = FALSE, correct = 0)
Arguments
formula |
A |
cluster |
The name of a cluster variable in data. |
strata |
The name of a strata variable in data. |
data |
A |
inip |
The vector of initial values. First components are for the baseline hazard parameters according to the order given in 'details'; Other components are for the regression parameters according to the order given in 'formula'. |
iniFpar |
The initial value of the frailty parameter. |
dist |
The baseline hazard distribution.
One of |
frailty |
The Frailty distribution.
One of: |
method |
The optimisation method from the function |
maxit |
Maximum number of iterations (see |
Fparscale |
the scaling value for the frailty parameter in |
showtime |
Show the execution time? |
correct |
A correction factor that does not change the marginal log-likelihood except for an additive constant given by #clusters * correct * log(10). It may be useful in order to get finite log-likelihood values in case of many events per cluster with Positive Stable frailties. Note that the value of the log-likelihood in the output is the re-adjusted value. |
Details
Baseline hazards
The Weibull hazard (dist="weibull"
) is
with .
The inverse Weibull (or Fréchet) hazard (dist="inweibull"
or dist="frechet"
) is
with .
The exponential hazard (dist="exponential"
) is
with .
The Gompertz hazard (dist="gompertz"
) is
with .
The lognormal hazard (dist="lognormal"
) is
with , and where
and
are the density and distribution functions of a standard Normal random variable.
The loglogistic hazard (dist="loglogistic"
) is
with .
The log-skew-normal hazard (dist="logskewnormal"
) is
obtained as the ratio between the density and the cumulative distribution function
of a log-skew normal random variable (Azzalini, 1985),
which has density
with , and where
and
are the density and distribution functions of a standard Normal random variable.
Of note, if
then the log-skew-normal boils down
to the log-normal distribution, with
and
.
Frailty distributions
The gamma frailty distribution (frailty="gamma"
) is
with and where
is the gamma function.
The inverse Gaussian frailty distribution (frailty="ingau"
) is
with .
The positive stable frailty distribution (frailty="poosta"
) is
with .
The lognormal frailty distribution (frailty="lognormal"
) is
with .
As the Laplace tranform of the lognormal frailties does not exist in closed form,
the saddlepoint approximation is used (Goutis and Casella, 1999).
Value
An object of class parfm
.
Author(s)
Federico Rotolo [aut, cre], Marco Munda [aut], Andrea Callegaro [ctb]
References
Munda M, Rotolo F, Legrand C (2012). parfm: Parametric Frailty Models in R. Journal of Statistical Software, 51(11), 1-20. DOI <doi: 10.18637/jss.v051.i11>
Duchateau L, Janssen P (2008). The frailty model. Springer.
Wienke A (2010). Frailty Models in Survival Analysis. Chapman & Hall/CRC biostatistics series. Taylor and Francis.
Goutis C, Casella G (1999). Explaining the Saddlepoint Approximation. The American Statistician 53(3), 216-224. DOI <doi: 10.1080/00031305.1999.10474463>
Azzalini A (1985). A class of distributions which includes the normal ones. Scandinavian Journal of Statistics, 12(2):171-178.
See Also
select.parfm
,
ci.parfm
,
predict.parfm
Examples
#------Kidney dataset------
data(kidney)
# type 'help(kidney)' for a description of the data set
kidney$sex <- kidney$sex - 1
parfm(Surv(time,status) ~ sex + age, cluster = "id",
data = kidney, dist = "exponential", frailty = "gamma")
parfm(Surv(time,status) ~ sex + age, cluster = "id",
data = kidney, dist = "exponential", frailty = "lognormal")
parfm(Surv(time,status) ~ sex + age, cluster = "id",
data = kidney, dist = "weibull", frailty = "ingau")
parfm(Surv(time,status) ~ sex + age, cluster = "id",
data = kidney, dist="gompertz", frailty="possta", method="CG")
parfm(Surv(time,status) ~ sex + age, cluster = "id",
data = kidney, dist="logskewnormal", frailty="possta", method = 'BFGS')
#--------------------------
#------Asthma dataset------
data(asthma)
head(asthma)
# type 'help(asthma)' for a description of the data set
asthma$time <- asthma$End - asthma$Begin
parfm(Surv(time, Status) ~ Drug, cluster = "Patid", data = asthma,
dist = "weibull", frailty = "gamma")
parfm(Surv(time, Status) ~ Drug, cluster = "Patid", data = asthma,
dist = "weibull", frailty = "lognormal")
parfm(Surv(Begin, End, Status) ~ Drug, cluster = "Patid",
data = asthma[asthma$Fevent == 0, ],
dist = "weibull", frailty = "lognormal", method = "Nelder-Mead")
#--------------------------