if (FALSE) {
#----------------------------------------------------------------------------
# Example 1: item.cfa() function
# Load data set "HolzingerSwineford1939" in the lavaan package
data("HolzingerSwineford1939", package = "lavaan")
result <- item.cfa(HolzingerSwineford1939[, c("x1", "x2", "x3")], output = FALSE)
write.result(result, "CFA.xlsx")
#----------------------------------------------------------------------------
# Example 2: multilevel.descript() function
# Load data set "Demo.twolevel" in the lavaan package
data("Demo.twolevel", package = "lavaan")
result <- multilevel.descript(y1:y3, data = Demo.twolevel, cluster = "cluster",
output = FALSE)
write.result(result, "Multilevel_Descript.xlsx")
}
Run the code above in your browser using DataLab