jmLOCF.RdThis function fits a joint model using the Last Observation Carried Forward (LOCF) method for time-dependent biomarkers with missing values. It handles longitudinal data and survival data jointly using a Cox proportional hazards model (or an Aalen additive model). The function imputes missing values for time-dependent biomarkers using the LOCF method.
jmLOCF(ldata, sdata, id, visitTime, timeDep, coxModel = NULL, model = "Cox")A data frame containing the longitudinal data. This should include individual-level data with repeated measures over time.
A data frame containing the survival data, including the time-to-event and event status variables.
A string specifying the column name in both `ldata` and `sdata` identifying the individual subject (e.g., patient ID).
A string specifying the column name in `ldata` for the time points at which observations were made.
A vector of column names in `ldata` specifying the time-dependent biomarkers.
A formula representing the Cox proportional hazards model. It is required to specify the structure of the model with the time-dependent biomarker.
A string specifying the type of survival model to use. The default is `"Cox"`, but `"Aalen"` can be specified for an Aalen additive model.
A list containing the following components:
A summary of the fitted model.
A data frame containing the coefficients from the fitted model.
A data frame containing the variance-covariance matrix of the coefficients.
The names of the coefficients.
The fitted model object (either `coxph` or `aalen`).
A data frame containing the imputed longitudinal data.
A data frame containing the complete data with time-dependent biomarker imputations.
The name of the time variable used in the model.
The name of the event variable used in the model.
The method used for imputations ("LOCF").
This function implements a joint modeling framework for longitudinal and survival data using the LOCF method for imputing missing time-dependent biomarkers. It supports both the Cox proportional hazards model (`model="Cox"`) and the Aalen additive model (`model="Aalen"`).
The longitudinal data is first pre-processed to create time-dependent covariates, and then the missing biomarker values are imputed using LOCF. The survival data is used to fit a joint model, where the survival model accounts for the time-dependent covariates.
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_jmLOCF<-jmLOCF(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_jmLOCF
#> Fitting two stage joint model :
#> Method: LOCF
#> Time variable: survival_time
#> Event variable: survival_status
#>
#> Fitted model summary:
#> logHR SE CIlow CIupp p-value
#> marker_1 -0.012 0.026 -0.064 0.040 0.655
#> marker_2 0.015 0.037 -0.058 0.088 0.680
#> marker_3 0.023 0.043 -0.061 0.106 0.596
#> Z_1 0.074 0.087 -0.096 0.243 0.395
#> Z_2 -0.284 0.325 -0.920 0.353 0.383