我该如何用lavaan R构建单指标潜在变量模型?

问题描述

我实际上想做什么

  • 我正在尝试使用lavaan包(交叉滞后效果模型)来分析面板数据。
  • 如果我想运行以下代码
model <- '
# Observed variables A,B,C,D are ordinal variables
f1 =~ 1*A1 + B1;  
f2 =~ 1*A2 + B2;
f3 =~ 1*C1 + D1;
f4 =~ 1*C2 + D2;

f3 ~ f1 + f2;
f4 ~ f1 + f2
'

result <- sem(model,data,ordered = c("A","B","C","D"))

问题

  • 但是我实际上没有D1(第三行)。

我的代码

  • 因此我将模型更改为包含单指标潜在变量的模型。
  • 如下所示,我将C1的系数固定为1并确定其误差方差
f1 =~ 1*A1 + B1;  
f2 =~ 1*A2 + B2;
f3 =~ 1*C1;
f4 =~ 1*C2 + D2;

#Raw Cronbach's alpha is 0.783 and var is 0.957
C1 ~~ (1-0.783)*0.957*C1

f3 ~ f1 + f2;
f4 ~ f1 + f2
'

result <- sem(model,"D"))

但是我仍然收到这些警告消息。

lavaan WARNING:
    Could not compute standard errors! The information matrix Could
    not be inverted. This may be a symptom that the model is not
    identified.
lavaan WARNING: Could not invert information matrix needed for robust test statistic
  • 如何解决此问题并确定模型?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)