Fits a Weibull model with Gamma frailties for multivariate survival data under maximum likelihood
Usage
weibull.frailty(formula = formula(data), data = parent.frame(),
id = "id", subset, na.action, init, control = list())
Arguments
formula
an object of class formula: a symbolic description of the model to be fitted. The response must
be a survival object as returned by function Surv().
data
an optional data frame containing the variables specified in the model.
id
either a character string denoting a variable name in data or a numeric vector specifying which event times belong to
the same cluster (e.g., hospital, patient, etc.).
subset
an optional vector specifying a subset of observations to be used in the fitting process.
na.action
what to do with missing values.
init
a numeric vector of length p + 3 of initial values. The first p elements should correspond to the regression coefficients
for the covariates, and the last 3 to log-scale, log-shape, and log-frailty-variance, respectively. See Details.
control
a list of control values with components:
optimizer
a character string indicating which optimizer to use; options are "optim" (default) and
"nlminb".
parscale
the parscale control argument for optim(), or the scale argument for
nlminb(). It should be a numeric vector of length equal to the number of parameters. Default is 0.01
for all parameters.
maxit
the maximum number of iterations. Default is 500.
numeriDeriv
a character string indicating which type of numerical derivative to use to compute the
Hessian matrix; options are "fd" denoting the forward difference approximation, and "cd" (default)
denoting the central difference approximation.
eps.Hes
tolerance value used in the numerical derivative method. Default is 1e-03.
Details
The fitted model is defined as follows:
λ(t_i | ω_i) = λ_0(t_i) ω_i exp(x_i^T β),
where i denotes the subject, λ(.)
denotes the hazard function, conditionally on the frailty ω_i, x_i is a vector of covariates with corresponding regression
coefficients β, and λ_0(.) is the Weibull baseline hazard defined as λ_0(t) = shape *
scale * t^{shape -1}. Finally, for the frailties we assume ω_i ~ Gamma(η, η), with
η^{-1} denoting the unknown variance of ω_i's.
Value
an object of class weibull.frailty with components:
coefficients
a list with the estimated coefficients values. The components of this list are: betas, scale, shape,
and var.frailty, and correspond to the coefficients with the same name.
hessian
the hessian matrix at convergence. For the shape, scale, and var-frailty parameters the Hessian is computed on the log scale.
logLik
the log-likelihood value.
control
a copy of the control argument.
y
an object of class Surv containing the observed event times and the censoring indicator.
x
the design matrix of the model.
id
a numeric vector specifying which event times belong to the same cluster.
nam.id
the value of argument id, if that was a character string.
terms
the term component of the fitted model.
data
a copy of data or the created model.frame.
call
the matched call.
Note
weibull.frailty() currently supports only right-censored data.
weibull.frailty(Surv(time, status) ~ age + sex, kidney)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(JM)
Loading required package: MASS
Loading required package: nlme
Loading required package: splines
Loading required package: survival
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/JM/weibull.frailty.Rd_%03d_medium.png", width=480, height=480)
> ### Name: weibull.frailty
> ### Title: Weibull Model with Gamma Frailties
> ### Aliases: weibull.frailty
> ### Keywords: multivariate regression
>
> ### ** Examples
>
> weibull.frailty(Surv(time, status) ~ age + sex, kidney)
Call:
weibull.frailty(formula = Surv(time, status) ~ age + sex, data = kidney)
Frailty distribution: Gamma
Frailty variance: 0.5135
Coefficients:
age sex
0.0070 -1.9375
Shape: 1.219
Scale: 0.0904
log-Lik: -332.1891
>
>
>
>
>
> dev.off()
null device
1
>