Sem with 2 cat moderators and 1 binar... PreviousNext
Mplus Discussion > Dynamic Structural Equation Modeling >
Message/Author
 Christos Giannoulis posted on Saturday, January 27, 2018 - 2:02 am
Hello Mplus experts:

Is it possible in Mplus to conduct moderation analysis with categorical variables across the spectrum.

Two moderator variables (e.g. gender, and ethnicity)

one dichotomous categorical independent variable (that the above two variables moderate to predict)

and one binary outcome.

Would you be so kind and share a script example and/or a paper where this type of moderation analysis was used?

thank you very much

Christos
 Bengt O. Muthen posted on Saturday, January 27, 2018 - 4:56 pm
Yes. You use Define to create the interaction between gender and the IV and between ethnicity and the IV. You put the binary outcome on the Categorical list (only this outcome).
 Christos Giannoulis posted on Monday, January 29, 2018 - 11:41 am
! Create interaction term

DEFINE:
XG = X*G;
XED1 = X*ED1;
XED2 = X*ED2;
XED3 = X*ED3;

ANALYSIS:
TYPE = GENERAL;
ESTIMATOR = ML;
BOOTSTRAP = 10000;

MODEL:
[Y$1] (b0);
Y ON X (b1);
Y ON G (b2);
Y ON ED1 (b3);
Y ON ED2 (b4);
Y ON ED3 (b5);
Y ON XG (b6);
Y ON XED1 (b7);
Y ON XED2 (b8);
Y ON XED3 (b9);
 Christos Giannoulis posted on Monday, January 29, 2018 - 11:42 am
Does the above make sense?

Before that here is the setting:

! Predictor variable - X (Question: 1- 5 Likert Scale)
! Moderator variable(s) G (Gender-dichotomous)
! Moderator variable(s) - E (Ethnicity - 4 categories, represented by dichotomous 0/1 dummy variables ED1, ED2, ED3 the fourth is the reference))
! Outcome variable - Y - a dichotomous outcome, coded 0/1

USEVARIABLES = X G ED1 ED2 Y XG XED1 XED2 XED3;

CATEGORICAL = Y;
 Christos Giannoulis posted on Monday, January 29, 2018 - 11:43 am
and after the Y On ED3 (b9);

! Use model constraint subcommand to test simple slopes
! You need to insert your respective dummy variable values, 0 and 1, for each group of W

MODEL CONSTRAINT:
NEW(SIMP_W1 SIMP_W2 SIMP_W3);

! Now calc simple slopes for each group of W

SIMP_E1 = b1 + b7;
SIMP_E2 = b1 + b8;
SIMP_E3 = b1 + b9;
SIMP_E4 = b1;

! Use loop plot to plot model for values of E = 0, E = 1
! NOTE - values of 1,5 in LOOP() statement need to be replaced by
! logical min and max limits of predictor X used in analysis

PLOT(LINE_E1 LINE_E2 LINE_E3 LINE_E4);
LOOP(XVAL,1,5,0.1);

LINE_E1 = (b0 + b3) + (b1 + b7)*XVAL;
LINE_E2 = (b0 + b4) + (b1 + b8)*XVAL;
LINE_E3 = (b0 + b5) + (b1 + b9)*XVAL;
LINE_E4 = b0 + b1*XVAL;

PLOT:
TYPE = plot2;

OUTPUT:
STAND CINT(bcbootstrap);
 Christos Giannoulis posted on Monday, January 29, 2018 - 11:44 am
Does the above code make sense to you?
Did I understand what you are suggesting?

Thank you Dr. Muthen for your reply

I can send demo dataset and the script into your support if you deem appropriate.

Christos
 Christos Giannoulis posted on Monday, January 29, 2018 - 11:46 am
Corrections

where it says:
MODEL CONSTRAINT:
NEW(SIMP_W1 SIMP_W2 SIMP_W3);

it is
MODEL CONSTRAINT:
NEW(SIMP_E1 SIMP_E2 SIMP_E3);
 Bengt O. Muthen posted on Monday, January 29, 2018 - 12:19 pm
We ask that postings be limited to one window. For longer messages, send to Support along with your license number.
 Christos Giannoulis posted on Monday, January 29, 2018 - 12:28 pm
Sure I am sorry for the inundation of messages. This was the only way to show you what I meant and also inform the community for additional questions. I will forward to support along with license as you advised
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: