jmCC.RdThis function performs joint modeling of survival and longitudinal data with time-dependent covariates using either a Cox proportional hazards model or an Aalen additive hazards model. The function handles the missing data in longitudinal measurements through complete case analysis(CC).
jmCC(ldata, sdata, id, visitTime, timeDep, coxModel = NULL, model = "Cox")A data frame containing the longitudinal data (e.g., biomarkers over time).
A data frame containing the survival data with time-to-event and event indicators.
A character string indicating the column name for the subject identifier in both `ldata` and `sdata`.
A character string indicating the column name for the visit time in the longitudinal data.
A vector of time-dependent covariates that vary over time in the longitudinal data.
A `coxph` model object (optional). The formula specifies the time-to-event outcome, including time-dependent covariates.
A character string specifying the model to use. Options are "Cox" for Cox proportional hazards or "Aalen" for Aalen additive hazards.
A list containing the following elements:
A summary of the Cox model fit.
A data frame of model coefficients for the fitted model.
A data frame of the variances of the coefficients.
The names of the variables in the model.
A list containing the fitted model object.
The imputed data used for the analysis.
The missing values in the time-dependent covariates.
The complete data with imputed values.
The name of the time variable in the survival data.
The name of the event variable in the survival data.
The method used for joint modeling (always "CC" for this function).
This function requires the survival data (`sdata`) to contain a time-to-event variable and a binary event indicator. The longitudinal data (`ldata`) should contain time-varying biomarkers or covariates. The time-dependent covariates are specified via the `timeDep` argument, which must be present in `ldata`.
The model formula for the Cox model is generated automatically based on the provided `coxModel`. If no `coxModel` is provided, the function will use a default Cox model.
The time-dependent covariates are handled through imputation and the appropriate survival model (Cox or Aalen) is fit to the data.
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_jmCC <-jmCC(ldata=long_data,sdata=surv_data,
timeDep=c("marker_1","marker_2","marker_3"),
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_jmCC
#> Fitting two stage joint model :
#> Method: CC
#> Time variable: survival_time
#> Event variable: survival_status
#>
#> Fitted model summary:
#> logHR SE CIlow CIupp p-value
#> marker_1 -0.112 0.109 -0.326 0.102 0.306
#> marker_2 -0.176 0.152 -0.474 0.122 0.246
#> marker_3 -0.028 0.139 -0.301 0.244 0.838
#> Z_1 0.529 0.309 -0.076 1.134 0.087
#> Z_2 0.083 0.551 -0.998 1.163 0.881