I am trying to fit a gsem model using multiply imputed data with multiple continuous factor dependent variables. I am able to successfully fit elements of the gsem model using imputed data and store starting values (to get around convergence issues) by running this code:
For the first factor:
Code:
mi estimate, dots cmdok post: gsem (Factor1 -> item1 item2 item3 item4) ///
(indepvar covariate1 covariate2 covariate3 -> Factor1), variance(e.Factor1@1)
matrix h = e(b)
matrix list h
For the second factor:
Code:
mi estimate, dots cmdok post: gsem (Factor2 -> item5 item6 item7 item8) ///
(indepvar covariate1 covariate2 covariate3 -> Factor2), variance(e.Factor2@1)
matrix j = e(b)
matrix list j
But now I'd like to include both of these lines of code in one gsem command.
Code:
mi estimate, dots cmdok post: gsem (Factor1 -> item1 item2 item3 item4) ///
(Factor2 -> item5 item6 item7 item8) (indepvar covariate1 covariate2 covariate3 -> Factor1) ///
(indepvar covariate1 covariate2 covariate3 -> Factor2), variance(e.Factor1@1) ///
variance(e.Factor2@1) from(h)
When I run this code, the system stalls and nothing happens, and I eventually have to break the command because nothing seems to be happening. Any idea as to how to make this work? I tried the same code with UNimputed data (and without the mi estimate prefixes and options), and it worked then. So I'm trying to figure out why it isn't working with the MI data.
Thank you!
0 Response to Using gsem with multiply imputed data
Post a Comment