Multilevel moderation PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Ewelina Lacka posted on Saturday, March 29, 2014 - 8:42 am
Is it possible to test the moderating effect of M (M is a moderators which is subject to influence of N) on the path from X (independent variable) to Y (dependent variable). I think this will be a multilevel moderation on path from X to Y. (X-->Y is moderated by N-->M). Can you please guide me through the process?
 Bengt O. Muthen posted on Sunday, March 30, 2014 - 4:45 pm
I don't understand your model. What role exactly does N play? What does "X-->Y is moderated by N-->M" mean? Why do you say it is multilevel?

Please write out the full model in some way.
 Ewelina Lacka posted on Monday, March 31, 2014 - 6:54 am
HI, I am sorry I did not explain it well. You can see the visual representation of my model following the link http://postimg.org/image/g0ex0qvtr/. The model has 3 IVs (lets say A, B and C) and 1 DV (Z). The paths between IVs and DV is moderated my M and P. Moderator M is further influenced by N (e.g. M can represent 'trust' and N is 'trust determinant').
 Bengt O. Muthen posted on Monday, March 31, 2014 - 6:30 pm
With a continuous moderator such as your M, you create interaction variables (products) in Define. So for instance

am = a*m;

Apart from that you simply say

Z on a-c am .... ;

M on n;
 Ewelina Lacka posted on Friday, April 04, 2014 - 8:42 am
I used the DEFINE command but I have an error message 'undefined variable used in transformation'
 Linda K. Muthen posted on Friday, April 04, 2014 - 8:48 am
Please send the output and your license number to support@statmodel.com.
 Dan R. posted on Thursday, May 28, 2015 - 12:01 pm
For the time being, I've dropped the 1-1-1 mediation component from my model to first look at the level 2 moderation effect. My question is whether it looks like I set up my level 2 moderation effects (Y ON XW & Y ON MZ) appropriately (i.e., if these regressions are significant, can I claim level two moderation is supported). Here is the model with simplified variable names:

Usevariables are
Y X M
W Z
XW MZ;

WITHIN = X M;
BETWEEN = W Z;
CLUSTER = Subject;

DEFINE:
XW=X*W;
MZ=M*Z;

Analysis:
TYPE = TWOLEVEL;
ESTIMATOR=MLR;

Model:
%WITHIN%
Y ON X M;

Y M;

%BETWEEN%
Y W Z XW MZ;

Y ON W;
Y ON XW;
Y ON Z;
Y ON MZ;

Output: sampstat stdyx Tech1 Tech8;
 Bengt O. Muthen posted on Thursday, May 28, 2015 - 2:02 pm
Looks ok so far.
 Dan R. posted on Thursday, May 28, 2015 - 8:39 pm
Thank you, Bengt. And for mediation tests at level 1 and level 2, have I set the following up correctly? Given the interaction effects, my understanding is that the overall chi-square and traditional fit statistics aren't available. So, should I report the BIC and SRMR for comparisons? I actually do get a Chi-square x(12)=6.213, but I'm not sure if this is for the overall multilevel model or just a portion of the model. Any insights you could provide would be greatly appreciated.

Usevariables are
Y X M
W Z
XW MZ;

WITHIN = X M;
BETWEEN = W Z;
CLUSTER = Subject;

DEFINE:
XW=X*W;
MZ=M*Z;

Analysis:
TYPE = TWOLEVEL;
ESTIMATOR=MLR;

Model:
%WITHIN%
Y ON X (cw);
Y ON M (bw);
M ON X (aw);

Y M;

%BETWEEN%
Y W Z XW MZ;

Y ON W;
Y ON XW (cb);
Y ON Z;
Y ON MZ (bb);
MZ ON XW (ab);

MODEL CONSTRAINT:
New(indirw directw totalw indirb directb totalb);

indirw = aw*bw;
directw = cw;
totalw = cw+aw*bw;

indirb = ab*bb;
directb = cb;
totalb = cb+ab*bb;

Output: sampstat stdyx Tech1 Tech8;
 Bengt O. Muthen posted on Friday, May 29, 2015 - 8:20 am
