This 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")

Arguments

ldata

A data frame containing the longitudinal data (e.g., biomarkers over time).

sdata

A data frame containing the survival data with time-to-event and event indicators.

id

A character string indicating the column name for the subject identifier in both `ldata` and `sdata`.

visitTime

A character string indicating the column name for the visit time in the longitudinal data.

timeDep

A vector of time-dependent covariates that vary over time in the longitudinal data.

coxModel

A `coxph` model object (optional). The formula specifies the time-to-event outcome, including time-dependent covariates.

model

A character string specifying the model to use. Options are "Cox" for Cox proportional hazards or "Aalen" for Aalen additive hazards.

Value

A list containing the following elements:

res

A summary of the Cox model fit.

coefs

A data frame of model coefficients for the fitted model.

vars

A data frame of the variances of the coefficients.

nam

The names of the variables in the model.

fitted_model

A list containing the fitted model object.

imp.data

The imputed data used for the analysis.

miss.data

The missing values in the time-dependent covariates.

complete_data

The complete data with imputed values.

tname

The name of the time variable in the survival data.

ename

The name of the event variable in the survival data.

method

The method used for joint modeling (always "CC" for this function).

Details

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.

References

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.

See also

Author

Atanu Bhattacharjee, Bhrigu Kumar Rajbongshi and Gajendra Kumar Vishwakarma

Examples

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