[Stable]
Compare the fit indices of models (see below for model support)

compare_fit(
  ...,
  digits = 3,
  quite = FALSE,
  streamline = FALSE,
  return_result = FALSE
)

Arguments

...

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().

digits

number of digits to round to

quite

suppress printing output

streamline

print streamlined output

return_result

If it is set to TRUE, it will return the the compare fit data frame.

Value

data frame with fit indices and change in fit indices

Examples

# 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
#> 
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#>                                                                                                                                                                                  value
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#>   compare_fit is temporialy disable due to unknown error caused by insight upgrade from 0.13.2 to 0.14.0. Follow instruction on the package load message to get back all the features.
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

# see ?measurement_invariance for measurement invariance example