| frailtyIllnessDeath | R Documentation |
Fit a three-state illness-death model (states: 0=Healthy, 1=Illness, 2=Death) using Weibull baseline hazards for all transitions (0->1, 0->2, 1->2). Allows for shared gamma frailty between the three transitions, acting multiplicatively on the hazards within specified groups (clusters). The model accommodates right-censored and left-truncated data. The transition from the illness state to death (1->2) can be modeled using either a Markov or a Semi-Markov assumption for the baseline hazards time scale.
frailtyIllnessDeath (formula, formula.terminalEvent, data, model = "Semi-Markov",
maxit = 300, init.B, init.Theta, init.hazard.weib,
LIMparam = 1e-3, LIMlogl = 1e-3, LIMderiv = 1e-3,
partialH, x01, x02, x12, print.info = FALSE,
print.result = TRUE, blinding = TRUE)
formula |
A formula object with the response on the left of a |
formula.terminalEvent |
A formula object. Response must be a Note on Left Truncation: The illness-death model implemented assumes a
single entry time per subject. This entry time, specified in |
data |
A 'data.frame' with the variables used in the formulas. |
model |
Character string specifying the model for the 1->2 transition baseline hazard. Allowed values: "Semi-Markov" (default) or "Markov". |
maxit |
Maximum number of iterations for the Marquardt algorithm. Default is 300. |
init.B |
Optional. A vector of initial values for regression coefficients.
Order is ( |
init.Theta |
Optional. Initial value for the frailty variance |
init.hazard.weib |
Optional. A vector of initial values for the Weibull baseline hazard parameters. Must be of size 6, in the order: scale(0->1), shape(0->1), scale(0->2), shape(0->2), scale(1->2), shape(1->2). If omitted, the baseline hazard parameters are initialized from default values. These defaults are obtained by fitting three independent Weibull proportional hazards models (without frailty), one for each transition. |
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) ( |
partialH |
Optional. Integer vector specifying the indices of parameters to
exclude from the Hessian matrix when calculating the relative distance
convergence criterion ( |
x01 |
Optional. Numeric vector of time points at which to calculate baseline hazard and survival functions for transition 0->1. Defaults to a sequence of 99 points from 0 to the maximum observed time for transition 0->1. |
x02 |
Optional. Numeric vector of time points at which to calculate baseline hazard and survival functions for transition 0->2. Defaults to a sequence of 99 points from 0 to the maximum observed time for transition 0->2. |
x12 |
Optional. Numeric vector of time points at which to calculate baseline hazard and survival functions for transition 1->2. Defaults to a sequence of 99 points from 0 to the maximum observed time for transition 1->2. |
print.info |
Logical. If |
print.result |
Logical. If |
blinding |
Logical. If |
Let T_1 be the time to the non-terminal event (illness, 0->1) and
T_2 be the time to the terminal event (death, 0->2 or 1->2).
The transition intensities are defined as:
\lambda_{01}(t) = \lim_{\Delta t \to 0^+} \frac{\mathbb{P}(t \leq T_1 \leq t + \Delta t \mid T_1 \geq t, T_2 \geq t)}{\Delta t}
\lambda_{02}(t) = \lim_{\Delta t \to 0^+} \frac{\mathbb{P}(t \leq T_2 \leq t + \Delta t \mid T_1 \geq t, T_2 \geq t)}{\Delta t}
\lambda_{12}(t \mid T_1 = s) = \lim_{\Delta t \to 0^+} \frac{\mathbb{P}(t \leq T_2 \leq t + \Delta t \mid T_1 = s, T_2 \geq t)}{\Delta t} \quad (0 < s < 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 transition intensities are
defined as follows:
\lambda_{01}^{ij}(t |\omega_i,X_{01}^{ij}) = \lambda_{0,01}(t) \omega_i \exp(\beta_1^{T} X_{01}^{ij})
\lambda_{02}^{ij}(t |\omega_i,X_{02}^{ij}) = \lambda_{0,02}(t) \omega_i \exp(\beta_2^{T} X_{02}^{ij})
\lambda_{12}^{ij}(t | T_1 = s, \omega_i, X_{12}^{ij}) = \lambda_{0,12}(t | T_1 = s) \omega_i \exp(\beta_3^{T} X_{12}^{ij}) \quad (0 < s < t)
\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_1, \beta_2 and \beta_3 are respectively the vectors
of time fixed regression coefficients for the transitions 0->1, 0->2 and 1->2.
X_{01}^{ij}, X_{02}^{ij} and X_{12}^{ij} are respectively the vectors
of time fixed covariates for the j^{th} subject in the i^{th} group for the
transitions 0->1, 0->2 and 1->2.
\lambda_{0,01}(.), \lambda_{0,02}(.) and \lambda_{0,12}(.) are respectively
the baseline hazard functions for the transitions 0->1, 0->2 and 1->2.
The baseline hazard \lambda_{0,12}(t | T_1 = s) depends on the 'model' argument:
Markov model: \lambda_{0,12}(t | T_1 = s) = \lambda_{0,12}(t).
The risk depends on the time since origin.This model is suitable when the risk for
the transition 1 -> 2 is primarily influenced by absolute time rather than the duration spent in state 1.
Semi-Markov model: \lambda_{0,12}(t | T_1 = s) = \lambda_{0,12}(t - s).
The risk depends on the time since entering state 1 (sojourn time).
This model is appropriate when the risk for the transition 1 -> 2 is
more influenced by the time spent in state 1 rather than the time elapsed
since the initial starting point.
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 'frailtyIllnessDeath ' containing:
Vector of the estimated parameters. Order is:
(scale(0->1), shape(0->1), scale(0->2), shape(0->2), scale(1->2), shape(1->2),
\hat {\theta} (if frailty), \hat{\beta}_1, \hat{\beta}_2, \hat{\beta}_3).
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 subjects (observations) used in the fit.
Vector containing the number of observed events: count for 0->1, count for 0->2, count for 1->2 and 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(1->2)).
Vector of estimated Weibull baseline scale parameters (scale(0->1),scale(0->2),scale(1->2)).
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.
Vector of time points used for calculating baseline functions for transition 0->1.
Vector of time points used for calculating baseline functions for transition 0->2.
Vector of time points (or sojourn times if Semi-Markov) used for calculating baseline functions for transition 1->2.
Matrix containing baseline hazard estimates and 95% confidence intervals for transition 0->1 calculated at x01.
Matrix containing baseline hazard estimates and 95% confidence intervals for transition 0->2 calculated at x02.
Matrix containing baseline hazard estimates and 95% confidence intervals for transition 1->2 calculated at x12.
Matrix containing baseline survival estimates and 95% confidence intervals for transition 0->1 calculated at x01.
Matrix containing baseline survival estimates and 95% confidence intervals for transition 0->2 calculated at x01.
Matrix containing baseline survival estimates and 95% confidence intervals for transition 0->2 calculated at x12.
Matrix containing the estimated median baseline survival time and its 95% confidence interval for transition 0->1.
Matrix containing the estimated median baseline survival time and its 95% confidence interval for transition 0->2.
Matrix containing the estimated median baseline survival time and its 95% confidence interval for transition 1->2.
Vector of linear predictors calculated for transition 0->1. For non-frailty models, this is \hat{\beta}_1^{t}X_{01}. For frailty models, it includes the estimated log-frailty: \hat{\beta}_1^{t}X_{01} + \log(\hat{\omega}_i).
Vector of linear predictors calculated for transition 0->2. For non-frailty models, this is \hat{\beta}_2^{t}X_{02}. For frailty models, it includes the estimated log-frailty: \hat{\beta}_2^{t}X_{02} + \log(\hat{\omega}_i).
Vector of linear predictors calculated for transition 1->2. For non-frailty models, this is \hat{\beta}_3^{t}X_{12}. For frailty models, it includes the estimated log-frailty: \hat{\beta}_3^{t}X_{12} + \log(\hat{\omega}_i).
Character vector identifying factor covariates included for transition 0->1.
Character vector identifying factor covariates included for transition 0->2.
Character vector identifying factor covariates included for transition 1->2.
Vector containing the chi-squared statistics for global Wald tests of factor variables for transition 0->1.
Vector containing the chi-squared statistics for global Wald tests of factor variables for transition 0->2.
Vector containing the chi-squared statistics for global Wald tests of factor variables for transition 1->2.
Vector containing the degrees of freedom for the global Wald tests for transition 0->1.
Vector containing the degrees of freedom for the global Wald tests for transition 0->2.
Vector containing the degrees of freedom for the global Wald tests for transition 1->2.
Vector containing the p-values for the global Wald tests for transition 0->1.
Vector containing the p-values for the global Wald tests for transition 0->2.
Vector containing the p-values for the global Wald tests for transition 1->2.
Indicator (0/1) whether any global factor tests were performed for transition 0->1.
Indicator (0/1) whether any global factor tests were performed for transition 0->2.
Indicator (0/1) whether any global factor tests were performed for transition 1->2.
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.
Lee, C., Gilsanz, P., & Haneuse, S. (2021). Fitting a shared frailty illness-death model to left-truncated semi-competing risks data to examine the impact of education level on incident dementia. BMC Medical Research Methodology, 21(1), 1-13.
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(readmission2)
##-- Fitting models --##
#-- Semi-Markovian Weibull Illness-Death model with
# group frailty shared between transitions --#
ModIllnessDeath_SemiMarkov_Group <- frailtyIllnessDeath(
formula = Surv(observed_disease_time, disease_status) ~ cluster(group) + sex,
formula.terminalEvent = Surv(observed_death_time, death_status) ~ sex,
data = readmission2,
model = "Semi-Markov",
print.info = FALSE,
maxit = 100
)
#-- Markovian Weibull Illness-Death model with subject-specific
# frailty shared between transitions --#
ModIllnessDeath_Markov_Subject <- frailtyIllnessDeath(
formula = Surv(observed_disease_time, disease_status) ~ cluster(id) + sex,
formula.terminalEvent = Surv(observed_death_time, death_status) ~ sex,
data = readmission2,
model = "Markov",
print.info = FALSE,
maxit = 100
)
#--- Semi-Markovian Weibull Illness-Death model with a factor and
# no covariates for the non-terminal event ---#
ModIllnessDeath_SemiMarkov_NoCov_Factor <- frailtyIllnessDeath(
formula = Surv(observed_disease_time, disease_status) ~ 1,
formula.terminalEvent = Surv(observed_death_time, death_status) ~ factor(dukes),
data = readmission2,
model = "Semi-Markov",
print.info = FALSE,
maxit = 100
)
#--- Semi-Markovian Weibull Illness-Death model with left truncation ---#
data(Paq810)
ModIllnessDeath_SemiMarkov_LeftTrunc <- frailtyIllnessDeath(
formula = Surv(e, r, dementia) ~ gender + certif,
formula.terminalEvent = Surv(t, death) ~ certif,
data = Paq810,
model = "Semi-Markov",
print.info = FALSE,
maxit = 100
)
#--- Markovian Weibull Illness-Death model with left truncation ---#
ModIllnessDeath_Markov_LeftTrunc <- frailtyIllnessDeath(
formula = Surv(e, r, dementia) ~ gender + certif,
formula.terminalEvent = Surv(t, death) ~ certif,
data = Paq810,
model = "Markov",
print.info = FALSE,
maxit = 100
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.