Vytváření diagramů pomocí semPaths()

Structural Equation Modeling with lavaan in R

Erin Buchanan

Professor

semPlot a semPaths()

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)
Structural Equation Modeling with lavaan in R

Výchozí výstup semPaths()

Výchozí graf z semPaths

Structural Equation Modeling with lavaan in R

Úprava diagramu

semPaths(object = twofactor.fit,
         whatLabels = "std", 
         edge.label.cex = 1)
#whatLabels can also be "par" 

Aktualizovaný diagram s popisky hran

Structural Equation Modeling with lavaan in R

Rozložení diagramu

semPaths(object = twofactor.fit,
          whatLabels = "std", 
          edge.label.cex = 1, 
          layout = "circle")
#layout options are tree, circle, spring, tree2, circle2

Aktualizované rozložení na kruhové

Structural Equation Modeling with lavaan in R

Rotace diagramu

semPaths(object = twofactor.fit,
          whatLabels = "std", 
          edge.label.cex = 1, 
          layout = "tree", rotation = 2)
#rotation options are 1, 2, 3, 4 for tree layouts

Aktualizovaná rotace stromu s latentními proměnnými vlevo

Structural Equation Modeling with lavaan in R

Vizualizace barev

semPaths(object = twofactor.fit,
         whatLabels = "std", 
         edge.label.cex = 1, 
         layout = "tree", rotation = 2,
         what = "std", edge.color = "purple")
#what options include par and std

Aktualizovaná barva na odstín fialové

Structural Equation Modeling with lavaan in R

Vamos praticar!

Structural Equation Modeling with lavaan in R

Preparing Video For Download...