|||
library(tidyverse)
library(agricolae)
library(semPlot)
library(lavaanPlot)
library(lavaan)
data(haynes)
# 结构模型
model <- "
WI ~ FL + MI + ME
"
# FL~~MI
# FL~~ME
# MI~~ME
# MI~~MI
# FL~~FL
# ME~~ME
fit <- sem(model, data = haynes)
tiff(filename = "1.tiff",width = 17.5,height = 17.5,units = "cm",res = 900,compression = "lzw")
semPaths(
fit,
what = "stand",
style = "lisrel",
whatLabels = "stand",
layout = "circle2",
curveAdjacent = TRUE,
# structural=TRUE,structural
edge.label.cex = 0.8,
# exoVar = FALSE,
#exoCov = FALSE,
esize = 2,
nDigits = 3,
residuals = TRUE,
intercepts = TRUE
)
dev.off()
shell.exec(file.path(getwd(),"1.tiff"))
结果如下:(同上篇博文结果基本一致。http://blog.sciencenet.cn/blog-3427939-1230425.html)
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-22 23:50
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社