Mediation in a 3-level model PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Necati Ertekin posted on Tuesday, April 24, 2018 - 9:34 am
Dear MPlus community,

I am interested in a mediation analysis (both direct and indirect effects) for a 3-level multilevel model in which (1) the predictors are continuous and can be at each level, (2) the mediator is continuous and level-1, and (3) the outcome variable is binary and level-1.

While I am not 100% sure, example 9.21 in the User's Guide seems to address this type of mediation. If so, could you also please provide a citation for the methodology that example 9.21 is using?

Thanks,
 Bengt O. Muthen posted on Wednesday, April 25, 2018 - 10:12 am
Yes, the UG ex 9.21 is relevant here. It uses Bayesian estimation and the methodology for that is described in the papers on our website:

Asparouhov, T. & Muthén, B. (2010). Bayesian analysis of latent variable models using Mplus. Technical Report. Version 4. Click here to view Mplus inputs, data, and outputs used in this paper.
download paper contact second author

Asparouhov, T. & Muthén, B. (2010). Bayesian analysis using Mplus: Technical implementation. Technical Report. Version 3.
download paper contact second author

Note also that the indirect and direct effects in this case refer to the Y* outcome, that is, the continuous latent response variable for the binary Y outcome. "Counterfactual" direct and indirect effects for Y have not yet been developed for this multilevel case (see our book for definition of counterfactual effects).
 dummyvariable123 posted on Wednesday, August 22, 2018 - 11:24 am
Dear Dr. Muthen,

I am trying to examine a 3-level mediation: mediator and outcome at L2, predictor at L3.

%within%
y;
%BETWEEN id%
y;
y ON mediator(b);
%BETWEEN classroom%
y;
y ON x(c);
mediator ON x(a);

MODEL CONSTRAINT:
indirect = a*b;
direct = c;
total = c+a*b;

The output gives an error message informing that my mediator has variation within a cluster for one or more L3 clusters. How should I change the syntax when the mediator has variation at both L2 and L3?

Thank you
 Bengt O. Muthen posted on Wednesday, August 22, 2018 - 4:40 pm
See the V8 UG page 634.

Also, don't you want

y ON mediator (b);

on level 3 (instead)?
 dummyvariable123 posted on Thursday, August 23, 2018 - 1:53 am
Thank you for your guidance. I still have some problems:

1. Following the UG, I specified:
between = Mediator;
between = (classroom) X;
While keeping the syntax above.

I got an error message:
"Unrestricted x-variables for analysis with TYPE=THREELEVEL must be a variable on only one level. The following variable cannot exist on more than one level: Mediator."

2. If I have "Y ON mediator" on L3 instead of L2, this leads to a conclusion "X predicts classroom level of Mediator, which in turn predicts classroom level of Y". Is that correct?
I am more interested in testing whether "X predicts between-person level of Mediator, which in turn predicts between-person level of Y". Shouldn't Mediator be on L2 to test this?
 Bengt O. Muthen posted on Thursday, August 23, 2018 - 6:28 pm
Please send your output to Support along with your license number.
 dummyvariable123 posted on Sunday, August 26, 2018 - 10:51 am
Dear Dr. Muthen,

I want to test if L3 (classrooms) predictor "X" affects L2 (persons) outcome "Y" via the mediator "M" that has variations at L2 and at L3.

I created 2 variables representing the level-specific parts of the mediator M: "L2M" and "L3M".

Is my syntax for such mediation model correct?:

within = time;
between = (persons) L2M (classrooms) L3M X;

MODEL:
%within%
Y;
Y ON time;

%BETWEEN persons%
Y;
Y ON L2M (b1);

%BETWEEN classrooms%
Y;
Y ON X;
L3M ON X (a);
Y ON L3M (b2);

MODEL CONSTRAINT:
indirect = (a*b1)+(a*b1*b2);
 Bengt O. Muthen posted on Monday, August 27, 2018 - 1:43 pm
Looks fine, but I think the indirect effect will be

a*(b1+b2);
 wang ying posted on Wednesday, January 08, 2020 - 7:33 am
Dear Prof. Muthen,

I have a three-level model, in which X is at level 1, mediator M is at level 2, Y is at level 3, moderatore W is at level 3, and controls at all three levels. I have two questions. Thank you very much.

1. When testing hypotheses about M-Y, i.e., not including X, do we need to include M-Y at level 3, or only at level 2? i.e., we should use syntax 1 or syntax 2?

In this model, the independent variable is M, which is at level 2, so I assume that I can adopt Syntax 1; however, I'm not 100% sure because there are control variables at level 3.

In addition, if your suggestion is to use Syntax 2, then may I know whether I should use the coefficient of M-Y at level 2 or at level 3 or at both levels as evidence of this hypothesis? Thanks.

Syntax1:
%within%
Y on level 1 controls;
%between 2%
Y on M
level 2 controls;
%between 3%
Y on level 3 controls;

Syntax 2
%within%
Y on level 1 controls;
%between 2%
Y on M
level 2 controls;
%between 3%
Y on M
level 3 controls;

Due to the size limitation, I include the second question in another message.
 Bengt O. Muthen posted on Wednesday, January 08, 2020 - 10:56 am
I assume that when your model statements refer to variables called "level1", "level2", and "level3", you are referring to X variation on these 3 levels. I also assume that M varies also on level 3. If so, then syntax 2 is the closest but on level 3 you also want to regress M on "level3".
 wang ying posted on Friday, January 17, 2020 - 9:47 pm
Thanks, prof. Muthen. Sorry, I have a typo in the prior message. X should be at level 3 (i.e. firm level) while Y should be at level 1 (i.e., individual level). i.e., X has variance at level 3, M has variance at both level 2 and 3, and Y has variance at all the three levels. I adopt Syntax 2 (and add "M on level 3 controls" on level 3) to test the relationship between M and Y. Now, the coefficient of "Y on M" is not significant at level 2 (i.e. team level) while it is significant at level 3. May I know whether I should report both coefficients at level 2 and 3 or only report the coefficient at level 3? And if reporting both, how to justify the result supports the hypothesis that M is positively related to Y? Whether the insignificant coefficient at level 2 is an issue? Thank you very much.
 Bengt O. Muthen posted on Sunday, January 19, 2020 - 4:55 pm
Just report all that you've found.

I assume you are mostly interested in Level 3 because that's where you have X and where you have mediation.
 wang ying posted on Sunday, January 19, 2020 - 8:40 pm
Thanks, Prof. Muthen.
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: