Improving Factor Analysis Diagnostics in R: The lavaanDiag Package
Factor analysis is a powerful tool for examining the dimensionality of psychological scales and other measurement instruments. While several R packages, such as lavaan, facilitate the estimation of latent variable models, they often lack essential diagnostic tools for assessing key assumptions of the measurement model. Ignoring these assumptions can lead to misleading conclusions. For instance, poor global model fit may result from nonlinear relationships between a factor and its indicators, even when the items are fundamentally unidimensional. To address this gap, we developed the lavaanDiag package, which streamlines the diagnostic process for factor models estimated in lavaan. This package provides functions to visualize residual correlations, examine relationships between latent variable estimates, and compare model-implied and empirical factor-indicator relationships. By offering these tools, lavaanDiag enhances model evaluation and improves the validity of factor analytic research.