我想计算结构方程模型(SEM)。
有3个功能特定指标:IES_flex
,IES_ic
和d
构成潜在变量执行函数EF
。 EF
的方差固定为1。
目标是评估EF
和功能特定指标对自我控制的贡献,BSCS
,用自评问卷测量/观察。
我们还希望将IES_flex
,IES_ic
和d
的残差(即方差)视为预测变量。因为我们认为四个EF
因子,EF
和三个残差之间的关系以及自我控制是通过另外两个变量AOF
和AOP
来调节的, /通过自评问卷观察,这些变量被整合到模型中。因此,EF
之间的四个AOF
因素,AOP
,EF
互动
因素和AOF
和AOP
作为预测因子包含在预测自我控制的SEM中。我们使用了lavaan
包。
structure(list(id = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
11L, 12L, 15L, 16L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L,
27L, 28L, 29L, 30L), d = c(0.627550651847074, 0.627550651847074,
-1.25488425977031, -2.196101715579, 1.15724880920241, 0.627550651847074,
0.33421021229571, 0.745729510749062, 1.15724880920241, 1.15724880920241,
-0.843364961316958, 0.627550651847074, -0.72518610241497, 0.0978524944917336,
1.15724880920241, 0.33421021229571, 0.216031353393722, -0.0773090861576415,
-1.43004584041969, -0.900347683064346, 0.745729510749062, -0.19548794505963,
-2.196101715579, -1.25488425977031, 0.0978524944917336, -0.313666803961618,
-0.607007243512982), IES_ic = c(0.903246908249129, 0.608280005625906,
-0.651212978846396, 0.657310408322585, 1.21305673020249, -1.04692343679818,
-0.903284598584151, 0.262713727419709, -0.626403780452018, -0.91538007206007,
1.45121068878722, 0.841762347441691, -1.41934878331439, -0.299243983786715,
1.21342325970176, -1.14073251937004, 0.459472079702781, -0.259362000494534,
-1.49045737622129, 0.398822125305692, 1.26033903560836, -0.797724102794307,
0.269976328580042, 0.889518395494059, 0.26777715158442, -0.738683217257273,
-0.98266764803722), IES_flex = c(0.611376670202966, 0.100019803482406,
-0.375879963693191, 0.832183290075242, 1.08417699970122, 0.901722484622191,
-0.367500997199248, 0.726569152639851, 0.443174501563025, -1.9680067473553,
1.0716305189065, 0.832203725126164, -0.0294727224025174, -1.09829525782315,
0.672854247160833, -2.03419485699619, 0.178295825969132, -0.419626289631151,
-1.34447496846711, 0.410673189009022, 0.608304448372783, 0.588371276471592,
-0.277360713478181, -0.827612393483032, 1.31165502930096, -0.735856606954008,
-1.42448433147589), AOP = c(1.02516676018312, 1.02516676018312,
-1.04630421915597, 1.02516676018312, -0.0105687294864242, -0.0105687294864242,
-0.0105687294864242, -0.528436474321195, 0.507299015348346, -1.04630421915597,
-2.59990745366028, -0.528436474321195, 1.02516676018312, 0.507299015348346,
1.02516676018312, 0.507299015348346, 1.02516676018312, -0.528436474321195,
1.02516676018312, -0.0105687294864242, -1.04630421915597, 1.02516676018312,
-1.04630421915597, 0.507299015348346, 0.507299015348346, 0.507299015348346,
0.507299015348346), AOF = c(1.46940335759051, -1.18500270773428,
2.13300487392171, 0.142200324928114, 0.474001083093712, -1.18500270773428,
-0.189600433237485, 1.13760259942491, 0.474001083093712, 1.13760259942491,
0.474001083093712, 1.13760259942491, -0.853201949568682, -0.853201949568682,
0.474001083093712, -1.84860422406548, 1.13760259942491, -0.853201949568682,
1.46940335759051, -1.84860422406548, 0.142200324928114, 0.142200324928114,
-1.51680346589988, -1.51680346589988, -0.853201949568682, -0.521401191403083,
0.142200324928114), BSCS = c(36, 47, 32, 53, 35, 34, 41, 19,
40, 37, 27, 46, 37, 46, 50, 33, 41, 40, 49, 37, 35, 39, 50, 49,
43, 40, 36)), .Names = c("id", "d", "IES_ic", "IES_flex", "AOP",
"AOF", "BSCS"), row.names = c(NA, 27L), class = "data.frame")
HS.model <- '
# measurement model
EF =~ IES_flex + IES_ic + d
a =~ EF*AOP
b =~ EF*AOF
c =~ EF*AOP*AOF
a_f =~ IES_flex*AOP
b_f =~ IEs_flex*AOF
c_f =~ IES_flex*AOP*AOF
a_i =~ IES_ic*AOP
b_i =~ IEs_ic*AOF
c_i =~ IES_ic*AOP*AOF
a_d =~ d*AOP
b_d =~ d*AOF
c_d =~ d*AOP*AOF
EF ~~ 1*EF
IES_flex ~~ IES_flex
IES_ic ~~ IES_ic
d ~~ d
# regression
BSCS ~ EF + AOF + AOP + IES_flex + IES_ic + d + a + b + c + a_f + b_f + c_f + a_i + b_i + c_i + a_d + b_d + c_d
'
fit <- sem(HS.model, data = ex,orthogonal = TRUE)
summary(fit,standardized=TRUE,fit.measures=T,rsquare=T)
parameterEstimates(fit,standardized=TRUE)
拟合后的错误&lt; - sem(HS.model ...是:
Error in lavaanify(model = FLAT, constraints = constraints, varTable = lavdata@ov, :
lavaan ERROR: wrong number of arguments in modifier (EF,AOP) of element c=~AOF
我的问题是,这是否是整合残差和分析相互作用的正确方法?我应该分别对每个EF因子进行分析吗?