milanwiedemann / lcsm

An R package for latent change score modelling (LCSM)
https://milanwiedemann.github.io/lcsm/
Other
17 stars 3 forks source link

Covariates & Multiple Imputation #25

Open sophieschneemelcher opened 1 year ago

sophieschneemelcher commented 1 year ago

Dear Milan,

thank you very much for this very helpful package! I use it to analyse data of an intervention study with three measurement points. I have two different questions and would be very happy to hear your opinion about this:

  1. Is it possible to include covariates like gender or age in the lcsm and how would it be done in the functions fit_uni_lcsm/ fit_bi_lcsm?
  2. In my final analysis I am working with multiple imputed datasets. Can I run the lcsm with imputed data and the final resuls will automatically be pooled like for example the growth.mi function does?

My univariate LCSM is specified as follows:

uni_lcsm <- fit_uni_lcsm(data = Rohdaten_wide_final,
                           var =  c("t1_hrw",  "t2_hrw",  "t3_hrw"),
                           model = list(
                             alpha_constant = T, 
                             beta = T, 
                             phi = T))

My bivariate LCSM is specified as follows:

bi_lcsm <- fit_bi_lcsm(data = Rohdaten_wide_final, 
                              var_x = c("t1_hrw", "t2_hrw", "t3_hrw"),
                              var_y = c("t1_new_WLT_LS_g", "t2_new_WLT_LS_g", "t3_new_WLT_LS_g"),
                              model_x = list(
                                alpha_constant = T, 
                                beta = T, 
                                phi = T),
                              model_y = list(
                                alpha_constant = T,
                                beta = T, 
                                phi = T),
                              coupling = list(
                                delta_lag_xy = T, 
                                xi_lag_yx = T))

Any support is well appreciated Sophie