Message/Author 


I have a 111 mediation (see below an MSEM code). My problem is that I have a level 2 moderator as well. As far as I could understand, level 2 measures can influence level 2 constructs (between), but not level 1 (within). Am I right so far? If so can someone help with the implementation of that into the code below? TITLE: 111 mediation (MSEM) DATA: FILE IS mydata.dat; VARIABLE: NAMES ARE id x m y; USEVARIABLES ARE id x m y; CLUSTER IS id; ANALYSIS: TYPE IS TWOLEVEL RANDOM; MODEL: %WITHIN% m ON x(aw); ! regress m on x, call the slope "aw" y ON m(bw); ! regress y on m, call the slope "bw" y ON x; ! regress y on x %BETWEEN% x m y; ! estimate Level2 (residual) variances for x, m, and y m ON x(ab); ! regress m on x, call the slope "ab" y ON m(bb); ! regress y on m, call the slope "bb" y ON x; ! regress y on x MODEL CONSTRAINT: ! section for computing indirect effects NEW(indb indw); ! name the indirect effects indw=aw*bw; ! compute the Within indirect effect indb=ab*bb; ! compute the Between indirect effect OUTPUT: TECH1 TECH8 CINTERVAL; ! request parameter specifications, starting values, ! optimation history, and confidence intervals for all effects Sincerely, 


I am not into the numbering approach of characterizing twolevel mediation modeling, but looking at Bauer et al (2006) in Psych Methods Figure 2, bottom, it looks to me that 111 mediation has a mediation model on the Within level and unrestricted random effects on the Between level. You pose a model for the random effects on Between. It happens to be a saturated model so it becomes the same as unrestricted. Then you say "level 2 measures can influence level 2 constructs (between), but not level 1 (within)." Let's scrutinize the second part of that statement. It sounds like you want "221" as in top of Figure 2. Using an education example, you have a teacher background variable influencing a teacher dependent variable (22) which you want to influence a student dependent variable (221). This is done by letting the teacher dependent variable influence the betweenlevel part of the student variable on Between, that is the random intercept (varying over teachers/classrooms) of the student variable. The model you have written in your Mplus input does this with both M and Y having betweenlevel random intercepts. I don't see any moderator in your Mplus input. A moderator is an interaction. 


You may also want to take a look at the Topic 7 handout on our web site. Slides 4445 talk about random intercepts and random slopes (crosslevel interaction). 

Sean Lane posted on Wednesday, August 24, 2011  9:47 am



I'm trying to fit a model similar to that listed above (using the Bauer et al syntax), but I get an error message saying that Monte Carlo integration is needed. When I specify Monte Carlo integration I get another error message saying that withinperson variables cannot be on the right hand side of an ON statement. However, since I didn't specify any variables as BETWEEN I should be able to use them as WITHIN or BETWEEN, right? VARIABLE: NAMES ARE myid pol anger attackm; MISSING ARE ALL (99); USEVARIABLES ARE myid pol anger attackm; CLUSTER IS myid; ANALYSIS: TYPE IS TWOLEVEL RANDOM; !ALGORITHM = INTEGRATION; !INTEGRATION = MONTECARLO; MODEL: %WITHIN% sa  anger ON pol; sb  attackm ON anger; sc  attackm ON pol; %BETWEEN% sa sb sc pol anger attackm; sa WITH sc pol anger attackm; sa WITH sb(cab); sb WITH sc pol anger attackm; sc WITH pol anger attackm; anger ON pol(ab); attackm ON anger(bb); attackm ON pol; [sa](aw); [sb](bw); MODEL CONSTRAINT: NEW(a b indb indw); a=aw+ab; ! compute Between a path b=bw+bb; ! compute Between b path indw=aw*bw+cab; ! compute the Within indirect effect indb=a*b; ! compute the Between indirect effect OUTPUT: TECH1 TECH8 CINTERVAL; Any help is greatly appreciated. Thanks! 


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

Anonymous posted on Friday, February 20, 2015  12:32 pm