Your Between model looks strange. The "MZ" variable name sounds like an interaction term and it is not declared as Within or Between.
 Dan R. posted on Friday, May 29, 2015 - 12:21 pm
The MZ variable is an interaction - M is measured at level 1, and Z is measured at level 2. If I try to specify MZ on the between = line, I run into the following error:

*** ERROR
One or more between-level 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)

AMG_NEGA 531
DLP_EF 531

Any thoughts?
 Bengt O. Muthen posted on Saturday, May 30, 2015 - 8:33 am
You typically don't have an interaction variable as a dependent variable as you do on Between saying MZ ON XW.

MZ is not a between-level variable given that M is measured on the within level.

I don't see which kind of interaction model you are after for Between, that is, it isn't clear if you want to moderate the x->m, x->y, or m->y paths. Putting aside that you are doing this on Between for 2-level model, maybe you want to study the Preacher et al (2007) MBR article on moderated mediation (single-level) to see how such interaction models are set up.
 dummyvariable123 posted on Tuesday, November 21, 2017 - 1:10 pm
Dear Dr. Muthen,
I want to test whether L2 continuous variable (Z) moderates (inter=Z*X) the effects of L2 continuous variable X on changes in L1 dependent variable Y.

1. Is my syntax correct? If s on inter is significant does this suggest moderation?

cluster = class id;
within = wave0 Qwave;
between = X Z inter;
TYPE = COMPLEX TWOLEVEL RANDOM;
MODEL:
%within%
s | Y ON wave0 Qwave;
%between%
Y;
s ON X Z inter;

2. What is the difference in conclusions if I omit "random" and inter is significant (Y is measured at 3 time points)?
TYPE = COMPLEX TWOLEVEL;
MODEL:
%within%
Y;
%between%
Y;
Y ON X Z inter;

Thank you for your help.
 Bengt O. Muthen posted on Tuesday, November 21, 2017 - 2:09 pm
Approach 1. and 2. should be the same if the residual variance of s is zero. The s residual gets multiplied by the within predictor of Y.

Note that your syntax for approach 1. has 2 predictors of Y on within - but you can only define a random slope for one at a time. Note also that if on Between you regress s on predictors, the same predictors typically influence Y as well.
 dummyvariable123 posted on Wednesday, November 22, 2017 - 1:36 am
Dear Dr. Muthen,
Thank you for your quick answer and guidance. Just to clarify, the "between" variances (L2) of both "S" and "Y" are significant for all 3 options of Random:

%within%
Y;
option 1) S | Y ON wave;
option 2) S | Y ON Qwave;
option 3) S | Y ON wave Qwave;

%between%
Y;
S;

Should I go with approach 1. from my previous post to test moderation by L2 variable "Z" (inter=Z*X) of the effects of L2 variable "X" on changes in L1 variable "Y"?
 Bengt O. Muthen posted on Wednesday, November 22, 2017 - 3:45 pm
Yes, approach 1 is good but your input isn't correct. First, as I mentioned you cannot say

s | Y ON wave0 Qwave;

because the random slope statementrefers to one predictor, not two as you have.

Second, on between you should let Y be regressed on X Z and inter.
 Sharmeen Nasir posted on Tuesday, February 27, 2018 - 12:16 am
Dear Dr. Muthen,
I want to run 2-1-1 multilevel moderation, please share the syntax. I am using 6.1 version of Mplus and unable to find any relevant syntax for 2-1-1 moderation.Thank you in advance.
 Bengt O. Muthen posted on Tuesday, February 27, 2018 - 12:03 pm
See our Mediation page at

http://www.statmodel.com/Mediation.shtml

under

Preacher et al. multilevel mediation inputs
 Sharmeen Nasir posted on Tuesday, March 06, 2018 - 9:35 pm
Dear Dr. Muthen,
I have few questions regarding multilevel moderation. First, can we test within and between level moderation? (e.g. Independent variables are based on between level and moderators are based on within level).
Second, if so, which syntax are required to test multilevel moderation. I have not find any relevant syntax for my model in which independent variables (level 2) are based on between level and moderators and dependent variables are based on (level 1) within level. Thank you in advance.
 Bengt O. Muthen posted on Wednesday, March 07, 2018 - 3:59 pm
