compare_fit(
...,
digits = 3,
quite = FALSE,
streamline = FALSE,
return_result = FALSE
)
model. If it is a lavaan
object, it will try to compute the measurement invariance. Other model types will be passed to performance::compare_performance()
.
number of digits to round to
suppress printing output
print streamlined output
If it is set to TRUE
, it will return the the compare fit data frame.
a dataframe
with fit indices and change in fit indices
# lme model
fit1 <- lm_model(
data = popular,
response_variable = popular,
predictor_var = c(sex, extrav)
)
#> Fitting Model with lm:
#> Formula = popular ~ sex + extrav
fit2 <- lm_model(
data = popular,
response_variable = popular,
predictor_var = c(sex, extrav),
two_way_interaction_factor = c(sex, extrav)
)
#> Fitting Model with lm:
#> Formula = popular ~ sex + extrav + sex*extrav
compare_fit(fit1, fit2)
#> Model Summary
#> Model Type = Model Comparison
#>
#> ────────────────────────────────────────────────────────────────────────────────────────────────
#> Model AIC AIC_wt AICc AICc_wt BIC BIC_wt R2 R2_adjusted RMSE Sigma
#> ────────────────────────────────────────────────────────────────────────────────────────────────
#> lm 5977.415 0.727 5977.435 0.728 5999.819 0.978 0.394 0.393 1.076 1.077
#> lm 5979.369 0.273 5979.399 0.272 6007.374 0.022 0.394 0.393 1.076 1.077
#> ────────────────────────────────────────────────────────────────────────────────────────────────
#> You can drag and resize the R console to view the entire table
# see ?measurement_invariance for measurement invariance example