Good morning! I am trying to extract random slopes and intercepts from a mixed effects model (of participants with cognition scores measured over time) run on multiply imputed data, but can't get Stata to do it. I am running ver 16.1 on an institutional server that does allow me to install user-created packages.
I tried this way but got an error:
One prior post had suggested using mi xeq to run the model sequentially on each imputed dataset, but:
I tried this and got an error after a reasonable calculation time (i.e., it probably ran the model but failed at the "saving" step):
And, in case that's the wrong place for saving(), I tried putting it elsewhere but it errored out immediately:
Code that works to get these values OUTSIDE the mi environment (i.e., on non-imputed data):
It sounds like others have had this problem -- e.g.,
This thread from 2013: https://www.stata.com/statalist/arch.../msg00002.html
And this one from 2016: https://www.statalist.org/forums/for...=1643997013987
Does anyone know of a workaround for this, or have any other suggestions? Thank you in advance for any help.
I tried this way but got an error:
Code:
. mi estimate, saving(miest,replace): mixed depvar indepvars || id: timeyrs, vce(cluster clustervar) <<bunch of expected model output>> . mi predict randeffects using miest, reffects option reffects not allowed r(198);
I tried this and got an error after a reasonable calculation time (i.e., it probably ran the model but failed at the "saving" step):
Code:
. mi xeq 0: mixed depvar indepvars || id: timeyrs, vce(cluster clustervar) saving(miest0) option saving() not allowed r(198);
Code:
. mi xeq 0, saving(miest0): mixed depvar indepvars || id: timeyrs, vce(cluster clustervar) invalid numlist r(121);
Code:
. mixed depvar indepvars || id: timeyrs, vce(cluster clustervar) . predict u*, reffects . gen intercept = _b[_cons] + u1 . gen slope = _b[timeyrs] + u2
This thread from 2013: https://www.stata.com/statalist/arch.../msg00002.html
And this one from 2016: https://www.statalist.org/forums/for...=1643997013987
Does anyone know of a workaround for this, or have any other suggestions? Thank you in advance for any help.
Comment