(https://i.sstatic.net/Jf3huHf2.png)
The provided R script sets the working directory, loads and merges training data with baseline data, ensures the baseline time variable is numeric, and defines three separate dimension models using the multlcmm and lcmm functions for different sets of cognitive and functional measures. The first dimension model (mRAVLT) includes variables such as RAVLT_immediate, RAVLT_learning, RAVLT_forgetting, and LDELTOTAL, with the predictors including Years_bl, AGE, PTGENDER, PTEDUCAT, PTETHCAT, PTRACCAT, PTMARRY, and APOE4. Similarly, the second dimension model (mCDRSB_ADAS) includes CDRSB, ADAS11, and MMSE, while the third dimension model (mMMSE_FAQ) includes FAQ. The script then converts the diagnosis variable (DX) into a binary event variable (DX_binary). Finally, the mpjlcmm function is used to estimate a joint model that incorporates these three dimension models along with the survival model, specified with the Surv function, which predicts time to event (Years_bl) and event occurrence (DX_binary) based on the same predictors.
DLF is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.