Two-level mediation analysis with bin... PreviousNext
Mplus Discussion > Multilevel Data/Complex Sample >
Message/Author
 Marina Milyavskaya posted on Friday, May 02, 2014 - 2:36 pm
Hi, I am trying to test mediation using a 1-1-2 model where the outcome is binary. I specified the model following Preacher's syntax (see below) but with the outcome variable specified as 'categorical'. When I run the model, I get a number of error messages:

***ERROR in MODEL command
Observed variable on the right-hand side of a between-level ON statement must be a BETWEEN variable. Problem with: X1
(this is repeated for x1, x2, and M)
*** ERROR in MODEL command
Variances for between-only categorical variables are not currently defined on the BETWEEN level. Variance given for: U1
*** ERROR
The following MODEL statements are ignored:
* Statements in the BETWEEN level:
M ON X1
M ON X2
U1 ON M
U1 ON X1
U1 ON X2

When I run the same model but treat the outcome variable as continuous (which I know is inappropriate, but I just wanted to see whether it would work), I get a full solution and no errors. Any help would be appreciated!

relevant parts of syntax:
USEVARIABLES ARE subject x1 x2 m u1;
CLUSTER IS subject;
between are u1;
categorical = u1;
ANALYSIS:
TYPE IS TWOLEVEL;
%WITHIN%
m ON x1;
m on x2;
x1 with x2;

%BETWEEN%
u1;
m ON x1;
m ON x2;
u1 ON m;
u1 ON x1;
u1 ON x2;
x1 with x2;
 Linda K. Muthen posted on Sunday, May 04, 2014 - 10:45 pm
You can try putting a factor behind x1, m, and x2 on the between level and using the factor instead of the observed variable in the analsyis, for example,

f1 BY x1@1;
x1@0;

This makes the factor equal to x1.
 holly Andrewes posted on Tuesday, May 26, 2015 - 2:05 am
Dear Dr Muthens,

I was very glad to see the post above because I am experiencing the same problem. I am currently attempting to complete a 1-2-2 model using Preachers syntax (2010 paper) but with a nominal outcome variable (with three un-ordered categories). I have followed your advice and altered my syntax by putting a factor behind my within level variable. However, now I get the error message:

THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO AN ILL-CONDITIONED
FISHER INFORMATION MATRIX.
THE STANDARD ERRORS OF THE MODEL PARAMETER ESTIMATES COULD NOT BE
COMPUTED. CHANGE YOUR MODEL AND/OR STARTING VALUES. PROBLEM INVOLVING PARAMETER 9.

Parameter 9 is the X variable that I put a factor behind. I am wondering if you think this is an issue with my syntax (below) or my data? Any help you can offer would be very much appreciated as I'm feeling very stuck!

Thank you!!!

This is relevant part of syntax I used:

Cluster is ID;
NOMINAL IS Y;
missing are all(-99);
Between are M Y;
Analysis: Type is TWOLEVEL RANDOM;
Estimator = MLR;
MODEL:
%WITHIN%
X;
%BETWEEN%
f1 by X@1
X@0
M Y#1 Y#2;
M ON X(a);
Y#1 Y#2 ON M(b);
Y#1 Y#2 ON f1(c);
MODEL CONSTRAINT:
NEW(indb);
indb=a*b;
 holly Andrewes posted on Tuesday, May 26, 2015 - 7:50 am
Dear Dr Muthens,

I believe I have solved my issue by not requesting the variance of the nominal variable or constraining the parameters of X in the between part.

However, I appear to be getting the same estimate for the regression of M on Y#1 and Y#2 (ie., both are -0.79) and the same estimate for the regression of F1 on Y#1 and Y#2 (ie., both are 0.2). I would have thought these estimates would be different because variables are regressed onto two different categories. I am wondering if there something I still need to change in my syntax to correct this?
Thank you VERY much for your help!

Syntax:
Cluster is ID;
NOMINAL IS Y;
missing are all(-99);
Between are M Y;
Analysis: Type is TWOLEVEL RANDOM;
Estimator = MLR;
MODEL:
%WITHIN%
X;
%BETWEEN%
f1 by X;
M F1;
M ON f1(a);
Y#1 Y#2 ON M(b);
Y#1 Y2 ON f1(c);
MODEL CONSTRAINT:
NEW(indb);
indb=a*b;
 Linda K. Muthen posted on Tuesday, May 26, 2015 - 4:54 pm
Please send the output and your license number to support@statmodel.com.
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: