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;
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!
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;
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;