The goal of CIMPLE is to offer a collection of methods involved with analyzing longitudinal EHR data with possibly informative observational time. These methods are grouped into two classes depending on the inferential task. One group focuses on estimating the effect of an exposure on a longitudinal biomarker while the other group assesses the impact of a longitudinal biomarker on time-to-diagnosis outcomes.
You can install the development version of CIMPLE from GitHub with:
# install.packages("pak")
::pak("jiacongD/CIMPLE") pak
A very basic workflow:
library(CIMPLE)
= "time"
time_var = "id"
id_var = "Y"
outcome_var = c("Z", "X")
VPM_variables = c("Z", "X")
LM_fixedEffect_variables = "Z"
LM_randomEffect_variables
# Run the standard LME model
= long_est(
fit_standardLME long_data = train_data,
method = "standard_LME",
id_var = id_var,
outcome_var = outcome_var,
LM_fixedEffect_variables = LM_fixedEffect_variables,
time = time_var,
LM_randomEffect_variables = LM_randomEffect_variables,
VPM_variables = VPM_variables
)#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
#> unable to evaluate scaled gradient
#> Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
#> Model failed to converge: degenerate Hessian with 1 negative eigenvalues
# Return the coefficient estimates
$beta_hat
fit_standardLME#> (Intercept) Z X time
#> -2.18544419 -0.47282269 0.59100042 0.09982721