Message/Author 


I want to test a crosslevel interaction where I expect the relation of two individual level variables to be moderated by the association of two other variables. This association would be a group level variable (classroom). For instance, if there is a strong positive association between two variables in certain classrooms is the relation btw individual level variables weakened? I don’t know what would be the best way to do this. Can I use an aggregate of correlation as the classroom level moderator variable or is there a better way to do this? 


Crosslevel interactions are specified as random slopes in Mplus. See Example 9.2 and slide 43 of the Topic 7 course handout for details. 


I want to test a crosslevel interaction with one level 1 continuous variable and one level 2 continuous variable. I have complex survey data with weight, cluster, stratification, and subpopulation. When I try to run the model I receive the following warning and error message: *** WARNING in ANALYSIS command The INTEGRATION option is not available with this analysis. INTEGRATION will be ignored. *** FATAL ERROR THIS MODEL CAN BE DONE ONLY WITH MONTECARLO INTEGRATION. I am having trouble figuring out if there is a way to run this model. Below is my model code. Thank you.: Model: %BETWEEN% bpiint ON c_concdis c_SocCap; s on c_concdis; bpiint WITH s; %WITHIN% s bpiint on c_NeighAttch; bpiint on RSC_sex RSC_Psych; RSC_sex RSC_Psych c_NeighAttch; Analysis: TYPE = COMPLEX TWOLEVEL RANDOM; ESTIMATOR = MLR; INTEGRATION = MONTECARLO; 


I am sorry, I realized I should have been more clear in my original post. I originally tried running the model with simply Analysis: TYPE = COMPLEX TWOLEVEL RANDOM; But I got the same fatal error message. Thank you, Ayesha 


Try adding ALGORITHM=INTEGRATION; to the ANALYSIS command. If that does not help, please send the full output and your license number to support@statmodel.com. 


Hello I have a crosslevel interaction with one level 1 continuous variable and one level 2 continuous variable. In the output, is the between level intercept of s the main effect of my level 1 variable? If not, where is the coefficient for the main effect for my level 1 variable? Thank you, Ayesha 


Yes. 

Mukadder posted on Wednesday, June 01, 2011  6:53 am



Hi Dr Muthéns, I'm trying out a twolevel model including upper level mediation (221 mediation)among three latent variables. I wrote the syntax such that; USEVARIABLES ARE f1 f2 f3; WITHIN = f1; BETWEEN = f2 f3; CLUSTER IS class; ANALYSIS: TYPE = TWOLEVEL RANDOM; MODEL: %WITHIN% f1 ON f2; f1 ON f3; %BETWEEN% f2 ON f3; Rightfully, the Mplus output gave an error because of the specification of the latents at the levels, specifically f2. Now I'm confused that the output gave me what I intended to do. Because I want to test the effect of f1 on the relationship between f2 and f3. Your help is appreciated...Thanks 


I think what you want is the following. You would need to take f1 off of the WITHIN list. %WITHIN% f1 BY ..... %BETWEEN% f1b BY ... int  f1 XWITH f3; f2 ON f3 int; 

Mukadder posted on Wednesday, June 01, 2011  12:26 pm



Thank you very much Linda, so happy that this worked! I have a follow up question...I tried a somehow multilevel path model. I created latent variables such that f1 is the sum of correct responses (German achievement), likely f2 (English achievement) and f3 (French achievement. f1 is a within variable; f2 and f3 are between variables. I followed the syntax you suggested to test the effect of f1 on the relationship between f2 and f3. However, Mplus told me that I can't use the XWITH command with the observed variables. In such a situation would the WITH command be more appropriate? 

Mukadder posted on Wednesday, June 01, 2011  12:29 pm



Sorry I mistyped. The output told me that XWITH is appropriate for only observed variables not latents. Thanks again. 

Mukadder posted on Wednesday, June 01, 2011  12:44 pm



Linda, I think I have to learn how to read before how to use Mplus! The output for my trial multilevel path model says: The XWITH option is not available for observed variable interactions. Use the DEFINE command to create an interaction variable. Problem with: INT  f1 XWITH f3 


Yes, so use the DEFINE command to create the interaction instead of the XWITH option. 

Ahmad Adeel posted on Thursday, June 30, 2016  10:07 am



Hello I am trying a cross level interaction as described in example 9.2. but when in try to run the model, I receive the error, please guide. Thanks. My code usevariables are tn,pp,toi,pij; within are pp; between are pij; cluster is tn; CENTERING is GRANDMEAN (pp); analysis: type = twolevel random; model: %within% s  toi on pp; %between% toi s on pij; toi with s; Error message *** ERROR One or more betweenlevel variables have variation within a cluster for one or more clusters. Check your data and format statement. Between Cluster ID with variation in this variable Variable (only one cluster ID will be listed) PIJ 16 

Ahmad Adeel posted on Thursday, June 30, 2016  11:18 am



in the above problem pij (level 2) is an interaction of pp (level 1) and a moderator (level 2). 


When you multiply a level 1 and a level 2 variable, the resulting variable is a level 1 variable, that is, it will vary within clusters. 


Thanks a lot, as you said, multiplying a level 1 and level 2 will make a level 1 variable only, then how can we check the moderation effect if IV and DV are on level 1 and Moderator is at level 2? 


Instead of %within% s  toi on pp; %between% toi s on pij; you should have %within% s  toi on pp; %between% toi s on w; where w is the level2 moderator. This implies the desired product of pp and w. 

Ahmad Adeel posted on Saturday, July 02, 2016  4:26 am



Thanks a lot, it worked. 


Hi, I am going to test a twolevel first stage moderated mediation. But when I tried to run the analysis, I received some errors and failed to produce the result. Could you help? ... MISSING = all (999); USEVARIABLES ARE x m w y; CLUSTER IS group; WITHIN = x m; BETWEEN = w; DEFINE: CENTER x(GROUPMEAN); CENTER m(GROUPMEAN); CENTER w(GRANDMEAN); ANALYSIS: TYPE = TWOLEVEL RANDOM; MODEL: %WITHIN% S  m on x; y on m(b) x; %BETWEEN% S on w(a1); [S](a0); m with S; y with S; y with m; y with w; MODEL CONSTRAINT: NEW (ind_h ind_l); ind_h=(a0+a1*(0.33))*b; ind_l=(a0a1*(0.33))*b; OUTPUT: SAMPSTAT; CINTERVAL; *** ERROR in MODEL command Withinlevel variables cannot be used on the between level. Withinlevel variable used: M *** ERROR in MODEL command Withinlevel variables cannot be used on the between level. Withinlevel variable used: M *** ERROR The following MODEL statements are ignored: * Statements in the BETWEEN level: M WITH S Y WITH M 


If a variable on on the WITHIN list, it cannot be used in the between part of the model. 

Back to top 