Cross-Level Interaction PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
 Kai Rödiger posted on Monday, September 30, 2013 - 2:29 am
Dear Linda and Bengt,

I'm quite new to MPlus and Multilevel Modelling but I figured out most of the basic stuff quite well. Now I have serious problems with a Cross-Level Interaction and need your help to know if it is possible at all to have a model like this.

So in short: I have LVL 2 measurements at the employee lvl (customer attitude) and LVL 1 measures at the customer LVL (perception of behavior).

I want this path to be moderated by the age difference between employee and customer modelled by (AE - AC). Each employee has up to 3 matched customers so there are up to 3 different values for Delta Age.

--------------------------Delta Age (I think this has to be a Within-Variable)
Employee Behavior (L2) ----> Customer Perception (L1)

I tried various ways to define the slopes in the within and between part of the model but none of them worked out. Could you give me a hint if at all (and if yes how) such a relationship can be modelled?

Best regards and thank you very very much in advance,
 Linda K. Muthen posted on Monday, September 30, 2013 - 6:40 am
Example 9.2 shows how to model a cross-level interaction.
 Kai Rödiger posted on Tuesday, October 01, 2013 - 2:22 am
Thank you for your quick answer but I think my problem is a different one.

Example 9.2 shows a a LVL 2 Variable moderating a LVL 1 -> LVL 1 path.

What I want to model is a LVL 2 Variable moderating a LVL 2 -> LVL 1 path.

Is this possible at all? Thank you very much in advance for your answer again and I hope you can help me.

Best regards,
 Linda K. Muthen posted on Tuesday, October 01, 2013 - 9:51 am
I think what you want is

USEVARIABLES = y x z w zw;
BETWEEN = z w;
zw = z*w;

y ON x;
y ON z w zw;

Note that the y on between is the between part of y. Latent variable decomposition is discussed in Example 9.1 and 9.2.
 Kai Rödiger posted on Wednesday, October 02, 2013 - 4:44 am
Thank you again for your quick response. What we want is the following:

USEVARIABLES = y1 y2 x z;

y2 ON y1;

y1 ON x;

S|y1 ON x; !Path to be moderated is a LVL2 on LVL1 Path

S ON z; !Moderator z is a within-variable. No matter in which part of the model this path is defined, MPlus produces error messages.

Is modelling the interaction via multiplication a common option in multilevel analysis? I thought it is necessary to use the random slope method.

Thanks again and best regards,
 Linda K. Muthen posted on Wednesday, October 02, 2013 - 12:06 pm
In multilevel modeling, you can't have a random slope on the highest level.
 Kai Rödiger posted on Monday, November 25, 2013 - 3:02 am
Dear Linda,

thank you very much for your response. Do you have any suggestion how to solve this problem? Which method / approach might be best if cross-level interactions won't work here. Is a multilevel multigroup analysis a valid approach for this problem?

Thank you very much for your response,
 Linda K. Muthen posted on Monday, November 25, 2013 - 9:22 am
This seems a reasonable approach.
 Yanxia WANG posted on Thursday, March 19, 2015 - 7:44 pm

I am new to Mplus, and recently met a similar problem which the level 2 moderator moderates the relationship between independent variable from level 2 and dependent variable from level 1. I did what Linda suggested, however, Mplus reported error with undefined zw (the interaction item). I really could not figure it out. Would you please help me to handle with this problem?

Thanks a lot.
 Linda K. Muthen posted on Friday, March 20, 2015 - 6:58 am
Please send the output and your license number to
 Bep Uink posted on Thursday, December 03, 2015 - 6:10 pm
I am running a 2 level model in the uni variate format, with experience sampling data. I am trying to predict an outcome at time 1, controlling for a co-variate a t-1. However, I do not want between-day lags (i.e. I do not want participants ratings in the morning to be predicted by their last rating on the previous day). However, I am not sure the syntax for this? I have thought of excluding observations the occur in the first time point of the following day, but these are are also used as t-1 covariates for the following time point. Any help would be very appreciated. Thank you.
 Tihomir Asparouhov posted on Friday, December 04, 2015 - 8:59 am
You can consider three level modeling where the middle level = day. Alternatively and probably the easiest is to have 0 for that covariate in the data for the first observation in the day.
 Bep Uink posted on Sunday, December 06, 2015 - 10:09 pm
Thank you, Tihomir. I am not clear on what covariate. To be more clear, I am trying to regress mood at time 1 onto event at time 1, controlling for mood at t-1. Because I do not want events from the previous nights' time point predicting the next mornings' mood, should I replace data for night time events with 0?
 Tihomir Asparouhov posted on Monday, December 07, 2015 - 3:31 pm
I would recommend reading these three papers

Ellen L. Hamaker, Conor V. Dolan, and Peter C. M. Molenaar (2002) On the Nature of SEM Estimates of ARMA Parameters, Structural Equation Modeling, 9(3), 347–368

Joran Jongerling, Jean-Philippe Laurenceau, Ellen L. Hamaker (2015) A Multilevel AR(1) Model: Allowing for Inter-Individual Differences in Trait-Scores, Inertia, and Innovation Variance, Multivariate Behavioral Research, 50:3, 334-349

Zhiyong Zhang, Ellen L. Hamaker, John R. Nesselroade (2008) Comparisons of Four Methods for Estimating a Dynamic Factor Model Structural Equation Modeling, 15:377–402,
 Mengting Li posted on Thursday, May 03, 2018 - 4:33 am
I am running a 2 level model with a cross-level interation. The question is I want get the coefficient of %within% level: s | Y on X. I am wondering if the code of %between% level:[s]; could get me the coefficient? If the intercept of s in the output is the coefficient?
Here is my full code if you need:
analysis:type=twolevel random
s|Y on X;
s Y on M;
 Bengt O. Muthen posted on Thursday, May 03, 2018 - 4:45 pm
You can get one s value for each cluster if you request factor scores. [s] gives the intercept of s.
 Mengting Li posted on Thursday, May 03, 2018 - 9:59 pm
Thanks a lot for your reply!
Could I just define a cross-level interaction variable:XM=X*M, then code: Y on XM? If so, which level should I put the code, %within% or %between%?
Many thanks!
 Bengt O. Muthen posted on Friday, May 04, 2018 - 4:43 pm
An interaction variable is a simpler, less general approach. You put it on Within.
 Arthur Andrews posted on Thursday, June 21, 2018 - 9:10 pm
I'm trying to run a model with a cross-level interaction that I would normally run in a growth curve framework, but I need to use weighting within each wave and it's my understanding that I have to run the analysis in long form as a result.

Similar to a parallel analysis, I'd like to examine both the change in one variable and its intercept as predictors of change in another variable. I followed the example posted on here and in the user's manual for generating the random slope and examining it as a between-level outcome, but when I try to examine the random intercept as a predictor on the between-level, I get an error that says that I can't have a y-variable specified on the within level and also use it as an x-variable on the between level. I also have a between-level variable that I'd like to use as a moderator of the random intercept. So, I'm wondering if there is a way to do this in Mplus.

If not, is there any reason I couldn't examine moderation by generating the interaction terms with the define command and placing them as within level predictors similar to the code below? I realize it doesn't answer the exact same question statistically, but I think seems to test moderation in a way that is theoretically fairly similar. Thanks in advance!


a on time b INTtimeB INTtimeC INTtimeD BC BD timeBC timeBD ;


a on Gender Age C D ;
 Bengt O. Muthen posted on Friday, June 22, 2018 - 3:49 pm
Please send your output to Support along with your license number.
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Enable HTML code in message
Automatically activate URLs in message