
2019年1月份 Mplus结构方程建模与应用(线上教学班)现已开始接受报名,详情请您点击上述红色字体查看课程安排!

Figure 1. Conceptual model

Figure 2. Statistical model
Mplus code for the model:
!Commands before USEVARIABLES are omitted intentionally, !please refer to the 1st clip if necessary
! Predictor variable - X
! Mediator variable(s) – M
! Moderator variable(s) – V, Q
! Outcome variable - Y
USEVARIABLES = X M V Q Y MV MQ;
! Create interaction terms
! Note that they have to be placed at end of USEVARIABLES
subcommand above
DEFINE:
MQ = M*Q;
MV = M*V;
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 V (b2);
Y ON Q (b3);
Y ON MV (b4);
Y ON MQ (b5);
Y ON X (c);
[M] (a0);
M ON X (a1);
! Use model constraint subcommand to test conditional indirect
effects. You need to pick low, medium and high moderator values for V, Q
! 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_V MED_V HIGH_V LOW_Q MED_Q HIGH_Q ILOV_LOQ IMEV_LOQ IHIV_LOQ ILOV_MEQ IMEV_MEQ IHIV_MEQ ILOV_HIQ IMEV_HIQ IHIV_HIQ TLOV_LOQ TMEV_LOQ THIV_LOQ TLOV_MEQ TMEV_MEQ THIV_MEQ TLOV_HIQ TMEV_HIQ THIV_HIQ);
LOW_V = #LOWV; ! replace #LOWV in the code with your
chosen low value of V
MED_V = #MEDV; ! replace #MEDV in the code with your
chosen medium value of V
HIGH_V = #HIGHV; ! replace #HIGHV in the code with your
chosen high value of V
LOW_Q = #LOWQ; ! replace #LOWQ in the code with your
chosen low value of Q
MED_Q = #MEDQ; ! replace #MEDQ in the code with your
chosen medium value of Q
HIGH_Q = #HIGHQ; ! replace #HIGHQ in the code with your
chosen high value of Q
! Calculate conditional indirect effects for each combination of
moderator values
ILOV_LOQ = a1*b1 + a1*b4*LOW_V + a1*b5*LOW_Q;
IMEV_LOQ = a1*b1 + a1*b4*MED_W + a1*b5*LOW_Q;
IHIV_LOQ = a1*b1 + a1*b4*HIGH_V + a1*b5*LOW_Q;
ILOV_MEQ = a1*b1 + a1*b4*LOW_V + a1*b5*MED_Q;
IMEV_MEQ = a1*b1 + a1*b4*MED_W + a1*b5*MED_Q;
IHIV_MEQ = a1*b1 + a1*b4*HIGH_V + a1*b5*MED_Q;
ILOV_HIQ = a1*b1 + a1*b4*LOW_V + a1*b5*HIGH_Q;
IMEV_HIQ = a1*b1 + a1*b4*MED_W + a1*b5*HIGH_Q;
IHIV_HIQ = a1*b1 + a1*b4*HIGH_V + a1*b5*HIGH_Q;
! Calculate conditional total effects for each combination of
moderator values
TLOV_LOQ = ILOV_LOQ + c;
TMEV_LOQ = IMEV_LOQ + c;
THIV_LOQ = IHIV_LOQ + c;
TLOV_MEQ = ILOV_MEQ + c;
TMEV_MEQ = IMEV_MEQ + c;
THIV_MEQ = IHIV_MEQ + c;
TLOV_HIQ = ILOV_HIQ + c;
TMEV_HIQ = IMEV_HIQ + c;
THIV_HIQ = IHIV_HIQ + c;
OUTPUT: STAND CINT(bcbootstrap);


