Yes. Thank you. In my model I didn't really specify any variable to be within or between. I think the random slope approach is better for interaction of within and between variables because my z is a latently aggarated variable from a within level variable. If I used the product term I created from manifest group averages then the interaction effect probably won't be in agreement with the latent aggaration framework. I also tried to "trick" a latent interaction by specifying a "xwith" term of one indicator variables at within and between level, but this idea didn't work at all.
T Davis posted on Wednesday, November 03, 2010 - 7:55 am
Drs. Muthen -
This is a very helpful post. I have a few questions.
What would the model command look like? I am not sure how the X*Z interaction is modeled. In the User's Guide ex. 9.1 it appears that the X*Z interaction is represented as xm. Is this correct? So for a random intercept model with two cross-level interactions, the MODEL command would look like:
A cross-level interaction is modeled when you have a random slope as shown in Example 9.2. See Slide 45 of the Topic 7 course handout on the website to see how this plays out. I think this was available in Version 5.1.
I am quite new to mplus and tried to compute an interaction effect (with all day variables). Data is based on diary studies of 5 five days (days within nested in persons). However, when I define a interaction effect based on effect HNW * pros I got a message that this variable is not recognized.
USEVARIABLE ARE Pros Com HNW; Within = Pros; Cluster = ID; DEFINE: I = HNW*Pros; ANALYSIS: TYPE = TWOLEVEL RANDOM; ALGORITHM = INTEGRATION;
Hailey Lee posted on Wednesday, February 06, 2019 - 5:35 pm
I am trying to fit a 3-level model with an interaction between a level 3 and a level 1 variable. The predictor (mfcond) is a L3 variable, outcome (p1d1) is a L1 variable, and the moderator (gender) is a L1 variable. The model runs fine, but does the code make sense?
cluster=session mf; within=gender age mrace pincome pedu perisk pcrisk P0D1; between=(session)mfcond; Define: center age mrace pincome pedu perisk pcrisk P0D1(grandmean); center gender (groupmean session);
Analysis: type=threelevel random; estimator=mlr;
Model: %within% P1D1 ON P0D1 age mrace pincome pedu perisk pcrisk; s| p1d1 on gender;
%between MF% P1D1;
%between session% P1D1; P1D1 S on mfcond; p1d1 with s;