| frailtyCmprsk | R Documentation |
Fit a Weibull competing risks model with shared gamma frailty between all transitions (0->1,0->2,...,0->k). Handles left-truncated and right-censored data. The model considers transitions from an initial state (0) to (k) competing absorbing states.
frailtyCmprsk(formulas, data, maxit = 300,
init.B, init.Theta, init.hazard.weib,
LIMparam = 1e-3, LIMlogl = 1e-3, LIMderiv = 1e-3,
x0, print.info = FALSE, print.result = TRUE,
partialH, blinding = TRUE)
formulas |
A list of formula objects. The first formula must include a
response on the left-hand side of a |
data |
A |
maxit |
Maximum number of iterations for the Marquardt optimization algorithm. Default is 300. |
init.B |
Optional. A vector of initial values for the regression coefficients.
It should contain the coefficients for each transition from 0->1, ..., up to 0-> |
init.Theta |
Optional. Initial value for the frailty variance |
init.hazard.weib |
Optional. A vector of initial values for the Weibull baseline
hazard parameters. It must be of length |
LIMparam |
Convergence threshold for the parameters based on the maximum
absolute difference between successive iterations ( |
LIMlogl |
Convergence threshold for the log-likelihood based on the absolute
difference between successive iterations ( |
LIMderiv |
Convergence threshold based on the relative distance to the optimum
(related to gradient and Hessian) ( |
x0 |
Optional. A list of numeric vectors, where each vector specifies the time points at which to compute the baseline hazard and survival functions for a given transition. The order must follow the transitions: 0->1, 0->2, ..., 0->k. If not provided, defaults to a list where each element is a sequence of 99 time points from 0 to the maximum observed time for the corresponding transition. |
print.info |
Logical. If |
print.result |
Logical. If |
partialH |
Optional. Integer vector specifying the indices of parameters to
exclude from the Hessian matrix when calculating the relative distance
convergence criterion ( |
blinding |
Logical. If |
Let T be the time to event and L \in \{1,2,...,k\} the indicator of
the cause of the event.
The cause-specific hazard rate for cause l \in \{1,2,...,k\} is:
\lambda_{l}(t) = \lim_{\Delta t \to 0^+} \frac{\mathbb{P}(t \leq T \leq t + \Delta t, L=l \mid T \geq t)}{\Delta t}
A proportional hazards model with a shared frailty term \omega_i is assumed
for each transition within group i. For the j^{th} subject
(j=1,...,n_i) in the i^{th} group (i=1,...,G), the l^{th}
(l=1,...,k) transition intensity is defined as follows:
\lambda_{l}^{ij}(t |\omega_i,X_{l}^{ij}) = \lambda_{0l}(t) \omega_i \exp(\beta_l^{T} X_{l}^{ij})
where \omega_i \sim\Gamma(\frac{1}{\theta},\frac{1}{\theta}) with
\bold{E}(\omega_i)=1 and \bold{Var}(\omega_i)=\theta.
\omega_i is the frailty term for the i^{th} group.
For subject-specific frailties, use cluster(id) where id is unique (n_i=1).
\beta_l (l=1,...,k) is the vector
of time fixed regression coefficients for the transition 0->l.
X_{l}^{ij} (l=1,...,k) is the vector
of time fixed covariates for the j^{th} subject in the i^{th} group for the
transition 0->l.
\lambda_{0l}(.) (l=1,...,k) is the
baseline hazard function for the transition 0->l.
The Weibull baseline hazard parameterization is:
\lambda(t) = \frac{\gamma}{\lambda^\gamma} \cdot t^{\gamma - 1}
where \lambda is the scale parameter and \gamma the shape parameter
An object of class 'frailtyCmprsk' containing:
Vector of the estimated parameters. Order is:
(scale(0->1), shape(0->1), scale(0->2), shape(0->2),
..., scale(0->k), shape(0->k),\hat {\theta} (if frailty), \hat{\beta}_1, \hat{\beta}_2,...,\hat{\beta}_k).
The matched function call.
Vector of estimated regression coefficients.
The marginal log-likelihood value at the final parameter estimates.
Gradient vector of the log-likelihood at the final parameter estimates.
The number of observations used in the fit.
Vector containing the number of observed events: count for 0->1, count for 0->2,..., count for 0->k, count for censoring.
Number of iterations.
Variance-covariance matrix for the parameters listed in b.
Total number of estimated parameters.
Total number of regression coefficients.
Vector of estimated Weibull baseline shape parameters (shape(0->1),shape(0->2),...,shape(0->k)).
Vector of estimated Weibull baseline scale parameters (scale(0->1),scale(0->2),...,scale(0->k)).
Convergence status code: 1=converged, 2=maximum iterations reached, 3=converged using partial Hessian, 4=the algorithm encountered a problem in the loglikelihood computation.
Logical. TRUE if a model with shared frailty (cluster(.)) was fitted.
Vector of p-values from Wald tests for the regression coefficients in coef.
Akaike Information Criterion, calculated as AIC=\frac{1}{n}(np - l(.)), where np is the number of parameters and l is the log-likelihood.
List of numeric vectors, where each vector contains the time points used for calculating the baseline functions for each transition.
List of matrices, where each matrix contains baseline hazard estimates and 95% confidence intervals at the corresponding time points in x0, for each transition.
List of matrices, where each matrix contains baseline survival estimates and 95% confidence intervals at the corresponding time points in x0, for each transition.
List of matrices, where each matrix contains the estimated median baseline survival time and its 95% confidence interval for each transition.
List of numeric vectors, where each vector contains to the linear predictors for transition 0->l (l=1,...,k).
For non-frailty models, each element is of the form \hat{\beta}_l^{t}X_l.
For frailty models, it includes the estimated log-frailty: \hat{\beta}_l^{t}X_l + \log(\hat{\omega}_i).
List of character vectors, where each vector contains the factor covariates included in the model for the corresponding transition.
List of numeric vectors, where each vector contains the chi-squared statistics from global Wald tests for factor variables for the corresponding transition.
List of integer vectors, where each vector contains the degrees of freedom for the global Wald tests for the corresponding transition.
List of numeric vectors, where each vector contains the p-values for the global Wald tests for the corresponding transition.
Binary vector of length k indicating whether any global factor tests were performed for each transition.
If Frailty is TRUE, the following components related to frailty are also included:
The number of unique groups specified by cluster(.).
The estimated variance (\hat{\theta}) of the Gamma frailty distribution.
The p-value from a Wald test for the null hypothesis H_0: \theta=0.
The estimated variance of the frailty variance estimator: \hat{Var}(\hat{\theta}).
Vector containing the empirical Bayes predictions of the frailty term for each group.
Vector containing the variances of the empirical Bayes frailty predictions.
Vector containing the standard errors of the empirical Bayes frailty predictions.
The optimization uses the robust Marquardt algorithm (Marquardt, 1963),
combining Newton-Raphson and steepest descent steps. Iterations stop when
criteria LIMparam, LIMlogl, and LIMderiv are all met.
Confidence bands for the baseline hazard and baseline survival functions were
computed using a Monte Carlo simulation approach based on the estimated Weibull
parameters. A sample of size 1000 was drawn from the joint distribution of the
shape and scale parameters. For each sampled parameter set, the baseline functions
were evaluated over the time grid defined by the vector x0. Pointwise 95
confidence bands were then obtained by computing the 2.5th and 97.5th percentiles
of the simulated values at each time point for each baseline function.
Marquardt, D. W. (1963). An algorithm for least-squares estimation of nonlinear parameters. SIAM Journal on Applied Mathematics, 11(2), 431-441.
Liquet, B., Timsit, J. F., & Rondeau, V. (2012). Investigating hospital heterogeneity with a multi-state frailty model: application to nosocomial pneumonia disease in intensive care units. BMC Medical Research Methodology, 12(1), 1-14.
data(CPRSKbmtcrr)
##-- Weibull competing risks model with
## group frailty shared between transitions --##
ModCmprsk_Group <- frailtyCmprsk(
formulas = list(
Surv(observed_time, Status, type = "mstate") ~ cluster(group) + Sex,
~ Sex
),
data = CPRSKbmtcrr,
print.info = FALSE,
maxit = 100
)
##-- Weibull competing risks model with subject-specific
## frailty shared between transitions --##
ModCmprsk_Subject <- frailtyCmprsk(
formulas = list(
Surv(observed_time, Status, type = "mstate") ~ cluster(id) + Sex,
~ Sex
),
data = CPRSKbmtcrr,
print.info = FALSE,
maxit = 100
)
##--- Simple Weibull competing risks model with left truncation ---##
ModCmprsk_LeftTrunc <- frailtyCmprsk(
formulas = list(
Surv(Age, observed_time, Status, type = "mstate") ~ Source,
~ Sex
),
data = CPRSKbmtcrr,
print.info = FALSE
)
##--- Simple Weibull competing risks model with a factor and
## no covariates for the first competing event (left truncation) ---##
ModCmprsk_Factor_LeftTrunc <- frailtyCmprsk(
formulas = list(
Surv(Age, observed_time, Status, type = "mstate") ~ Source,
~ factor(Phase)
),
data = CPRSKbmtcrr,
print.info = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.