if (FALSE) { # require("psych") && require("lavaan")
# \donttest{
library(parameters)
data(attitude)
efa <- psych::fa(attitude, nfactors = 3)
model1 <- efa_to_cfa(efa)
model2 <- efa_to_cfa(efa, threshold = 0.3)
model3 <- efa_to_cfa(efa, max_per_dimension = 2)
suppressWarnings(anova(
lavaan::cfa(model1, data = attitude),
lavaan::cfa(model2, data = attitude),
lavaan::cfa(model3, data = attitude)
))
# }
}
Run the code above in your browser using DataLab