CFA: CFA Fit of 'EGA' or 'hierEGA' Structure

View source: R/CFA.R

CFAR Documentation

CFA Fit of EGA or hierEGA Structure

Description

Verifies the fit of the structure suggested by EGA or by hierEGA using confirmatory factor analysis

Usage

CFA(ega.obj, data, estimator, plot.CFA = TRUE, layout = "spring", ...)

Arguments

ega.obj

An EGA object or an hierEGA

data

Matrix or data frame. Should consist only of variables to be used in the analysis

estimator

The estimator used in the confirmatory factor analysis. 'WLSMV' is the estimator of choice for ordinal variables. 'ML' or 'WLS' for interval variables. See lavOptions for more details

plot.CFA

Logical. Should the CFA structure with its standardized loadings be plot? Defaults to TRUE

layout

Layout of plot (see semPaths). Defaults to "spring"

...

Arguments passed to cfa

Value

Returns a list containing:

fit

Output from cfa

summary

Summary output from lavaan-class

fit.measures

Fit measures: chi-squared, degrees of freedom, p-value, CFI, RMSEA, GFI, and NFI. Additional fit measures can be applied using the fitMeasures function (see examples)

Author(s)

Hudson F. Golino <hfg9s at virginia.edu>

References

Demonstrative use
Christensen, A. P., Gross, G. M., Golino, H., Silvia, P. J., & Kwapil, T. R. (2019). Exploratory graph analysis of the Multidimensional Schizotypy Scale. Schizophrenia Research, 206, 43-51.

Initial implementation
Golino, H., & Epskamp, S. (2017). Exploratory graph analysis: A new approach for estimating the number of dimensions in psychological research. PLoS ONE, 12, e0174035.

Examples

# Load data
wmt <- wmt2[,7:24]

## Not run: 
# Estimate EGA
ega.wmt <- EGA(
  data = wmt,
  plot.EGA = FALSE # No plot for CRAN checks
)

# Fit CFA model to EGA results
cfa.wmt <- CFA(
  ega.obj = ega.wmt, estimator = "WLSMV",
  plot.CFA = FALSE, # No plot for CRAN checks
  data = wmt
)

# Additional fit measures
lavaan::fitMeasures(cfa.wmt$fit, fit.measures = "all")
## End(Not run)


EGAnet documentation built on Nov. 18, 2023, 1:07 a.m.