【发布时间】:2019-11-22 14:54:25
【问题描述】:
我有一个关于内生变量和二元/有序内生变量数据缺失的案例。 下面的模型 1 代表它并且它工作得很好。 但是,在编写方式上,它假设我的变量是连续的(它们实际上都是序数/二进制),并且不包括间接影响的计算。 当我尝试调整它(如模型 2 所示)以考虑这两件事时,它说估计器 FIML 不能用于分类数据(因此,它排除了所有缺少数据的行)。此外,结果输出甚至不包括标准偏差。 谁能帮我弄清楚如何建模? 提前致谢
# Model 1
model1 <-'Importance~Seats+PriceRange
Measurement~Importance
Prekitchen~Importance+Measurement
Kitchen~Importance+Measurement
Postkitchen~Importance+Measurement
# Means are mentioned below so that all the information is used, bypassing listwise deletion
Seats~1
Price Range~1'
fit <- lavaan(model1, data=Mediate, missing="fiml")
summary(fit, fit.measures=TRUE)
semPaths(fit)
# Model2
model2 <- 'Importance~Seats+PriceRange
# Including the paths to calculate the indirect effects
Measurement~a*Importance
Prekitchen~b*Measurement
Prekitchen~c*Importance
Kitchen~d*Measurement
Kitchen~e*Importance
Postkitchen~f*Measurement
Postkitchen~g*Importance
# Indirect effects exerted by Importance
ab:=a*b
total:=c+(a*b)
ad:=a*d
total:=e+(a*d)
af:=a*f
total:=g+(a*f)
Seats~1
Price Range~1'
# Including the variable type "Ordered" for all the categorical variables.
fit2 <- sem(model2, data=Mediate, missing="fiml", ordered=c("Importance", "Measurement", "Prekitchen", "Kitchen", "Postkitchen"))
summary(fit2, fit.measures=TRUE)
semPaths(fit2)
P.S:我已经用过 M-plus,但问题是对于这样的模型,没有拟合优度指标。
【问题讨论】:
标签: missing-data categorical-data r-lavaan