这个应该是你输入路径时变量指向错误 一般在错误是由于specifyModel()设定不全
错误案例:
> model.kerch <- specifyModel(
+ text = '
+ a -> b, a_b, NA
+ a -> c, a_c, NA
+ a -> d, a_d, NA
+ b -> d, b_d, NA
+ b -> c, b_c, NA
+ c -> d, c_d, NA
+
a -> a, a_a, NA
+ b -> b, b_b, NA
+ c -> c, c_c, NA
+ d -> d, d_d, NA
+ ')
Read 10 records
NOTE: it is generally simpler to use specifyEquations() or cfa()
see ?specifyEquations
> out_sem <- sem(model.kerch, cor_num, nrow(dat))
Error in csem(model = model.description, start, opt.flag = 1, typsize = typsize, :
The matrix is non-invertable.
---------------------------------------------------
只需要将specifyModel 里后四行自己对自己的影响符号变为:<->
a <-> a, a_a, NA
b <-> b, b_b, NA
c <-> c, c_c, NA
d <-> d, d_d, NA
修改后结果:
[img]C:\Users\Lenovo\Desktop\sem11

[/img]