Compute indices of model performance for models from the psych package,
and for parameters::factor_analysis() and item_omega().
Usage
# S3 method for class 'fa'
model_performance(model, metrics = "all", verbose = TRUE, ...)Arguments
- model
A model object of class
fa(e.g., frompsych::fa()),principal(e.g., frompsych::principal()), or fromparameters::factor_analysis()oritem_omega().- metrics
Can be
"all"or a character vector of metrics to be computed (some of"Chi2","Chi2_df","df","p_Chi2","RMSA","RMSA_corrected","TLI","RMSEA", and"BIC". For omega-models, can also include"R2"and"Correlation".- verbose
Toggle off warnings.
- ...
Arguments passed to or from other methods.
Details
For omega-models, the columns R2 and Correlation are measures of factor
score adequacy. R2 refers to the multiple R square of scores with factors,
while Correlation indicates the correlation of scores with factors.
Examples
out <- psych::fa(psychTools::bfi[, 1:25], 5)
model_performance(out)
#> # Indices of model performance
#>
#> Chi2(185) | p (Chi2) | RMSA | RMSA_corrected | TLI | RMSEA | RMSEA 90% CI | BIC
#> ---------------------------------------------------------------------------------------
#> 3043.118 | < .001 | 0.029 | 0.037 | 0.674 | 0.074 | [0.072, 0.077] | 1574.7
out <- item_omega(mtcars, n = 3)
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
model_performance(out)
#> # Indices of model performance
#>
#> Model | Chi2 | df | p (Chi2) | RMSA | RMSA_corrected | RMSEA
#> ----------------------------------------------------------------------------
#> 3-factor solution | 69.778 | 25 | < .001 | 0.015 | 0.023 | 0.234
#> g-model | 198.659 | 44 | < .001 | 0.393 | 0.440 | 0.330
#>
#> Model | RMSEA 90% CI | BIC | R2 | Correlation
#> ----------------------------------------------------------------
#> 3-factor solution | [0.175, 0.308] | -16.9 | |
#> g-model | [0.290, 0.385] | 46.2 | 0.761 | 0.873
#>
#> Compare the model fit of the 3-factor solution with the g-only model.
#> If the g-model has smaller RMSA and RMSEA then your items are more
#> likely to describe a single unidimensional construct. If the 3-factor
#> model has smaller RMSA and RMSEA then your construct is more likely to
#> be made up of 3 sub-constructs.
