gpt4 book ai didi

r - 省略 sempaths 中的协方差路径(包 : semplot)

转载 作者:行者123 更新时间:2023-12-04 03:11:05 25 4
gpt4 key购买 nike

当我使用 sempaths(包 semplots)绘制 SEM 模型时,我无法摆脱路径。该路径看起来是两个观察变量(V1_1 和 V1_2)之间的协方差。

这是我的模型和输出图的代码:

#specifying the model using lavaan package
model = '
#define latent variable
left_right =~ Left_Right1 + Left_Right2 + Left_Right3 + Left_Right4 +
Left_Right5
#define regression
V1_1 ~ left_right
V1_2 ~ left_right
'
#fitting an sem model
fit <- sem(model, data=data, estimator="DWLS")

#loading semplot package
library(semPlot)

#plotting path diagram
semPaths(fit,label.font = 1,label.norm = "OOOO",label.scale = T, what =
"est", fade=FALSE,style="lisrel", rotation=4, title = FALSE, sizeLat = 9,
sizeMan = 5, sizeMan2 =4, sizeInt = 1, sizeInt2 = 10,posCol =c("black"),
residuals = T, layoutSplit = T, edge.label.cex = 0.6)

我得到的输出如下所示:

example output plot with unwanted covariance path between V1_1 and V1_2

我希望摆脱的路径/边在节点“V1_1”和“V1_2”之间,值为 0.20。任何帮助将不胜感激。

最佳答案

你可能已经解决了这个问题。无论哪种方式,您只需要将“残差”参数更改为 FALSE。

关于r - 省略 sempaths 中的协方差路径(包 : semplot),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45283195/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com