Message/Author 


I'm trying to run a multilevel SEM model with a level 1 predictor, a level 1 mediator, and a level 1 moderator. Is there any sample code available for such a model? 


I don't think so, but in line with singlelevel analysis you can define a level1 interaction between the moderator and the covariate or mediator. Try it out. 


Would a random effect on the moderator and/or the product term throw things off? 


I'm combining Preacher, Rucker, & Hayes (2007; the A >B path is moderated), w/ Preacher, Zyphur, & Zhang (2010): DEFINE: ASIDRS=ASI*DRS; MODEL: %WITHIN% MFQfreq ON ASI (a1w); MFQfreq ON DRS; MFQfreq ON ASIDRS (a3w); PSWQ ON MFQfreq (bw); PSWQ ON ASI; %BETWEEN% ASI MFQfreq PSWQ ASIDRS; MFQfreq ON ASI (a1b); MFQfreq ON DRS; MFQfreq ON ASIDRS (a3b); PSWQ ON MFQfreq (bb); PSWQ ON ASI; MODEL CONSTRAINT: NEW(indb indw wmodval); wmodval=1; indw=(a1w + a3w*wmodval)*bw; indb=(a1b + a3b*wmodval)*bb; I get: THE STANDARD ERRORS OF THE MODEL PARAMETER ESTIMATES MAY NOT BE TRUSTWORTHY FOR SOME PARAMETERS DUE TO A NONPOSITIVE DEFINITE FIRSTORDER DERIVATIVE PRODUCT MATRIX. THIS MAY BE DUE TO THE STARTING VALUES BUT MAY ALSO BE AN INDICATION OF MODEL NONIDENTIFICATION. THE CONDITION NUMBER IS 0.176D10. PROBLEM INVOLVING PARAMETER 10. THE MODEL ESTIMATION TERMINATED NORMALLY There are no cat. vars. Par. 10 is alpha for MFQFREQ. 


Answer to the question in your first message: No. Answers to the second message: This may happen if any of your variables ASI, DRS are binary. You should also consider centering each of these variable before creating their interaction. Furthermore, I assume that you have more than 10 clusters and that you get SEs. 


Thank you for your help  there are no binary variables, and I have 50 clusters and can get SEs. I centered in SPSS and this worked perfectly. However, that means that the centering was grand mean rather than group mean. Is that appropriate? Or do I need to group mean center? 


Sounds like there is another reason for the message; please send to Support. 


This is a project a student is working on  I'll have her send it to you shortly. In general, my understanding is that this sort of model should be group mean centered. Is that correct? 


Why do you say it should be groupmean centered? 


I guess I'm thinking about traditional multilevel modeling and the within subjects model for MSEM, where I think group mean centering is appropriate. I do see the issue with group mean centering and the between model, as it doesn't make sense there. 


I am trying to specify a 111 model as suggested by Preacher, Zyphur, & Zhang (2010). I used STAND on the Output command but I don't receive stndardized results for "New/Additional Parameters". Are they not available? Katrin 


No, they are not available. You would need to specify the standardized parameter in MODEL CONSTRAINT to obtain a standard error. 

Lewina Lee posted on Saturday, March 29, 2014  3:14 pm



Dear Drs. Muthen, I am conducting a deconflated 111 multilevel mediation with an L2 moderator. Is my code correct? WITHIN ARE lneg cesd; BETWEEN ARE L18T lneg_m cesd_M L18_LNEG; !LNEG_M & CESD_M = groupspecific means of LNEG & CESD; DEFINE: CENTER lneg cesd (GROUPMEAN); L18_LNEG = L18T*LNEG_M; ANALYSIS: TYPE = TWOLEVEL RANDOM; INTEGRATION = MONTECARLO; ALGORITHM=INTEGRATION; MITERATIONS = 700; MODEL: %WITHIN% sa CESD on LNEG; sb SIM on CESD; sc SIM on LNEG; cesd lneg sim; [LNEG@0]; !grpmean centered; [CESD@0]; %BETWEEN% [sa] (a); [sb] (b); [sc] (c); sb@0; sc@0 sa@0; SIM on CESD_M (bBTW); SIM on LNEG_M; CESD_M on LNEG_M (aBTW); CESD_M on L18T; CESD_M on L18_LNEG (gBTW); sa on L18T (gW); SIM; MODEL CONSTRAINT: new (indB0 indB2 indW0 indW2 mod0 mod2); mod0 = 0; mod2 = 2; indB0 = (aBTW+gBTW*0)*bBTW; indB2 = (aBTW+gBTW*2)*bBTW; indW0 = (a+gW*0)*b; indW2 = (a+gW*2)*b; Thanks, Lewina 


Looks right. 

Lewina Lee posted on Sunday, March 30, 2014  5:37 pm



Thanks, Dr. Muthen. Can I ask a followup question: My dataset contains data from 3 occasions (Level 1) per person (Level 2). I'm treating the multilevel model as a repeated measures design without explicitly modeling how the dependent variable changes over time. Is there a limit to the number of random effects I can include? Lewina 


Each random effect requires one dimension of integration. We don't recommend more than four. Otherwise, there is no limit. 

Lewina Lee posted on Monday, March 31, 2014  9:45 am



Thanks, Linda! 

Jie Wang posted on Tuesday, February 03, 2015  12:02 am



Dear Drs. Muthen, I want to test some conditional indirect effects of quadratic terms in a fully nested data (Level 1 variables only, no level 2 variables). I have already grand mean centered all IVs. I am really not sure about if I write correct syntax (especially the MODEL CONSTRAINT part). Can you have a look at my syntax and give me some comments? Thanks! бн DEFINE: x1sq = x1*x1; DEFINE: x2sq = x2*x2; DEFINE: inter11 = x1*mod1; DEFINE: Inter12 = x1*x1*mod1; DEFINE: Inter21 = x2*mod2; DEFINE: Inter22 = x2*x2*mod2; ANALYSIS: TYPE IS TWOLEVEL; MODEL: %WITHIN% mediator ON x1 x2 x1sq (a1w) x2sq (a3w) mod1 mod2 inter11 inter12 (a2w) inter21 inter22 (a4w); dv ON mediator (bw); %BETWEEN% mediator ON x1 x2 x1sq (a1b) x2sq (a3b) mod1 mod2 inter11 inter12 (a2b) inter21 inter22 (a4b); dv ON mediator (bb); MODEL CONSTRAINT: LOOP(mod,2,2,0.1); NEW(ind1b ind1w ind2b ind2w); ind1w=(a1w+a2w*mod)*bw; ind1b=(a1b+a2b*mod)*bb; ind2w=(a3w+a4w*mod)*bw; ind2b=(a3b+a4b*mod)*bb; OUTPUT: TECH1 TECH8 CINTERVAL; 


You use the a1w slope for the squared x1 term, but leave out the unsquared x1 term; when x1 changes, both terms have effects. You may want to ask this general modeling question on SEMNET. 

Back to top 