我使用R的lavaan包建立结构方程模型,具体代码如下:
> s21data=read.csv("satisfaction.csv",head=TRUE)
> head(s21data)
i1 i2 i3 i4 i5 e1 e2 e3 e4 e5 q1 q2 q3 q4 q5 v1 v2 v3 v4 s1 s2 s3 s4 l1 l2 l3 l4
1 8 8 9 5 6 9 9 5 8 9 6 8 2 7 7 7 10 5 6 6 7 6 7 9 9 6 6
2 9 9 10 9 7 9 8 10 8 9 7 9 7 8 7 8 8 7 8 8 7 8 7 8 9 8 8
3 9 8 8 8 8 8 8 8 9 9 7 9 6 8 6 8 9 7 8 9 8 8 8 9 8 9 9
4 8 9 8 9 7 10 6 3 10 10 7 3 2 10 8 6 7 6 4 7 7 7 6 6 6 5 5
5 10 10 8 10 8 7 9 8 9 8 7 9 8 9 8 9 10 10 8 8 8 8 7 8 9 9 9
6 7 8 8 8 8 8 8 8 9 10 6 6 7 7 7 8 7 6 5 7 6 6 7 7 8 8 7
> model= '
+ EXPE ~IMAG
+ QUAL ~EXPE
+ VAL ~EXPE +QUAL
+ SAT ~IMAG +EXPE +QUAL +VAL
+ LOY ~IMAG +SAT
+ i1 =~IMAG
+ i2 =~IMAG
+ i3 =~IMAG
+ i4 =~IMAG
+ i5 =~IMAG
+ e1 =~EXPE
+ e2 =~EXPE
+ e3 =~EXPE
+ e4 =~EXPE
+ e5 =~EXPE
+ q1 =~QUAL
+ q2 =~QUAL
+ q3 =~QUAL
+ q4 =~QUAL
+ q5 =~QUAL
+ v1 =~VAL
+ v2 =~VAL
+ v3 =~VAL
+ v4 =~VAL
+ s1 =~SAT
+ s2 =~SAT
+ s3 =~SAT
+ s4 =~SAT
+ l1 =~LOY
+ l2 =~LOY
+ l3 =~LOY
+ l4 =~LOY '
> fit =sem(model, data=s21data)
Error in lavaan::lavaan(model = model, data = s21data, model.type = "sem", :
lavaan ERROR: some latent variable names collide with observed
variable names: i1 i2 i3 i4 i5 e1 e2 e3 e4 e5 q1 q2 q3 q4 q5 v1 v2 v3 v4 s1 s2 s3 s4 l1 l2 l3 l4
补充:其中,EXPE、IMAG、QUAL、EXPE、VAL、SAT、LOY是隐变量,i1 i2 i3 i4 i5 e1 e2 e3 e4 e5 q1 q2 q3 q4 q5 v1 v2 v3 v4 s1 s2 s3 s4 l1 l2 l3 l4这些是显变量(观察指标),这些显变量的值在数据中是已经有的。显变量和隐变量之间的关系都是反映型的。
请问大家这是哪里有问题呢?我查了网上,查了相关说明都不知道有什么问题。请大神们帮我指点迷津,谢谢。
问题已解决。