

Plotting interaction effects 

Message/Author 


Dear Sir or Madam, I ran twolevel models with random slopes and predictor variables on both levels and now I want to do simple slope analyses and plots for the significant interaction effects  among other things a crosslevel interaction in which a predictor on level 2 moderates the regression of a criterion (measured on level 1) on a predictor on level 1. Embarrassingly, I have some problems figuring out how to do this correctly. Firstly, I am quite confused if I should follow the example 9.2 in the user guide on page 264 or rather the example “crosslevel effect plotted by LOOP” on the homepage – are they supposed to deliver the same plots? Secondly, I do not understand where the variables “llevel” (or “mod”, respectively) in these examples come from –if they refer to the moderator variable, then why does one not use its real name? Thirdly, regarding the example in the user guide, are these assumptions correct: I have to replace (a) the values 3 and +3 in the loopcommand with the lowest and highest values of my moderator variable and (b) the values 1 and 1 in the definitions of “ylow” and “yhigh” with the standard deviation of my moderator variable – or rather the mean of this variable minus (or plus) the standard deviation? I beg your pardon if these are stupid questions. I would be very grateful for your help! 


Not a stupid question. The plots display different things that you may be interested in. The plot that goes with ex 9.2 (second window) shows how the moderated effect varies with the level 1 x value for 2 different level2 w values. The plot on our web page shows how the simple slope varies as a function of the level2 moderator (so the level1 variable isn't involved). "level1" is a name you give for the xaxis. Although it represents the x variable, it is not the x variable. Same for "mod". You wouldn't necessarily want to use the highest and lowest values but perhaps more common values like plus/minus 1 SD from the mean. Or, the 20th and 80th percentiles in the sample. 


Dear Prof. Muthén, thank you very much for your helpful explanations! As I want to test simple slopes I decided to follow the ex 9.2. But sadly my syntax does not work: MPlus gives me only an empty output. I would be very grateful if you would be so kind to tell me what I am doing wrong! variable: usevariables = SCD_C SCD_T FATIG_T; ! FATIG_T corresponds to the criterion y in ex 9.2, SCD_T to the predictor x and SCD_C to the moderator variable w cluster = VPN_NR; within = SCD_T; between = SCD_C; define: center SCD_C (grandmean); center SCD_T (groupmean); analysis: type = twolevel random; estimator = ml model: %within% SLOPE_2  FATIG_T on SCD_T; %between% FATIG_T on SCD_C; [SLOPE_2] (gam0) ; SLOPE_2 on SCD_C (gam1) ; FATIG_T with SLOPE_2; model constraint: new (y_mod_l y_mod_m y_mod_h); plot (y_mod_l y_mod_m y_mod_h); loop (xvar, 27, 34, 1) ! the predictor SCD_T ranges from 26.500 to 33.250 y_mod_l = (gam0 + gam1 * (9.392)) * xvar; y_mod_m = (gam0 + gam1 * 0) * xvar; y_mod_h = (gam0 + gam1 * 9.392) * xvar; ! for the moderator SCD_C: mean = 0.00 and variance = 88.225 plot: type = plot2; output: sampstat cinterval; 


I beg your pardon for the double post, but I am really not sure if the syntax above is the right approach for what I want to accomplish: I want to plot and test a twoway crosslevel interaction in which a predictor variable on level 2 (named SCD_C) moderates the regression of the criterion (FATIG_T) on a predictor variable on level 1 (SCD_T). On the xaxis there should be plotted the values of the predictor variable SCD_T and on the yaxis the values of the effect from SCD_T on the criterion FATIG_T adjusted for the influence of the moderator variable SCD_C. I want three plot lines, namely the simple slopes for the regression of the criterion FATIG_T on the L1predictor SCD_T for a low, a medium or a high value respectively of the moderator variable SCD_C. As a “low” value I´ve chosen the value which represents one standard deviation below the mean of SCD_C, the “medium” value equals the mean of the moderator and the “high” value lies one standard deviation above the mean. Thank you very much for your patience! 


When the posts get this long, please send to Support instead along with your license number. 

Back to top 

