我知道这lavaan是为了做 SEM/CFA 而 R 函数factanal做 EFA。EFA 和 CFA 看起来非常相似,所以我想知道为什么我似乎无法指定在我看来与lavaan我可以适应的相同模型的情况factanal。
我是否误解了 CFA 和 EFA 之间的统计关系,或者我只是误用了lavaan语法?
例如,使用经典的 Holzinger-Swineford 数据,我们可以在前 6 个观测值中寻找两个因子。 lavaan抛出这个错误,
> library(lavaan)
> model <- 'f1 =~ x1 + x2 + x3 + x4 + x5 + x6
+ f2 =~ x1 + x2 + x3 + x4 + x5 + x6
+ '
> fit <- cfa(model, data = HolzingerSwineford1939)
Warning message:
In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, :
lavaan WARNING: could not compute standard errors!
lavaan NOTE: this may be a symptom that the model is not identified.
但factanal没关系:
>
> factanal(~x1+x2+x3+x4+x5+x6, factors = 2, data = HolzingerSwineford1939)
Call:
factanal(x = ~x1 + x2 + x3 + x4 + x5 + x6, factors = 2, data = HolzingerSwineford1939)
Uniquenesses:
x1 x2 x3 x4 x5 x6
0.574 0.787 0.441 0.284 0.232 0.304
Loadings:
Factor1 Factor2
x1 0.293 0.584
x2 0.106 0.449
x3 0.747
x4 0.824 0.191
x5 0.873
x6 0.802 0.231
Factor1 Factor2
SS loadings 2.183 1.196
Proportion Var 0.364 0.199
Cumulative Var 0.364 0.563
Test of the hypothesis that 2 factors are sufficient.
The chi square statistic is 2.07 on 4 degrees of freedom.
The p-value is 0.722
我如何指定一个像factanal在做的模型lavaan?