Mplus Path Analysis Example 3.18
来自OBHRM百科
示意图
代码与注释
TITLE: this is an example of moderated mediation with a plot of the indirect effect # 标题 DATA: FILE = ex3.18.dat; # 数据文件 VARIABLE:NAMES = y m x z; # 数据文件中变量的名称 USEVARIABLES = y m x z xz; # 分析时使用哪些变量 DEFINE: xz = x*z; # 定义调节效应变量为xz(自己根据需要命名)xz等于x与z相乘 ANALYSIS:ESTIMATOR = BAYES; PROCESSORS = 2; BITERATIONS = (30000); MODEL: y ON m (b) x z; m ON x (gamma1) z xz (gamma2); MODEL CONSTRAINT: PLOT(indirect); LOOP(mod,-2,2,0.1); indirect = b*(gamma1+gamma2*mod); PLOT: TYPE = PLOT2; OUTPUT: STANDARDIZED TECH8;