Dear Drs. Muthén, I want to run a twolevel mediation model with x, m, and y on level 1. On level 2 I have w, a predictor for the random slopes ("x on m" and "y on x"). I have two questions: First: Here is my peferred solution: Would it be correct... (step 1) to run the model with fixed slopes (l1: "y on m x;", "m on x;") and test the indirect effect ("model indirect: y ind x") (step 2) to include random slopes (for "m on x" and "y on x") (step 3) to predict the random slopes with w? Would this still be called a "moderated mediation model"? 

Anonymous posted on Friday, February 20, 2015  12:33 pm



Second: Alternatively, Preacher, Zyphur, & Zhang (2010) argue that the measurement of the indirect effect is conflated/biased and recommend for the 111 model to test the indirect effect via the means of the random slopes on level 2 (see syntax H in http://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCcQFjAA&url=http%3A%2F%2Fsupp.apa.org%2Fpsycarticles%2Fsupplemental%2Fa0020141%2FMETPreacher20090012RRS1.doc&ei=55XnVOWoDs7iO7LtgSg&usg=AFQjCNGkr_M3CHSyYKlL5NVXXtcB9hwZ5Q&bvm=bv.86475890,d.ZWU ). Because of the characteristcs of my data, I can only model the indirect effect on level 1, as described above. Would there be a problem with conflation or bias? Would it be ok to use the SobelTest under "model indirect" and the biascorrected confidence intervals ("output: cinterval(bcbootstrap)")? Than you very much in advance! 


I would do step 1  step 3, but in step 3 I would allow all random effects, including the 2 random intercepts to correlate freely. And, you might not find random slopes  they aren't that common  particularly not for both slopes (if they are both random special indirect formulas are needed). You don't have to model Level2 random effects, but can leave them free to correlate. But if you are interested in level2 mediation processes, you can structure that as a mediation model too. The Preacher et al (2010) article is more related to that latter case. 


And, we ask that postings be limited to one window. 

Anonymous posted on Monday, February 23, 2015  8:54 am



Thank you very much for your quick response, Bengt. I have one follow up question: In the Preacher et al. (2010) syntax document "H. 111 model (unconflated MLM)", they use groupmean centering for x and m. I want to run a twolevel moderated mediation model. As far as I understood from Hox (2010), you should use grandmean centering for variables involved in crosslevel interaction effects. My question: Which would be the appropriate way to center my xvariable (crosslevel interaction effect refers to the random slopes of x [m on x, y on x])? Would grandmean centering be appropriate or would I then run into problems regarding the indirect effect? Again, thank you very much for your help! 


But Preacher et al don't groupmean center a variable that has a random slope, right? 

Anonymous posted on Tuesday, February 24, 2015  4:41 pm



Dear Bengt, three questions: (1) That is correct, Preacher et al. don't have random slopes. I found slides from Andrew Hayes where he applied the Preacher syntax for random slopes. He also used groupmean centering there, so I had the impression it had something to do with the indirect effect. I now believe to understand that the groupmean centered x and m are used to correct the conflation in 111 models (xmean and mmean in Preacher's syntax). I think I understand this idea, but I am still confused how to analyse a crosslevel interaction effect for my random slopes when I use groupmean centering  not grandmeancentering as recommended by Hox (2010). (2) In the UG example 9.5 you analyse crosslevel interaction but you don't use centering at all. Don't the variables involved in the interaction NEED to be centered? Maybe I am mistaken in that point. (3) In your post from Friday, February 20, 2015  2:54 pm you talk about special indirect formulas for modeling several random slopes. In the UG example 9.5 you model two random slopes using a very basic syntax. What would be the alternative syntax and do I really need one? Thank you so much for your help. 


(1) Do you mean that you are confused by how to do it in Mplus, or about the meaning of it? For the latter, I recommend turning to Multilevelnet. (2) They don't NEED to be centered. but as with any interactions it can help computationally (reducing collinearity) and in interpretations (see the example on slide 33 and on of our Topic 7 handout and video from our Johns Hopkins Mplus short courses on our website). (3)In UG ex 9.5 we don't estimate an indirect effect. To do that, see slide 80 of the Topic 7 handout and video. 


