Combine fit measures form several models and compare
Usage
lav_compare(
...,
what = c("cfi", "tli", "rmsea", "srmr", "bic", "df"),
LRT = F,
print = T
)Examples
data("HolzingerSwineford1939", package="lavaan")
m1 = cfa("F1 =~ x1 + x2 + x3 + x4 + x5", estimator= "mlr", HolzingerSwineford1939)
#> Error in cfa("F1 =~ x1 + x2 + x3 + x4 + x5", estimator = "mlr", HolzingerSwineford1939): could not find function "cfa"
m2 = cfa("F1 =~ x1 + x2 + x3 + x4 + x5; x4 ~~ x5", estimator= "mlr", HolzingerSwineford1939)
#> Error in cfa("F1 =~ x1 + x2 + x3 + x4 + x5; x4 ~~ x5", estimator = "mlr", HolzingerSwineford1939): could not find function "cfa"
lav_compare(m1, m2, what = c("cfi.scaled", "rmsea.scaled") )
#> Error: object 'm1' not found
