Interaction in MLM Mplus 8 on Mac PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
 Bonamy Oliver posted on Tuesday, July 02, 2019 - 8:38 am

I am running a multilevel model with two-levels with one interaction term at the within-level.

I need to present two plots:
a) simple slopes with slopes at -2SD, mean, +2SD of the moderator, with my x variable on the x-axis and three slopes (M) and
b) a Johnson-Neyman (limits -2SD, +2SD)

From what I've read from examples and the forum, I have added to my MPLUS script:

Loop (mod,-2,2,0.1);
ss = a+b*mod;

This script gives me a gh5 file for R (I am working on a Mac), but when I put it into R, it produces a plot with one slope plus LCI/UCI with the moderator on the X-axis. I think that it's an error in my Mplus part of the process but am not sure.

Can you help?!

Many thanks!
 Bengt O. Muthen posted on Tuesday, July 02, 2019 - 5:34 pm
I don't know what you mean by "and three slopes (M)".

What I think you want is 2 plots as a function of x for simple slopes at certain values (-2, +2) of the moderator:

Plot (ss1 ss2);
Loop (x, low, high, 0.1);
ss1 = (a+b*(-2))*x;
ss2 = (a+b*(+2))*x;
 Bonamy Oliver posted on Thursday, July 04, 2019 - 1:25 am
Thank you very much.

I can see that this is better, but it's still not quite solved!

I'm sorry I wasn't clear. I need to have one plot where my DV is on the y-axis, my IV on the x-axis and slopes are as a function of +/-2SD of moderator.

But what this suggests is that perhaps it's my R that's incorrect. Which is likely as I don't know it! I'm using mplus.plot.loop('file.gh5') and it gives ss1 on the y-axis.

Many thanks!
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