Hello, I have a very similar problem to the person above. I also want to run a twolevel mediation model. I however have x1, x2, x3 and they are all mediated by the same m to two dependent variables y1 and y2. So my model is: WITHIN m on x1 x2 x3 y1 on m x1 x2 x3 y2 on m x1 x2 x3 I have managed to extend the Preacher, Zyphur, & Zhang (2010) unconflated approach for my model (their model "I" with fixed effects). That means basically estimating the same set of mediations both WITHIN and BETWEEN. I suspect one of the mediations to be random. Under the classical "conflated" approach I was able to make the slope between x1 and m random and then explain its variance between in the following way: %WITHIN% S  m on x1; m on x2 x3; y1 on m x1 x2 x3 y2 on m x1 x2 x3 %BETWEEN% S on w; S WITH y1 y2; But how do I do this with the unconflated approach? I can fit one random mediation as Preacher, Zyphur, & Zhang (2010) suggest. They propose that all the paths are random between "y on m" "y on x" "m on x". Can I make just one slope "m on x1" random? Bengt, you have mentioned that random slopes are very seldom, how do I test for their randomness (so I have justification for freeing just certain slopes and keeping the rest fixed)? Thank you! 


First see if you have a random slope by just doing the 2level regression for the mediator as DV. 


Hello Bengt, Thank you very much for your quick response. Keeping my unconflated ambitions, I have tried a very simple analysis as you advised. First fixed effect model, using the mediator (social) as DV: %WITHIN% social on x; %BETWEEN% social on x; Then doing the same with random effect: %WITHIN% sasocial ON x; %BETWEEN% social on Dane; sa WITH social Dane; In the random model, in the between part of output I get the variance for both sa and Dane, the variance for Dane is significant the variance for sa is insignificant. Looking at the likelihood ratio test, 2x(1614.136+1612.121)=4.03 and 6 degrees of freedom, the test is insigificant. SO there should be no random coefficient. Then why can I find significant effect when I try to explain the random slope in this model: %WITHIN% sasocial ON x; %BETWEEN% social on x; sa on moderator (varies only between); sa WITH social x; It seems like I am explaining nonexisting random slope. What am I doing wrong? 


Sorry I am posting in one more window, but one more thing might be relevant, all my variables are uncentered, the variable social is continuous, but x and moderator are dummy variables (0/1). Thank you again! 


It is a common finding that when you add a covariate to predict a random slope you get significance. I would think it is due to increased power. 


hi Dr. Muthens i have a multilevel data and my model consits of 1111 mediation (all within level). i was wondering that my estimates are all fixed effect then sould i call these estimates are beta or gamma? And could you pleas let me know about my model's mediation equation???? here is my syntax title: this is twolevel analysis with day and level variables data: file is small model9_final.txt ; variable: names = x1 x2 m1 m2 y1 y2 y3 w id ; usevariables = x1 x2 m1 m2 y1 id ; within = x1 x2 m1 m2 y1 ; between = ; cluster = id ; analysis: type=twolevel ; estimator = ML ; model: %WITHIN% ! model for within effects / fixed effect m1 ON x1 (aw1) ; ! x1 > m1 m1 ON x2 (aw2) ; ! x2 > m1 m2 ON m1 (bw) ; ! m1 > m2 y1 ON m2 (cw) ; ! m2 > y1 y1 ON x1 ; ! x1 > y1 direct effect y1 ON x2 ; ! x2 > y1 direct effect %BETWEEN% ! model for between effects / fixed effect MODEL CONSTRAINT: NEW(indw1 indw2) ; indw1=aw1*bw*cw ; ! compute the within level indirect effect1 for m_WRT >m_PD>m_SED>e_JE indw2=aw2*bw*cw ; ! compute the within level indirect effect2 for m_WSA >m_PD>m_SED>e_JE pleaese, help me!! 


Please send your output to Support along with your license number. 

Back to top 