Probing an interaction with dichotomo... PreviousNext
Mplus Discussion > Categorical Data Modeling >
Message/Author
 Nicole Watkins posted on Monday, October 21, 2019 - 6:37 am
Drs. Muthen and Muthen,
I am running a logistic reg with a binary x, and a continuous moderator. I found a significant interaction, so I am trying to run the simple slopes tests. I am having a difficult time with this (the estimates do not make sense, and the plots show flat lines).

Here is my code:

vapeT2 ON x(x);
vapeT2 ON mod2(m2);
vapeT2 ON xmod2(mx2);

[vapeT2$1] (b0);

MODEL CONSTRAINT:

NEW(LOW_W MED_W HIGH_W OR_LO OR_MED OR_HI);

LOW_W = -15.1;
MED_W = 0;
HIGH_W = 15.1;

OR_LO = exp(x + mx2*LOW_W);
OR_MED = exp(x + mx2*MED_W);
OR_HI = exp(x + mx2*HIGH_W);

PLOT(PLOMOD PMEDMOD PHIMOD);
LOOP(XVAL,0,1,1);
PLOMOD = 1/(1 + exp(-1*((b0 + m2*LOW_W) + (x + mx2*LOW_W)*.1)));
PMEDMOD = 1/(1 + exp(-1*((b0 + m2*MED_W) + (x + mx2*MED_W)*.5)));
PHIMOD = 1/(1 + exp(-1*((b0 + m2*HIGH_W) + (x + mx2*HIGH_W)*1)));

Is there an issue with my syntax? Thank you for your help!
 Bengt O. Muthen posted on Monday, October 21, 2019 - 1:19 pm
Your LOOP statement uses XVAL as the x-axis but XVAL is not part of the 3 formulas.

Also, you have b0 in the logit expression but it should be -b0.
 Nicole Watkins posted on Tuesday, October 22, 2019 - 6:01 am
Dr. Muthen,
Thanks so much for responding. I tried getting rid of the medium value since it is a dichotomous x. I apologize, but I don't quite understand your comment about -bo. Are you referring to where I create the PLOMOD PMEDMOD and PHIMOD?

Thanks for clarifying

I've pasted updated syntax and some results below:

NEW(LOW_W HIGH_W OR_LO OR_HI);

LOW_W = -15.1;
HIGH_W = 15.1;

OR_LO = exp(x + mx2*LOW_W);
OR_HI = exp(x + mx2*HIGH_W);

PLOT(PLOMOD PHIMOD);
LOOP(XVAL,0,1,.1);
PLOMOD = 1/(1 + exp(-1*((b0 + m2*LOW_W) + (x +
mx2*LOW_W)*0)));
PHIMOD = 1/(1 + exp(-1*((b0 + m2*HIGH_W) + (x +
mx2*HIGH_W)*1)));

New/Additional Parameters
LOW_W -15.100 0.000 ********* 0.000
HIGH_W 15.100 0.000 ********* 0.000
OR_LO 7.824 4.409 1.775 0.076
OR_HI 0.934 0.577 1.617 0.106
 Bengt O. Muthen posted on Tuesday, October 22, 2019 - 4:53 pm
Yes, you have b0 in your PLOMOD and PHIMOD expressions - but it should say -b0 because the b0 threshold is the negative of the logit intercept.

When you use LOOP(XVAL...), you have to have "XVAL" in your PLOMOD and PHIMOD expressions. See how LOOP is used in the UG and in our RMA book examples.
 Nicole Watkins posted on Thursday, October 24, 2019 - 10:29 am
Thank you so much Dr. 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: