# NOT RUN {
# Load data
wmt <- wmt2[,7:24]
# }
# NOT RUN {
# Estimate EGA
## plot.type = "qqraph" used for CRAN checks
## plot.type = "GGally" is the default
ega.wmt <- EGA(data = wmt, plot.type = "qgraph")
# Estimate optimal EGA
fit.wmt <- EGA.fit(data = wmt)
# Plot optimal fit
plot(fit.wmt$EGA, plot.type = "qgraph")
# Compare with CFA
cfa.ega <- CFA(ega.wmt, estimator = "WLSMV", data = wmt)
cfa.fit <- CFA(fit.wmt$EGA, estimator = "WLSMV", data = wmt)
lavaan::lavTestLRT(cfa.ega$fit, cfa.fit$fit, method = "satorra.bentler.2001")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab