想要mplus做有调节的中介,调节直接效应和后半段路径。模型图如下。
代码如下:
Title:DT & NSSI
data:file is C:\Users\user\Desktop\Data\mplus.txt;
Variable: names are sex age x1-x3 p1-p3 s1-s3 r1-r3 d1-d3 e1-e3 y1-y12;
usevariable are x1 p2 d2 y3 zx zm;
missing = all (999);
Define:
!center = x1 p2 d2 (Grandmean); 这是中心化的代码,但是运行后,总是出错,望各位高手指点一下,中心化哪些写错了。
zx=d2*x1;
zm=d2*p2;
Analysis:
type = general;
estimator = ml;
Bootstrap = 1000;
processors =2;
Model:
y3 on p2(b1)
x1(c1)
d2(c2)
zx(c3)
zm(b2);
p2 on x1(a1);
Model Constraint:
new(ind1 ind2 ind3 dir1 dir2 dir3 Zmod1 Zmod2 Zmod3);
Zmod1 =1;
Zmod2 =0;
Zmod3 =-1;
ind1=(b1+b2*Zmod1)*a1;
ind1=(b1+b2*Zmod2)*a1;
ind1=(b1+b2*Zmod3)*a1;
dir1=(c1+c3*Zmod1);
dir2=(c1+c3*Zmod2);
dir3=(c1+c3*Zmod3);
Output:
standardized cinterval(BCbootstrap);
这是运行后的结果。代码是根据王孟成老师培训时的d代码写的,可以运行,但是运行后,根据结果里面没有可用信息。
没有模型的各项拟合指数,没有标准化的回归系数。有没有直接效应和间接效应的结果。不知道是哪里出现了错误。望各位高手指点一下。
Mplus VERSION 6.12
MUTHEN & MUTHEN
08/28/2020 5:33 PM
INPUT INSTRUCTIONS
Title:DT & NSSI
data:file is C:\Users\user\Desktop\Data\mplus.txt;
Variable: names are sex age x1-x3 p1-p3 s1-s3 r1-r3 d1-d3 e1-e3 y1-y12;
usevariable are x1 p2 d2 y3 zx zm;
missing = all (999);
Define:
!center = x1 p2 d2 (Grandmean);
zx=d2*x1;
zm=d2*p2;
Analysis:
type = general;
estimator = ml;
Bootstrap = 1000;
processors =2;
Model:
y3 on p2(b1)
x1(c1)
d2(c2)
zx(c3)
zm(b2);
p2 on x1(a1);
Model Constraint:
new(ind1 ind2 ind3 dir1 dir2 dir3 Zmod1 Zmod2 Zmod3);
Zmod1 =1;
Zmod2 =0;
Zmod3 =-1;
ind1=(b1+b2*Zmod1)*a1;
ind1=(b1+b2*Zmod2)*a1;
ind1=(b1+b2*Zmod3)*a1;
dir1=(c1+c3*Zmod1);
dir2=(c1+c3*Zmod2);
dir3=(c1+c3*Zmod3);
Output:
standardized cinterval(BCbootstrap);
*** WARNING
Data set contains cases with missing on x-variables.
These cases were not included in the analysis.
Number of cases with missing on x-variables: 104
1 WARNING(S) FOUND IN THE INPUT INSTRUCTIONS
DT & NSSI
SUMMARY OF ANALYSIS
Number of groups 1
Number of observations 2155
Number of dependent variables 2
Number of independent variables 4
Number of continuous latent variables 0
Observed dependent variables
Continuous
P2 Y3
Observed independent variables
X1 D2 ZX ZM
Estimator ML
Information matrix OBSERVED
Maximum number of iterations 1000
Convergence criterion 0.500D-04
Maximum number of steepest descent iterations 20
Maximum number of iterations for H1 2000
Convergence criterion for H1 0.100D-03
Number of bootstrap draws
Requested 1000
Completed 0
Input data file(s)
C:\Users\user\Desktop\Data\mplus.txt
Input data format FREE
SUMMARY OF DATA
Number of missing data patterns 2
COVARIANCE COVE
RAGE OF DATA
Minimum covariance coverage value 0.100
PROPORTION OF DATA PRESENT
Covariance Coverage
P2 Y3 X1 D2 ZX
________ ________ ________ ________ ________
P2 1.000
Y3 0.738 0.738
X1 1.000 0.738 1.000
D2 1.000 0.738 1.000 1.000
ZX 1.000 0.738 1.000 1.000 1.000
ZM 1.000 0.738 1.000 1.000 1.000
Covariance Coverage
ZM
________
ZM 1.000
NO CONVERGENCE. SERIOUS PROBLEMS IN ITERATIONS.
CHECK YOUR DATA, STARTING VALUES AND MODEL.
MODEL RESULTS
Estimate
Y3 ON
P2 0.000
X1 0.002
D2 0.000
ZX 0.000
ZM 0.000
P2 ON
X1 0.000
Intercepts
P2 6.354
Y3 0.423
Residual Variances
P2 38.077
Y3 1.458
New/Additional Parameters
IND1 0.004
IND2 0.500
IND3 0.500
DIR1 0.002
DIR2 0.002
DIR3 0.002
ZMOD1 1.000
ZMOD2 0.000
ZMOD3 -1.000
MODEL COMMAND WITH FINAL ESTIMATES USED AS STARTING VALUES
y3 ON p2*0 (b1);
y3 ON x1*0.002 (c1);
y3 ON d2*0 (c2);
y3 ON zx*0 (c3);
y3 ON zm*0 (b2);
p2 ON x1*0 (a1);
[ p2*6.354 ];
[ y3*0.423 ];
p2*38.077;
y3*1.458;
! NEW statements in MODEL CONSTRAINT
NEW(ind1*0.004);
NEW(ind2*0.500);
NEW(ind3*0.500);
NEW(dir1*0.002);
NEW(dir2*0.002);
NEW(dir3*0.002);
NEW(zmod1*1);
NEW(zmod2*0);
NEW(zmod3*-1);
Beginning Time: 17:33:00
Ending Time: 17:33:02
Elapsed Time: 00:00:02
MUTHEN & MUTHEN
3463 Stoner Ave.
Los Angeles, CA 90066
Tel: (310) 391-9971
Fax: (310) 391-8971
Web:
www.StatModel.com
Support:
Support@StatModel.com
Copyright (c) 1998-2011 Muthen & Muthen