See our web page

http://www.statmodel.com/Mediation.shtml

under the heading

Preacher et al. multilevel mediation inputs
 syed mohamad syakir bin syed omar posted on Thursday, November 08, 2018 - 2:31 pm
CAN I USE BAYESIAN ESTIMATOR FOR MULTILEVEL MODERATED MEDIATION? I HAVE TRIED HOWEVER, I GOT THIS MESSAGE: PLEASE HELP
*** ERROR in MODEL command
Unrestricted x-variables for analysis with TYPE=TWOLEVEL and ESTIMATOR=BAYES
must be specified as either a WITHIN or BETWEEN variable. The following variable
cannot exist on both levels: PD
*** ERROR in MODEL command
Unrestricted x-variables for analysis with TYPE=TWOLEVEL and ESTIMATOR=BAYES
must be specified as either a WITHIN or BETWEEN variable. The following variable
cannot exist on both levels: IMPLEPD
 Bengt O. Muthen posted on Friday, November 09, 2018 - 1:10 pm
Send your output to Support along with your license number.
 Zehua Cui posted on Wednesday, November 20, 2019 - 3:01 pm
Dear Dr. Muthen,
I am looking at how the association between mother-child biological synchrony and child internalizing/externalizing behaviors is moderated by neighborhood context.But I am a little stuck on the syntax. The biological data is multilevel, nested within time and each dyad. For the within level, I will use the mother's biological data to predict child's biological data to come up a synchrony score (which becomes between level). Also, my neighborhood variable, and child outcome variables are also between level. So, it's not a cross-level moderation, and I am stuck on how to create an interaction term. Below is part of my syntax. Could you provide me some guidance on how to create an interaction term in this case and how to put it in the between part of the syntax? Thank you so much!

Cluster=ID;
Within=RSA_P RSA_C;
Between=INT_W1 INT_W2 EXT_W1 EXT_W2 Neighb;

Define:
center Neighb (grandmean);

Analysis:
Type=twolevel;
type=random;
estimator=MLR;

model:
%within%
Sync| RSA_P on RSA_C;

%between%
 Bengt O. Muthen posted on Wednesday, November 20, 2019 - 4:26 pm
You mention "time" - what is your number of time points? And, how many neighborhoods do you have? Dyads are well handled in a single-level format so with time as level 1, mother-child as level 2, and neighborhood as level 3, you need 3-level modeling (assuming enough time points and neighborhoods). Moderation of level 2 parameters by neighborhoods is then handled by random slopes specified on level 2 and analyzed on level 3. With only a few time points, you can use wide format for time and reduce to 2 levels. See our Topic 10 Short Course video and handout as well as UG examples.
 Zehua Cui posted on Thursday, November 21, 2019 - 1:48 pm
Dear Dr. Muthen,
Thank you so much for your quick response! I am very sorry that my statement was a little confusing. The biological data is calculated every 30 seconds within a 5 minute interval. So both the mother and child will have 10 time points of biological data, and every mother-child dyad will only have one synchrony value. I have 100 mother-child data (100 synchrony value) and 66 neighborhoods (mother-child dyads not from the same neighborhoods).
So I want to create an interaction between Synchrony and neighborhood (all between levels), but I can't define it using the define command, because I have to use mother's biological data to predict child's biological data on the within level first. Do you know how I can create an interaction term for the between level using the parameter from the within level? Do I have to do a latent interaction like INT|SYNC XWITH neighb (for the between level)?
 Bengt O. Muthen posted on Thursday, November 21, 2019 - 5:23 pm
Perhaps this is what you have in mind for a child DV and a mother IV on level 1:

Level 1: r1 | child on mother;

Level 2: r2 | r1 on synch;

Level 3: r2 on neighb;

This gives an interaction between synch and neighb via the random slope r2. The synch variable on level 2 predicts the random slope r1 in the mother - child relationship.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: