DATA:
FILE IS D:\2019工作\最终大论文分析数据.dat; VARIABLE:
NAMES ARE M W Z X Y;
! Predictor variable - X
! Mediator variable(s) - M
! Moderator variable(s) - W, Z
! Outcome variable - Y
USEVARIABLES = X M W Z Y XW XZ;
! Create interaction terms
! Note that they have to be placed at end of USEVARIABLES subcommand above
DEFINE:
XW = X*W;
XZ = X*Z;
ANALYSIS:
TYPE = GENERAL;
ESTIMATOR = ML;
BOOTSTRAP = 5000;
! In model statement name each path and intercept using parentheses
MODEL:
[Y] (b0);
Y ON M (b1);
Y ON X (cdash);
[M] (a0);
M ON X (a1);
M ON W (a2);
M ON Z (a3);
M ON XW (a4);
M ON XZ (a5);
! Use model constraint subcommand to test conditional indirect effects
! You need to pick low, medium and high moderator values for W,Z
! for example, of 1 SD below mean, mean, 1 SD above mean
! 2 moderators, 3 values for each, gives 9 combinations
! arbitrary naming convention for conditional indirect and total effects used below:
! MEV_LOQ = medium value of V and low value of Q, etc.
MODEL CONSTRAINT:
NEW(LOW_W MED_W HIGH_W LOW_Z MED_Z HIGH_Z
ILOW_LOZ IMEW_LOZ IHIW_LOZ ILOW_MEZ IMEW_MEZ IHIW_MEZ
ILOW_HIZ IMEW_HIZ IHIW_HIZ
TLOW_LOZ TMEW_LOZ THIW_LOZ TLOW_MEZ TMEW_MEZ THIW_MEZ
TLOW_HIZ TMEW_HIZ THIW_HIZ);
LOW_W = 2.90; ! replace #LOWW in the code with your chosen low value of W
MED_W = 3.87; ! replace #MEDW in the code with your chosen medium value of W
HIGH_W = 4.85; ! replace #HIGHW in the code with your chosen high value of W
LOW_Z = 2.56; ! replace #LOWZ in the code with your chosen low value of Z
MED_Z = 3.56; ! replace #MEDZ in the code with your chosen medium value of Z
HIGH_Z = 4.55; ! replace #HIGHZ in the code with your chosen high value of Z
! Calc conditional indirect effects for each combination of moderator values
ILOW_LOZ = a1*b1 + a4*b1*LOW_W + a5*b1*LOW_Z;
IMEW_LOZ = a1*b1 + a4*b1*MED_W + a5*b1*LOW_Z;
IHIW_LOZ = a1*b1 + a4*b1*HIGH_W + a5*b1*LOW_Z;
ILOW_MEZ = a1*b1 + a4*b1*LOW_W + a5*b1*MED_Z;
IMEW_MEZ = a1*b1 + a4*b1*MED_W + a5*b1*MED_Z;
IHIW_MEZ = a1*b1 + a4*b1*HIGH_W + a5*b1*MED_Z;
ILOW_HIZ = a1*b1 + a4*b1*LOW_W + a5*b1*HIGH_Z;
IMEW_HIZ = a1*b1 + a4*b1*MED_W + a5*b1*HIGH_Z;
IHIW_HIZ = a1*b1 + a4*b1*HIGH_W + a5*b1*HIGH_Z;
! Calc conditional total effects for each combination of moderator values
TLOW_LOZ = ILOW_LOZ + cdash;
TMEW_LOZ = IMEW_LOZ + cdash;
THIW_LOZ = IHIW_LOZ + cdash;
TLOW_MEZ = ILOW_MEZ + cdash;
TMEW_MEZ = IMEW_MEZ + cdash;
THIW_MEZ = IHIW_MEZ + cdash;
TLOW_HIZ = ILOW_HIZ + cdash;
TMEW_HIZ = IMEW_HIZ + cdash;
THIW_HIZ = IHIW_HIZ + cdash;
! Use loop plot to plot conditional indirect effect of X on Y for each combination of low,
! Could be edited to show conditional direct or conditional total effects instead
! 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 (PLOW_LOZ PMEW_LOZ PHIW_LOZ PLOW_MEZ PMEW_MEZ
PHIW_MEZ
PLOW_HIZ PMEW_HIZ PHIW_HIZ);
LOOP(XVAL,1,6,0.1);
PLOW_LOZ = ILOW_LOZ*XVAL;
PMEW_LOZ = IMEW_LOZ*XVAL;
PHIW_LOZ = IHIW_LOZ*XVAL;
PLOW_MEZ = ILOW_MEZ*XVAL;
PMEW_MEZ = IMEW_MEZ*XVAL;
PHIW_MEZ = IHIW_MEZ*XVAL;
PLOW_HIZ = ILOW_HIZ*XVAL;
PMEW_HIZ = IMEW_HIZ*XVAL;
PHIW_HIZ = IHIW_HIZ*XVAL;
PLOT:
TYPE = plot2;
OUTPUT:
STAND CINT(bcbootstrap);
*** ERROR in MODEL CONSTRAINT command
A parameter label or the constant 0 must appear on the left-hand side
of a MODEL CONSTRAINT statement. Problem with the following:
PHIW_HIZ) =