【问题标题】:Lavaan: path analysis with ordered categorical (including binary) variables and missing data on endogenous variablesLavaan:使用有序分类(包括二元)变量和内生变量缺失数据的路径分析
【发布时间】: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


    【解决方案1】:

    您是否尝试过在计算模型之前进行插补?我认为这样可以节省代码中的 FIML 块。

    我通常使用 MICE 包来做到这一点:

    install.packages("mice")

    library(mice)

    md.pattern(data)

    如果你想仔细看看,这里有一篇有用的论文:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3074241/

    另外,请尝试使用函数 sem 而不是 lavaan 并包含参数 ordered,以表明您的数据是分类的。

    e。 g.:fit.1 &lt;- sem(cat.1, data=data, std.lv=TRUE, ordered=names[1:n])

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-12
      • 1970-01-01
      • 2021-09-05
      • 2020-04-17
      • 2017-05-14
      • 1970-01-01
      • 2016-07-24
      • 2014-10-04
      相关资源
      最近更新 更多