MSEM mediation model with random slopes PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
 Gregory Stevens posted on Tuesday, May 31, 2011 - 7:16 pm
Dear Drs. Muthen,

I have a question on a MSEM 1-1-1 mediation model with random slopes (the code I am following is provided as Example J at

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 right-hand side of a between-level ON statement must be a BETWEEN variable." On the Mplus forums, I saw one work-around 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 y-variable on the BETWEEN level and an x-variable on the WITHIN level. This variable will be treated as a y-variable 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,
 Linda K. Muthen posted on Tuesday, May 31, 2011 - 7:42 pm
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.
 Valentin Wagner posted on Thursday, March 07, 2013 - 11:38 am
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 MSEM-mediation 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


in the DATA command finally fixed my problem.
 Linda K. Muthen posted on Thursday, March 07, 2013 - 2:43 pm
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.
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Enable HTML code in message
Automatically activate URLs in message