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;