全部版块 我的主页
论坛 提问 悬赏 求职 新闻 读书 功能一区 经管百科 爱问频道
5877 5
2019-07-18
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) =



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2019-7-18 17:20:33
mplus报错 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) =
求助各位大神,这是错在哪里了,应该怎么修改
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2019-12-15 19:43:21
楼主这个问题解决了嘛,我也有同样的困扰
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-11-9 21:34:42
我也出现了同样的问题,最后是发现有一个括号用的是中文状态下的,所以跑不出来
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2021-12-27 18:13:45
奔跑的靡靡 发表于 2019-7-18 17:20
mplus报错 ERROR in MODEL CONSTRAINT command A parameter label or the constant 0 must appear on the l ...
请问你现在问题解决吗
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2023-11-9 15:01:06
这种情况先查拼写错误。你看看有没有把o0,li1这些小写很容易混淆的东西弄混,我就是找了一大圈最后发现是这个原因来的。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群