Multi-level mediation analysis PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Mirko Fillbrunn posted on Monday, September 26, 2016 - 11:41 am
2-1-1 mediation analysis (http://quantpsy.org/pubs/syntax_appendix_081311.pdf)

-Code:
DATA: FILE IS ...;
listwise=on;
VARIABLE:
NAMES ARE pcid pcTRT ptid ptwaira2 ptkasra2 nucwai nucsdm;
USEVARIABLES ARE pcTRT nucwai nucsdm;
BETWEEN IS pcTRT;
CLUSTER IS pcid;
MISSING ARE ALL (-9999);
ANALYSIS: TYPE IS TWOLEVEL RANDOM;

MODEL:
%WITHIN%
nucwai*72 nucsdm*124;
sb | nucsdm ON nucwai;

%BETWEEN%
pcTRT*.3 nucwai*26.0 nucsdm*52.0;
nucwai ON pcTRT(a);
nucsdm ON nucwai(bb);
nucsdm ON pcTRT;
[sb](bw);
sb WITH pcTRT nucwai nucsdm;

MODEL CONSTRAINT:
NEW(b indb);
b=bb+bw;
indb=a*b;
OUTPUT: SAMP TECH1 TECH8 CINTERVAL;

-Problem: Without listwise deletion, I get:
*** FATAL ERROR
THIS MODEL CAN BE DONE ONLY WITH MONTECARLO INTEGRATION..
-After adding ALGORITHM = INT;
Integration=MONTECARLO; to ANALYSIS section:
*** ERROR in MODEL command
Observed variable on the right-hand side of a between-level ON statement
must be a BETWEEN variable. Problem with: NUCWAI
*** ERROR
The following MODEL statements are ignored:
* Statements in the BETWEEN level:
NUCSDM ON NUCWAI
 Mirko Fillbrunn posted on Tuesday, September 27, 2016 - 6:19 am
To clarify, my question is why does not specifying listwise deletion lead to the errors above?
 Linda K. Muthen posted on Tuesday, September 27, 2016 - 6:22 am
With listwise deletion there is no missing data. The message is triggered when the mediator has missing data.
 Tihomir Asparouhov posted on Tuesday, September 27, 2016 - 11:01 am
If you have missing data on nucwai the model includes the product of two latent variables and there is no explicit likelihood expression - therefore you have to use numerical integration and a completely different algorithm, i.e., the missing data makes the algorithm quite a bit more complicated.

You can resolve your problem by using this equivalent model

%BETWEEN%
pcTRT*.3 nucwai*26.0 nucsdm*52.0;
nucwai ON pcTRT(a);
nucsdm ON f(bb);
nucsdm ON pcTRT;
[sb](bw);
sb WITH pcTRT nucwai nucsdm;
f by nucwai@1; nucwai@0; f*1;


You should also consider using multiple imputation as an alternative estimation approach, that way you avoid numerical integration.

You should also consider using the observed covaraite version of this model for nucwai http://statmodel.com/download/Ludtkeposted.pdf

Finally note that the covariate with the random slope is uncentered.
 Marie Hennecke posted on Monday, February 13, 2017 - 8:14 am
1 - I am trying to calculate a 2-1-1 multilevel mediation model where the mediator is binary. Will this input do this correctly and also calculate the indirect effect correctly? Conscie is the predictor x, poscons the mediator m, and success the outcome y.


USEVARIABLES = poscons success conscie ID ;
missing = poscons (-9) success (-9) conscie (-9) ID (-9) ;
BETWEEN IS conscie ;
CLUSTER IS ID;
ANALYSIS: TYPE IS TWOLEVEL;
ESTIMATOR = WLSMV;
MODEL:
%WITHIN%
poscons success;
success ON poscons(b);
%BETWEEN%
conscie poscons success;
poscons ON conscie(a);
success ON poscons(b);
success ON conscie;
MODEL CONSTRAINT:
NEW(indb);
indb=a*b;
OUTPUT: TECH1 TECH8 CINTERVAL;

2 - I am using the WLMSV estimator. Is this correct? Or should I use ML or MLR?

3 - If I use WLMSV, how do I interpret the regression coefficients: Are they probit regression coefficients? Or can they be interpreted like regression coefficients from a linear regression?
 Bengt O. Muthen posted on Monday, February 13, 2017 - 5:50 pm
1. This is fine.

2. WLSMV is ok here.

3. They are regular linear reg coeff's because on Between all variables are continuous (no matter that some are latent).
 Yoon Oh posted on Wednesday, April 05, 2017 - 2:31 pm
I'm trying to conduct a multilevel mediation analysis, with outcome at L1, mediator at L2, and predictor at L3.

Thd codes that I wrote for this anaysis are as below. Would you please let me know if I'm doing it right. Thank you so much for your time!

ANALYSIS: TYPE = THREELEVEL RANDOM;
estimator = mlf;

MODEL: %WITHIN%

POSTTEST on PRETEST ;

%BETWEEN Class_ID%

POSTTEST on COVARIATE MEDIATOR(b);
MEDIATOR on COVARIATE;

%BETWEEN School_ID%

POSTTEST on PREDICTOR (c);
MEDIATOR on PREDICTOR (a);

MODEL CONSTRAINT:
new(direct indirect);
indirect = a*b;
direct = c;

OUTPUT: sampstat tech1 tech3 tech8 cinterval;
 Bengt O. Muthen posted on Thursday, April 06, 2017 - 5:27 pm
This seems correct. But why not let Postest be regressed on Mediator also on level 2? If we call that slope b2, I think the indirect effect is a*b+a*b2*b.
 Yoon Oh posted on Thursday, April 06, 2017 - 7:49 pm
Dear Bengt,

Thank you so much for your response.

But Posttest is already regressed on mediator on level2. Did you mean Level3?

If so, I revised the codes as below. Would you please let me know if this looks okay?

MODEL: %WITHIN%

POSTTEST on PRETEST ;
PRETEST;

%BETWEEN Class_ID%

POSTTEST on COVARIATE PRETEST MEDIATOR(b1);
MEDIATOR on COVARIATE PRETEST;
PRETEST;

%BETWEEN School_ID%

POSTTEST on PRETEST PREDICTOR (c);
POSTTEST on MEDIATOR(b2);
MEDIATOR on PRETEST PREDICTOR(a):

MODEL CONSTRAINT:
new(direct indirect);
indirect = ((a*b1)+(a*b1*b2));
direct = c;
 Bengt O. Muthen posted on Friday, April 07, 2017 - 5:35 am
Yes, I meant level 3.

Note that you can only have one parameter labeled per line. So change for instance

POSTTEST on COVARIATE PRETEST MEDIATOR(b1);

to

POSTTEST on COVARIATE PRETEST
MEDIATOR(b1);
 Yoon Oh posted on Friday, April 07, 2017 - 9:52 am
Thank you so much for your guidance! This is really helpful.
 'Alim Beveridge posted on Wednesday, June 07, 2017 - 8:39 am
Dear Drs. Muthen,

I am trying to do something similar to the above. However, my X is measured at L2: middle managers (MMs) who are rating their superiors. Several MMs are rating the same superior. I also have covariates at each level. I have written the following syntax, but it will not run.

usevariable= idg idc m2 y1 x2 gen1 gen2;
WITHIN = gen1;
BETWEEN = (idg) x2 m2 gen2 (idc) gen3;
CLUSTER= idc idg;
ANALYSIS:TYPE = threelevel random;

MODEL:
%within%
y1 ON gen1; !DV = control

%between idg%
y1 ON m2 (b) !DV = M
x2 (c); !DV = X
m2 ON x2 (a) !M = X
gen2; !control

%between idc%
y1 ON m2 !DV = M @L3
x2 ; !DV = X @L3
m2 ON x2; !M = X @L3
x2 ON gen3; !control

MODEL CONSTRAINT:
NEW (IND);
IND = a*b; ! Estimate indirect effect

Please let me know what I need to change.
Thanks!
 Bengt O. Muthen posted on Wednesday, June 07, 2017 - 6:03 pm
We need to see your full output - send to Support along with your license number.
 Derek Boy posted on Wednesday, January 10, 2018 - 12:07 pm
Dear Dr. Muthen

I am considering a multilevel mediation analysis (while still pending the field data), with outcome EIP to be modeled at all three levels, mediator EEO also to be modeled at all three levels, and predictors EEL SGL CCT modeled at L1, L2, and L3 respectively.
The codes that I wrote are as below. Would you please kindly let me know if I am doing it right or not? And, I am particularly nervous on my calculation of the indirect effect. Many many thanks.

WITHIN = EEL;
BETWEEN = (S_ID) SGL (C_CN) CCT;
CLUSTER = C_CN S_ID;
ANALYSIS:
TYPE = threelevel;
MODEL: %WITHIN%
EIP ON EEO (b1)
EEL (c);
EEO ON EEL (a);
%BETWEEN S_ID%
EIP ON SGL
EEO (b2);
EEO ON SGL;
EEO; EIP;
%BETWEEN C_CN%
EIP ON EEO (b3);
EEO ON CCT;
EEO;
MODEL CONSTRAINT:
new(direct indirect);
indirect = ((a*b1)+(a*b1*b2)+(a*b1*b2*b3));
direct = c;
OUTPUT: sampstat tech1 tech8 cinterval;
 Bengt O. Muthen posted on Wednesday, January 10, 2018 - 1:15 pm
Because the Within-level EEL variable is the exposure variable, the indirect effect is simply a*b1.
 Derek Boy posted on Friday, January 12, 2018 - 11:32 pm
Many many thanks for your kind reply.
 Shahid Khan posted on Monday, June 18, 2018 - 3:30 am
Hi Muthen

Can you please tell me whether this syntax is correct or not? I am trying to investigate three-level model.

TITLE: 3-2-1-1 mediation (MSEM)- PHC-ASC-EE-Outcomes

BETWEEN = (Group) Agg_ASC (Org) AggEPHC;
CLUSTER IS Org Group;
Missing are all (-99);

ANALYSIS: TYPE IS THREELEVEL RANDOM;
MODEL:
%WITHIN%
T_EX T_DRes;
T_DRes ON T_EX(c);
T_DRes ON E_Age E_Gend E_TWSup;

%BETWEEN Group%
E_Age E_Gend E_TWSup Agg_ASC T_EX T_DRes;
T_EX ON Agg_ASC(b);
T_EX ON E_Age E_Gend E_TWSup;
T_DRes ON E_Age E_Gend E_TWSup Agg_ASC;

%BETWEEN Org%
E_Age E_Gend E_TWSup AggEPHC Agg_ASC T_EX T_DRes;
Agg_ASC ON AggEPHC(a);


MODEL CONSTRAINT:
NEW(indb1);
NEW(indb2);

indb1=a*b;
indb2=b*c;

OUTPUT: TECH1 TECH8 CINTERVAL;
 Bengt O. Muthen posted on Monday, June 18, 2018 - 9:50 am
I don't understand the model. What is (are) you mediator(s) and what is (are) your ultimate outcome(s)?

Why is there no regression of T_DRes on T_Ex on the Between Group level while you have it on Within? Why do you call the path from Agg_Asc to T_Ex "b" on Between Group when you call the path from T_Ex to T_DRes "c" on Within?
 Patrícia Costa posted on Friday, July 13, 2018 - 8:25 am
Dear Dr(s) Muthen,

Is it possible to run a 1-1-1 MLM with 3 DVs simultaneously?

If so, would it consist in including all Y1, Y2 and Y3 together in the model?

Ex:

%WITHIN%
m ON x(aw);
Y1 ON m(bw1);
Y1 ON x;
Y2 ON m(bw2);
Y2 ON x;
Y3 ON m(bw3);
Y3 ON x;
%BETWEEN%
x m y1 y2 y3;
m ON x(ab);
y1 ON m(bb1);
y1 ON x;
y2 ON m(bb2);
y2 ON x;
y3 ON m(bb3);
y3 ON x;
MODEL CONSTRAINT: !
NEW(indb1 indb2 indb3 indw1 indw2 indw3);
indw1=aw*bw1;
indb1=ab*bb1;
indw2=aw*bw2;
indb2=ab*bb2;
indw3=aw*bw3;
indb3=ab*bb3;

Thank you!
 Bengt O. Muthen posted on Friday, July 13, 2018 - 2:17 pm
Q1: Yes.

Q2: Right.
 Patrícia Costa posted on Monday, July 16, 2018 - 6:26 am
Thank you for your answer.

I ran my model accordingly. However, I have trouble understanding what to do with model fit indexes.

Chi-Square Test of Model Fit

Value 0.000*
Degrees of Freedom 0
P-Value 1.0000
Scaling Correction Factor 1.0000
for MLR

Therefore, all the indexes are "perfect" (RMSEA = 0.000; CFI = 1.000, etc.). I don't think my model is just identified (I have 600 observations, for a 1-1-1 model with 3 DVs; 35 free parameters).

I understand I cannot use these indexes to assess my model. I have checked the website for the chi-square difference test computation using MLR. But I don't understand which model should I compare this one against... Could you help me with this?

Finally, even if I get a "chi-square" value, I will still be missing the other indexes, is this correct?

Thank you for your help.

Best,
Patricia
 Bengt O. Muthen posted on Monday, July 16, 2018 - 2:40 pm
The possibility to test model fit by SEM approaches is not related to the sample size but to the number of variances and covariances among the variables. Your model is just-identified (saturated; all paths are present in the model) and is therefore not testable by regular SEM approaches.
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: