# Load lavaan package
library(lavaan)
#----------------------------------------------------------------------------
# Example 1: Saturated correlates model for the sem function
# Model specification
model <- 'Ozone ~ Wind'
# Model estimation using the sem.satcor function
mod.fit <- sem.satcor(model, data = airquality, aux = c("Temp", "Month"))
# Model estimation using the na.satcor function
mod.fit <- na.satcor(model, data = airquality, fun = "sem", aux = c("Temp", "Month"),
estimator = "MLR")
# Result summary
summary(mod.fit)
Run the code above in your browser using DataLab