jmMI.RdThis function implements multiple imputation for a joint model that handles time-dependent covariates with missing variables. It applies a Cox or Aalen model to the imputed data, combining results from multiple imputations using Rubin's rule.
jmMI(
ldata,
sdata,
M = 5,
id,
visitTime,
timeDep,
impModel = NULL,
coxModel = NULL,
model = "Cox"
)A data frame containing the longitudinal data. This should include variables for subject ID, time, and biomarkers.
A data frame containing the survival data. This should include variables for the subject ID, survival time, and event indicator.
The number of imputations to perform. Default is 5.
A character string specifying the variable in `ldata` and `sdata` representing the subject ID.
A character string specifying the variable in `ldata` representing the visit times.
A character vector specifying the time-dependent covariates in the longitudinal data (`ldata`).
A list of models for imputation of the time-dependent covariates. Each model should be a formula.
A formula specifying the Cox model for the survival data.
A character string specifying the model to use for the survival analysis. Options are "Cox" (default) or "Aalen".
A list containing the following components:
A summary of the results from the multiple imputation procedure.
A matrix of the estimated coefficients from the survival model for each imputation.
A matrix of the variances of the estimated coefficients for each imputation.
A character vector of the names of the variables in the survival model.
A list of the fitted survival models for each imputation.
A list of the imputed data sets.
The missing values in the time-dependent covariates.
A list of the complete imputed data sets.
The name of the survival time variable.
The name of the event indicator variable.
A character string indicating the method used ("MI").
This function is designed to handle joint modeling for longitudinal and survival data with time-dependent covariates. It allows for the imputation of missing data in the time-dependent covariates using the provided imputation models. The function can then apply a Cox or Aalen model to the imputed data and return the results.
Goodrich, B., et al. "rstanarm: Bayesian applied regression modeling via Stan. R package version 2.17. 4." Online< http://mc-stan. org (2018).
Bhattacharjee, A., Rajbongshi, B. K., & Vishwakarma, G. K. (2024). jmBIG: enhancing dynamic risk prediction and personalized medicine through joint modeling of longitudinal and survival data in big routinely collected data. BMC Medical Research Methodology, 24(1), 172.
library(survival)
model_jmMI <- jmMI(ldata=long_data,sdata=surv_data,
timeDep=c("marker_1","marker_2","marker_3"),
impModel=list(marker_1~Z_1+Z_2+Time+(1|ID),
marker_2~Z_1+Z_2+Time+(1|ID),
marker_3~Z_1+Z_2+Time+(1|ID)),
visitTime="Time",
coxModel=Surv(survival_time,survival_status)~Z_1+Z_2+
td(marker_1)+td(marker_2)+td(marker_3),
model="Cox",
id="ID")
model_jmMI
#> Fitting two stage joint model :
#> Method: MI
#> Time variable: survival_time
#> Event variable: survival_status
#>
#> Fitted model summary:
#> logHR SE CIlow CIupp p-value
#> marker_1 -0.151 0.092 -0.332 0.030 0.103
#> marker_2 -0.058 0.100 -0.253 0.138 0.563
#> marker_3 0.041 0.090 -0.136 0.218 0.649
#> Z_1 0.413 0.233 -0.043 0.869 0.076
#> Z_2 0.125 0.346 -0.554 0.804 0.719