Mô hình Phương trình Cấu trúc với lavaan trong R
Erin Buchanan
Professor
library(lavaan)
library(semPlot)
twofactor.model <- 'text =~ x4 + x5 + x6
speed =~ x7 + x8 + x9'
twofactor.fit <- cfa(model = twofactor.model,
data = HolzingerSwineford1939)
semPaths(object = twofactor.fit)

semPaths(object = twofactor.fit,
whatLabels = "std",
edge.label.cex = 1)
#whatLabels cũng có thể là "par"

semPaths(object = twofactor.fit,
whatLabels = "std",
edge.label.cex = 1,
layout = "circle")
#tùy chọn layout: tree, circle, spring, tree2, circle2

semPaths(object = twofactor.fit,
whatLabels = "std",
edge.label.cex = 1,
layout = "tree", rotation = 2)
#tùy chọn rotation là 1, 2, 3, 4 cho bố cục tree

semPaths(object = twofactor.fit,
whatLabels = "std",
edge.label.cex = 1,
layout = "tree", rotation = 2,
what = "std", edge.color = "purple")
#tùy chọn what gồm par và std

Mô hình Phương trình Cấu trúc với lavaan trong R