

MSEM mediation model with random slopes 

Message/Author 


Dear Drs. Muthen, I have a question on a MSEM 111 mediation model with random slopes (the code I am following is provided as Example J at http://www.people.ku.edu/~preacher/pubs/syntax_appendix_081009.pdf). First, when I ran a model using the code above as a guide, Mplus gave an error that Montecarlo integration is required. When I reran the model using Montecarlo integration, I received another error: "Observed variable on the righthand side of a betweenlevel ON statement must be a BETWEEN variable." On the Mplus forums, I saw one workaround in response to this error is to specify a latent variable and use that in the %BETWEEN% commands. However, doing so returned a warning: "In the MODEL command, the following variable is a yvariable on the BETWEEN level and an xvariable on the WITHIN level. This variable will be treated as a yvariable on both levels." Given the number of issues I encountered trying to run this model, I wanted to make sure that: (i) the code from the link above is appropriate, or if it needs to be modified; and (ii) that I understand a little more about why Mplus is generating these errors/warnings to make sure they can be safely ignored/bypassed. Thank you very much for your time, Greg 


I would imagine the code from the Preacher paper was tested before it was posted and that you are making modifications. You responded correctly to the messages. The final message can be ignored. It is simply giving you information. 


I ran into the same problem (at least I got the same error messages). After trying out the same steps as posted by Gregory Stevens above without success and reading several postings on MONTECARLO INTEGRATION, I recognized that by default, Mplus imputes missing data. In a data set like mine with missing data and testing a MSEMmediation model with random slopes, Mplus seems to require MONTECARLO INTEGRATION. I am not sure whether this is the right explanation for the problem, but writing LISTWISE IS ON; in the DATA command finally fixed my problem. 


You must have had missing data on a mediator which requires numerical integration. When you use listwise deletion, you will no longer have missing data on the mediator. You will, however, have a reduced sample size. 


Dear Linda, I run into a similar problem as Gregory and Valentin using the Preacher' J Model. I understood you suggested to ignore the message MPlus generates about the misspecification of WITHIN and BETWEEN variables. However, in my case, it is an error, so no output is produced. The errors are the following: *** ERROR in MODEL command Unrestricted xvariables for analysis with TYPE=TWOLEVEL and ALGORITHM=INTEGRATION must be specified as either a WITHIN or BETWEEN variable. The following variable cannot exist on both levels: X *** ERROR in MODEL command Unrestricted xvariables for analysis with TYPE=TWOLEVEL and ALGORITHM=INTEGRATION must be specified as either a WITHIN or BETWEEN variable. The following variable cannot exist on both levels: W *** ERROR in MODEL command Unrestricted xvariables for analysis with TYPE=TWOLEVEL and ALGORITHM=INTEGRATION must be specified as either a WITHIN or BETWEEN variable. The following variable cannot exist on both levels: XW How can I avoid these errors? Thank you very much for your help. 


Please send the output and your license number to support@statmodel.com. 

Back to top 

