compare_fit: Comparison of Model Fit

View source: R/compare_fit.R

compare_fitR Documentation

Comparison of Model Fit

Description

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

Usage

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

a dataframe with fit indices and change in fit indices

Examples

# lme model

fit1 <- lm_model(
  data = popular,
  response_variable = popular,
  predictor_var = c(sex, extrav)
)

fit2 <- lm_model(
  data = popular,
  response_variable = popular,
  predictor_var = c(sex, extrav),
  two_way_interaction_factor = c(sex, extrav)
)

compare_fit(fit1, fit2)

# see ?measurement_invariance for measurement invariance example

psycModel documentation built on Nov. 2, 2023, 6:02 p.m.