mw posted on Tuesday, September 11, 2012 - 1:26 am
I'm all new to this and not particularly good! But I need to test a path model. I've got to grips with testing mediation, but now need to put a moderator in the model. I've trawled through some guides but still confused, I really just need some code to do it in Mplus.
I'm better with visuals rather than trying to explain it, so have provided my model here...
Then you have to think about how your moderator of the M ->Y relationship might interact with M (and X, Y). You have an interaction between your moderator and your mediator. Interactions involving DVs (the mediator in your case) may pose special analysis issues - for instance, the chi-square test of model fit is off because the variance of Y conditional on X and your moderator is not constant.
mw posted on Tuesday, September 11, 2012 - 12:10 pm
I've had a look at the preacher and hayes mplus code for a similar kind of analysis (I think it is anyway!)assuming w is the moderator and m is the mediator
y on m x w mw; m on x; w with m; mw with m;
Would that be suitable, if I just added a few more 'x' variables to recreate my model?
I suppose you are saying I need to work out if the moderator affects the A B and C variables in my model (pictured above) as well.
To that I'm not really sure! It should correlate, but can I just specify that it will or will I end up in a huge over/non-identified mess?
This code should work. It is a model in which the 'b' path is moderated by z, and it contains 3 x variables.
TITLE: moderated mediation with 3 x's; DATA: FILE IS mplus.help3.dat; VARIABLE: NAMES ARE x1-x3 m z y; USEVARIABLES ARE all mz; DEFINE: mz=m*z; MODEL: y ON m x1-x3 z mz; m ON x1-x3; m WITH z mz; x1-x3;
You would need to include a MODEL CONSTRAINT section that computes the conditional indirect effects that are of interest, but this is the basic model syntax.
mw posted on Wednesday, September 12, 2012 - 6:26 am
Thank you! I'll run it and see!
mw posted on Sunday, September 16, 2012 - 12:54 pm
I've decided to change my mediator to a latent variable. Will the above code be the same? or do I have to create/define the interaction differently with a latent variable.
I've read something about XWITH (?) but not sure how I'd include that in Prof. Preacher's code above.
Use XWITH to create the latent variable interaction and include it on the right-hand side of ON as shown above.
marlies posted on Wednesday, April 17, 2013 - 10:10 am
Dear drs. Muthen,
I have a question about a model with one moderation and a mediation, which is also moderated. This is my full model, with dependent variable y, predictor x, mediator m and second level moderator z.
MODEL:%WITHIN% s1 | y ON x ; s2 | m ON x; y ON m;
%BETWEEN% y m s1 s2 ON z;
y m s1 s2 WITH y m s1 s2 ;
In this model, the cross-level interaction between x and z on y is not signficant and neither is the cross-level interaction effect of x and z on m.
However, if I take out the interaction of x and z on m, so I run this model:
s1 | y ON x ; y ON m; m ON x;
%BETWEEN% y s1 ON z;
y WITH s1;
then suddenly the interaction of x and z on y is significant (the p value changes from a non-significant 0.28 to a significant 0.047). However, it cannot have turned significant due to the mediation of m, since there was no interaction effect of x and z on m.
Could it be that testing my full path model (so with both interaction effects)is statistically not okay?
I think your full model is correctly done. When you change m ON x from random to fixed, that may well influence the random y ON x regression.
You may also want to try this out using Bayesian estimation to see how close to normal the posterior distributions are for the s ON z parameters; the Bayes results may be more trustworthy if they are not close to normal, as assumed with ML.
marlies posted on Wednesday, April 17, 2013 - 11:47 pm