Package {EFAtools}


Title: Fast and Flexible Implementations of Exploratory Factor Analysis Tools
Version: 0.8.0
Description: Provides functions to perform exploratory factor analysis (EFA) procedures and compare their solutions. The goal is to provide state-of-the-art factor retention methods and a high degree of flexibility in the EFA procedures. This way, for example, implementations from R 'psych' and 'SPSS' can be compared. Moreover, functions for Schmid-Leiman transformation and the computation of omegas are provided. To speed up the analyses, some of the iterative procedures, like principal axis factoring (PAF), are implemented in C++.
Depends: R (≥ 4.1.0)
License: GPL-3
Encoding: UTF-8
LazyData: true
URL: https://github.com/mdsteiner/EFAtools
BugReports: https://github.com/mdsteiner/EFAtools/issues
Imports: psych, stats, ggplot2 (≥ 3.4.0), cli, Rcpp, future.apply, future, checkmate, progressr, rlang, clue
LinkingTo: Rcpp, RcppArmadillo, roptim
Suggests: testthat (≥ 3.0.0), GPArotation (≥ 2022.4-1), lavaan, lavaan.mi, MASS, knitr, rmarkdown, microbenchmark, vdiffr, polycor, mnormt, fungible, withr
VignetteBuilder: knitr
Config/testthat/edition: 3
Config/roxygen2/version: 8.0.0
NeedsCompilation: yes
Packaged: 2026-07-07 08:31:44 UTC; ma1159938
Author: Markus Steiner ORCID iD [aut, cre], Silvia Steiner ORCID iD [aut], William Revelle [ctb], Max Auerswald [ctb], Morten Moshagen [ctb], John Ruscio [ctb], Brendan Roche [ctb], Urbano Lorenzo-Seva [ctb], David Navarro-Gonzalez [ctb], Johan Braeken [ctb], Andreas Soteriades [ctb]
Maintainer: Markus Steiner <markus.d.steiner@gmail.com>
Repository: CRAN
Date/Publication: 2026-07-07 09:20:02 UTC

EFAtools: Fast and Flexible Implementations of Exploratory Factor Analysis Tools

Description

Provides functions to perform exploratory factor analysis (EFA) procedures and compare their solutions. The goal is to provide state-of-the-art factor retention methods and a high degree of flexibility in the EFA procedures. This way, for example, implementations from R 'psych' and 'SPSS' can be compared. Moreover, functions for Schmid-Leiman transformation and the computation of omegas are provided. To speed up the analyses, some of the iterative procedures, like principal axis factoring (PAF), are implemented in C++.

Author(s)

Maintainer: Markus Steiner markus.d.steiner@gmail.com (ORCID)

Authors:

Other contributors:

See Also

Useful links:


Average a list of matrices elementwise

Description

Average a list of matrices elementwise

Usage

.average_matrices(x)

Arguments

x

List of conformable matrices.

Value

A matrix with the same dimensions as the inputs.


Covert a "LOADINGS" table to matrix or a matrix to "LOADINGS"

Description

Covert a "LOADINGS" table to matrix or a matrix to "LOADINGS"

Usage

.change_class(x, cl = "matrix")

Arguments

x

A table of class "matrix" or "LOADINGS".

cl

A string with the class to change the table to. Should be "LOADINGS" or "matrix".

Value

A table with the loadings, of class either "LOADINGS" or "matrix".

Author(s)

Andreas Soteriades

The loadings tables returned by EFA() are of class "LOADINGS", which prevents applying functions on them. This function allows to change their class to "matrix", and to change back to "LOADINGS" when done.


Compute explained variances from loadings

Description

From unrotated loadings compute the communalities and uniquenesses for total variance. Compute explained variances per factor from rotated loadings (and factor intercorrelations Phi if oblique rotation was used).

Usage

.compute_vars(L_unrot, L_rot, Phi = NULL)

Arguments

L_unrot

matrix. Unrotated factor loadings.

L_rot

matrix. Rotated factor loadings.

Phi

matrix. Factor intercorrelations. Provide only if oblique rotation is used.

Value

A matrix with sum of squared loadings, proportion explained variance from total variance per factor, same as previous but cumulative, Proportion of explained variance from total explained variance, and same as previous but cumulative.


Mean squared discrepancy to a consensus target

Description

Mean squared discrepancy to a consensus target

Usage

.consensus_loss(aligned_loadings, target)

Arguments

aligned_loadings

List of aligned loading matrices.

target

Consensus target matrix.

Value

Mean sum of squared deviations from the target across matrices.


Internal single-start GPA-consensus engine

Description

Performs a single GPA-consensus run from one starting target. The multi-start wrapper .gpa_consensus_target() dispatches here.

Usage

.consensus_target_procrustes_single(
  unrotated_list,
  init_targets = NULL,
  rotation = c("orthogonal", "oblique"),
  start = 1,
  tol = 0.001,
  loss_tol = 1e-07,
  loss_patience = 5,
  convergence = c("either", "target", "loss", "both"),
  min_iter = 2,
  max_iter = 200,
  alpha = 1,
  match_target = TRUE,
  hyper_cutoff = 0.15,
  verbose = FALSE
)

Arguments

unrotated_list

List of unrotated loading matrices to be aligned. All matrices must be numeric, finite, and have identical dimensions.

init_targets

Optional list of starting target matrices. These are typically rotated loading matrices from the corresponding analyses. If NULL, unrotated_list is used.

rotation

Character string, either "orthogonal" or "oblique".

start

Either a single integer selecting an element of init_targets, or an explicit target matrix. Used when multi_start = FALSE.

tol

Positive relative Frobenius-norm convergence tolerance for the outer target update.

loss_tol

Positive tolerance for the relative change in the outer consensus loss. If NULL, loss-based convergence is disabled. It cannot be NULL when convergence is "loss" or "both".

loss_patience

Positive integer. Number of consecutive iterations with relative loss change below loss_tol required for loss-based convergence.

convergence

Character string controlling the stopping rule. "either" stops when either target or loss convergence is satisfied; "target" uses only target change; "loss" uses only loss change; "both" requires both.

min_iter

Non-negative integer. Minimum number of outer iterations before convergence can be declared.

max_iter

Positive integer. Maximum number of outer consensus iterations.

alpha

Damping factor for the target update. alpha = 1 uses the full centroid update. Smaller values, such as 0.5, can reduce oscillation.

match_target

Logical. If TRUE, the updated centroid is signed and column-matched to the previous target before convergence is evaluated.

hyper_cutoff

Non-negative cutoff used by .hyperplane_count() for summary output.

verbose

Logical; if TRUE, print convergence messages for the outer loop.


Extract a list object by its name

Description

Extract a list object by its name

Usage

.extract_list_object(alist, object)

Arguments

alist

A list of sub-lists, typically a list of m objects of class "EFA", where m is the number of imputations passed to EFA_POOLED().

object

String of length 1. The name of the object to extract e.g. "h2" or "vars_accounted".

Value

A list of length m, with each element containing the extracted object for the kth element (k = 1,..., m).

Author(s)

Andreas Soteriades

Consider a list of named sub-lists. This function extracts, for each sub-list, the sub-list element that is specified by the user. This function is useful for extracting results from EFA() for each permutation run in EFA_POOLED().


Compute number of non-matching indicator-to-factor correspondences

Description

Compute number of non-matching indicator-to-factor correspondences

Usage

.factor_corres(x, y, thresh = 0.3)

Arguments

x

numeric matrix. A matrix of pattern coefficients.

y

numeric matrix. A second matrix of coefficients.

thresh

numeric. The threshold to classify a pattern coefficient as substantial.


Generalized Procrustes Analysis consensus target across loading matrices

Description

Internal helper that constructs a Generalized Procrustes Analysis (GPA) consensus target across a list of loading matrices and returns the aligned loadings, the centroid target, and convergence diagnostics. Used by EFA_POOLED() under target_method = "consensus" to build a common rotation target across imputations. Oblique rotations are not supported here: the iteration is degenerate for oblique transforms with more than one factor (cf. Lorenzo-Seva & Van Ginkel 2016, who use a Promin step on top of the centroid rather than iterated oblique Procrustes); callers should pass the unrotated solutions of an orthogonal rotation, or use target_method = "first_target".

Usage

.gpa_consensus_target(
  unrotated_list,
  init_targets = NULL,
  rotation = c("orthogonal", "oblique"),
  start = 1,
  multi_start = FALSE,
  starts = NULL,
  tol = 0.001,
  loss_tol = 1e-06,
  loss_patience = 5,
  convergence = c("either", "target", "loss", "both"),
  min_iter = 2,
  max_iter = 200,
  alpha = 1,
  match_target = TRUE,
  hyper_cutoff = 0.15,
  verbose = FALSE
)

Arguments

unrotated_list

List of unrotated loading matrices to be aligned. All matrices must be numeric, finite, and have identical dimensions.

init_targets

Optional list of starting target matrices. These are typically rotated loading matrices from the corresponding analyses. If NULL, unrotated_list is used.

rotation

Character string, either "orthogonal" or "oblique".

start

Either a single integer selecting an element of init_targets, or an explicit target matrix. Used when multi_start = FALSE.

multi_start

Logical. If FALSE, perform one consensus-target run. If TRUE, repeat the single-start algorithm for each element of starts.

starts

Integer vector selecting elements of init_targets used as starting targets when multi_start = TRUE. If NULL, all elements of init_targets are used. Duplicate entries are removed.

tol

Positive relative Frobenius-norm convergence tolerance for the outer target update.

loss_tol

Positive tolerance for the relative change in the outer consensus loss. If NULL, loss-based convergence is disabled. It cannot be NULL when convergence is "loss" or "both".

loss_patience

Positive integer. Number of consecutive iterations with relative loss change below loss_tol required for loss-based convergence.

convergence

Character string controlling the stopping rule. "either" stops when either target or loss convergence is satisfied; "target" uses only target change; "loss" uses only loss change; "both" requires both.

min_iter

Non-negative integer. Minimum number of outer iterations before convergence can be declared.

max_iter

Positive integer. Maximum number of outer consensus iterations.

alpha

Damping factor for the target update. alpha = 1 uses the full centroid update. Smaller values, such as 0.5, can reduce oscillation.

match_target

Logical. If TRUE, the updated centroid is signed and column-matched to the previous target before convergence is evaluated.

hyper_cutoff

Non-negative cutoff used by .hyperplane_count() for summary output.

verbose

Logical; if TRUE, print convergence messages for the outer loop.

Details

The iteration alternates two steps:

  1. each loading matrix is aligned to the current target with PROCRUSTES();

  2. the target is updated to the elementwise centroid of the aligned matrices.

The outer loop stops when the target stabilises, when the consensus loss stabilises, or when both criteria are satisfied.

If multi_start = FALSE, one consensus run is performed. If multi_start = TRUE, the same engine is repeated for the selected starting targets and the run with the smallest final mean loss is returned as the main result; all runs and a between-run congruence summary are retained in the multi_start component.

Value

A list with the converged target, aligned matrices, pooled loadings, pooled Phi, convergence history, inner-alignment diagnostics, and hyperplane summaries. If multi_start = TRUE, the multi_start element also contains the per-start losses, convergence indicators, run summaries, all run objects, and between-run Tucker congruence matrices.

References

Gower, J. C. (1975). Generalized Procrustes analysis. Psychometrika, 40, 33-51.

Van Ginkel, J. R., & Kroonenberg, P. M. (2014). Using Generalized Procrustes Analysis for Multiple Imputation in Principal Component Analysis. Journal of Classification, 31, 242-269.

Lorenzo-Seva, U., & Van Ginkel, J. R. (2016). Multiple Imputation of missing values in exploratory factor analysis of multidimensional scales: estimating latent trait scores. Anales de Psicologia, 32, 596-608.


Count near-zero loadings

Description

Hyperplane count is the number of loadings with absolute value smaller than a user-specified cutoff.

Usage

.hyperplane_count(L, cutoff = 0.15)

Arguments

L

Numeric loading matrix.

cutoff

Numeric scalar. Loadings with abs(L) < cutoff are counted as being in the hyperplane.

Value

A list with the total hyperplane count and counts by factor and item.


Oblique Procrustes target rotation using a k x k inner objective

Description

Compute an oblique target rotation for a loading matrix using a targetQ-compatible parameterization and a ⁠k x k⁠ objective.

Usage

.oblique_procrustes(
  A,
  B,
  S_r = NULL,
  T_init_r = NULL,
  eps = 1e-05,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  normalize = FALSE,
  random_starts = 0L,
  screen_keep = 2L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

A

Numeric matrix. Loading matrix to be rotated.

B

Numeric matrix. Target loading matrix with the same dimensions as A.

S_r

Optional numeric ⁠k x k⁠ matrix containing crossprod(A). Supplying this is useful when the same A is rotated repeatedly. Ignored when normalize = TRUE because the normalized cross-product is different.

T_init_r

Optional numeric ⁠k x k⁠ starting transformation matrix. If NULL, the identity matrix is used for the primary start.

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

maxit

Integer scalar. Maximum number of full projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

normalize

Logical scalar. If TRUE, apply Kaiser normalization to the loadings (only) before rotation and reverse it afterwards; the target is left unnormalized, matching GPArotation::targetQ(normalize = TRUE).

random_starts

Integer scalar. Number of additional random starts.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

The rotated loading matrix is defined as L = A %*% solve(t(T)), and the corresponding factor correlation matrix is Phi = t(T) %*% T. The optimization is carried out over the transformation matrix T under the oblique normalization constraint diag(t(T) %*% T) = 1.

Non-invertible candidate transformations are rejected rather than evaluated through a pseudo-inverse.

Additional random starts may be requested. To reduce runtime, the solver uses a two-stage strategy for extra starts: cheap objective screening, followed by short triage optimization, followed by full optimization only for starts that improve on the current incumbent by at least triage_improve_tol.

The routine is intended for repeated oblique target rotations in workflows such as bootstrap alignment or consensus alignment of exploratory factor solutions across multiply imputed datasets. It follows the same oblique transformation convention as GPArotation::targetQ().

Value

A named list containing the rotated loadings, transformation matrix, factor correlation matrix, target criterion value, convergence diagnostics, line-search diagnostics, and multi-start summaries.

References

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.

Browne, M. W. (2001). An overview of analytic rotation in exploratory factor analysis. Multivariate Behavioral Research, 36, 111-150.


Batched oblique Procrustes target rotation over a cube of loading matrices

Description

Align each slice of a loading-matrix cube to a single shared target using the same oblique target rotation as .oblique_procrustes(), in one call. This removes the per-replicate marshalling overhead of looping PROCRUSTES() in R over bootstrap or multiple-imputation arrays.

Usage

.oblique_procrustes_batch(
  A,
  B,
  eps = 1e-05,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  normalize = FALSE,
  random_starts = 0L,
  screen_keep = 2L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

A

Numeric array of dimension ⁠n x m x b⁠: the b loading matrices to align.

B

Numeric ⁠n x m⁠ target loading matrix shared across all slices.

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

maxit

Integer scalar. Maximum number of full projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

normalize

Logical scalar. If TRUE, apply Kaiser normalization to the loadings (only) before rotation and reverse it afterwards, leaving the target unnormalized (ignored for single-factor slices).

random_starts

Integer scalar. Number of additional random starts per slice.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

Each slice A[, , i] is aligned to B. For a single-factor cube the alignment reduces to the closed-form sign match T = sign(crossprod(A_i, B)) with factor correlation 1, matching the one-factor short-circuit in PROCRUSTES(). For two or more factors the slice is warm-started from the closed-form orthogonal Procrustes solution (mirroring PROCRUSTES()) and optimized with the same multi-start oblique solver as .oblique_procrustes(). Random starts are drawn serially with R::rnorm in the calling process.

Slices are aligned independently. A slice that cannot be aligned (a non-finite loading matrix, a failed warm-start decomposition, an invalid fit, or any linear-algebra exception) is reported with valid = FALSE and NA for the loadings, factor correlations, and all other per-slice diagnostics, rather than aborting the whole call, so one degenerate replicate does not discard the rest.

Value

A named list with the aligned-loadings array loadings (⁠n x m x b⁠), the factor-correlation array Phi (⁠m x m x b⁠), and the per-slice diagnostics valid, convergence, value, iterations, and line_search_failed.


Closed-form orthogonal Procrustes rotation

Description

Rotate A to the orthogonal target B by minimizing ⁠||A %*% T - B||_F^2⁠ subject to t(T) %*% T = I.

Usage

.orthogonal_procrustes(A, B)

Arguments

A

Numeric matrix to be rotated.

B

Numeric target matrix with the same dimensions as A.

Value

A list with the rotated loadings, orthogonal transformation matrix, target criterion value, and basic diagnostics.

References

Schoenemann, P. H. (1966). A generalized solution of the orthogonal Procrustes problem. Psychometrika, 31, 1-10.


Perform the iterative PAF procedure

Description

Function called from within PAF so usually no call to this is needed by the user. Provides a C++ implementation of the PAF procedure

Usage

.paf_iter(h2, criterion, R, n_fac, abs_eig, crit_type, max_iter)

Arguments

h2

numeric. The initial communality estimates.

criterion

double. The convergence criterion to use.

R

matrix. The correlation matrix with the initial communality estimates in the diagonal.

n_fac

numeric. The number of factors to extract.

abs_eig

logical. Whether absolute eigenvalues should be used to compute the loadings.

crit_type

numeric. Whether maximum absolute differences (crit_type = 1), or sum of differences (crit_type = 2) should be used

max_iter

numeric. The number of iterations after which to end the procedure if no convergence has been reached by then.


Parallel analysis on simulated data.

Description

Function called from within PARALLEL so usually no call to this is needed by the user. Provides a C++ implementation of the PARALLEL simulation procedure

Usage

.parallel_sim(n_datasets, n_vars, N, eigen_type, maxit = 10000L)

Arguments

n_datasets

numeric. Number of datasets with dimensions (N, n_vars) to simulate.

n_vars

numeric. Number of variables / indicators in dataset.

N

numeric. Number of cases / observations in dataset.

eigen_type

numeric. Whether PCA (eigen_type = 1; i.e., leaving diagonal of correlation matrix at 1) or SMC (eigen_type = 2; i.e., setting diagonal of correlation matrix to SMCs).

maxit

numeric. Maximum iterations to perform after which to abort.


Oblique Bentler factor rotation

Description

Rotate a loading matrix obliquely under Bentler's invariant pattern simplicity criterion using a gradient-projection optimizer along the oblique (column-normalized) manifold.

Usage

.rotate_bentler_oblq(
  L,
  eps = 1e-05,
  normalize = TRUE,
  random_starts = 0L,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  screen_keep = 5L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

L

Numeric matrix. The unrotated loading matrix (variables by factors).

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

normalize

Logical scalar. If TRUE, apply Kaiser normalization before rotation and reverse it afterwards.

random_starts

Integer scalar. Number of additional random starts.

maxit

Integer scalar. Maximum number of projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

The criterion value f and its gradient dQ/dL at the rotated loadings L = A %*% solve(t(T)) define the search; the engine maps the gradient to the transformation T on the manifold diag(t(T) %*% T) = 1, projects it onto the tangent space, performs a non-monotone line search, and retracts back onto the manifold by column normalization. The Bentler criterion measures the departure of the cross-products of squared loadings from a diagonal pattern; it is prone to local minima, so additional random starts are recommended.

Additional random starts may be requested. To bound runtime the solver screens each random start by its objective, runs a short triage optimization on the best-screened starts, and fully optimizes only those that improve on the current incumbent by at least triage_improve_tol.

Value

A named list with the rotated loadings, the transformation matrix Th (with L %*% t(solve(Th)) reproducing the rotated loadings), the factor correlation matrix Phi (t(Th) %*% Th), the attained criterion value, and the convergence and validity flags. The list additionally reports the criterion value reached at each optimized start in all_values, with a per-start convergence flag in all_converged.

References

Bentler, P. M. (1977). Factor simplicity index and transformations. Psychometrika, 42, 277-295.

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.


Orthogonal Bentler factor rotation

Description

Rotate a loading matrix orthogonally under Bentler's invariant pattern simplicity criterion using a gradient-projection optimizer along the orthogonal (Stiefel) manifold.

Usage

.rotate_bentler_orth(
  L,
  eps = 1e-05,
  normalize = TRUE,
  random_starts = 0L,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  screen_keep = 5L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

L

Numeric matrix. The unrotated loading matrix (variables by factors).

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

normalize

Logical scalar. If TRUE, apply Kaiser normalization before rotation and reverse it afterwards.

random_starts

Integer scalar. Number of additional random orthogonal starts.

maxit

Integer scalar. Maximum number of projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

The criterion value f and its gradient dQ/dL at the rotated loadings L = A %*% T define the search; the engine maps the gradient to the orthogonal transformation T, projects it onto the tangent space, performs a non-monotone line search, and retracts back onto the orthogonal group via a polar (singular value) projection. The Bentler criterion measures the departure of the cross-products of squared loadings from a diagonal pattern; it is prone to local minima, so additional random starts are recommended.

Additional random orthogonal starts may be requested. To bound runtime the solver screens each random start by its objective, runs a short triage optimization on the best-screened starts, and fully optimizes only those that improve on the current incumbent by at least triage_improve_tol.

Value

A named list with the rotated loadings, the orthogonal rotation matrix Th (with L %*% Th reproducing the rotated loadings), the attained criterion value, and the convergence and validity flags. The list additionally reports the criterion value reached at each optimized start in all_values, with a per-start convergence flag in all_converged.

References

Bentler, P. M. (1977). Factor simplicity index and transformations. Psychometrika, 42, 277-295.

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.


Oblique bifactor factor rotation

Description

Rotate a loading matrix obliquely under the Jennrich-Bentler bifactor criterion using a gradient-projection optimizer along the oblique (column-normalized) manifold.

Usage

.rotate_bifactor_oblq(
  L,
  eps = 1e-05,
  normalize = TRUE,
  random_starts = 0L,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  screen_keep = 5L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

L

Numeric matrix. The unrotated loading matrix (variables by factors).

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

normalize

Logical scalar. If TRUE, apply Kaiser normalization before rotation and reverse it afterwards.

random_starts

Integer scalar. Number of additional random starts.

maxit

Integer scalar. Maximum number of projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

The criterion value f and its gradient dQ/dL at the rotated loadings L = A %*% solve(t(T)) define the search; the engine maps the gradient to the transformation T on the manifold diag(t(T) %*% T) = 1, projects it onto the tangent space, performs a non-monotone line search, and retracts back onto the manifold by column normalization. The first factor is treated as a general factor and is exempt from the penalty; the criterion measures the between-group-factor cross-products of the squared loadings, so it is minimized when each variable loads on the general factor plus at most one group factor. The criterion is prone to local minima, so additional random starts are recommended.

Additional random starts may be requested. To bound runtime the solver screens each random start by its objective, runs a short triage optimization on the best-screened starts, and fully optimizes only those that improve on the current incumbent by at least triage_improve_tol.

Value

A named list with the rotated loadings, the transformation matrix Th (with L %*% t(solve(Th)) reproducing the rotated loadings), the factor correlation matrix Phi (t(Th) %*% Th), the attained criterion value, and the convergence and validity flags. The list additionally reports the criterion value reached at each optimized start in all_values, with a per-start convergence flag in all_converged.

References

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.

Jennrich, R. I., & Bentler, P. M. (2011). Exploratory bi-factor analysis. Psychometrika, 76, 537-549.


Orthogonal bifactor factor rotation

Description

Rotate a loading matrix orthogonally under the Jennrich-Bentler bifactor criterion using a gradient-projection optimizer along the orthogonal (Stiefel) manifold.

Usage

.rotate_bifactor_orth(
  L,
  eps = 1e-05,
  normalize = TRUE,
  random_starts = 0L,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  screen_keep = 5L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

L

Numeric matrix. The unrotated loading matrix (variables by factors).

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

normalize

Logical scalar. If TRUE, apply Kaiser normalization before rotation and reverse it afterwards.

random_starts

Integer scalar. Number of additional random orthogonal starts.

maxit

Integer scalar. Maximum number of projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

The criterion value f and its gradient dQ/dL at the rotated loadings L = A %*% T define the search; the engine maps the gradient to the orthogonal transformation T, projects it onto the tangent space, performs a non-monotone line search, and retracts back onto the orthogonal group via a polar (singular value) projection. The first factor is treated as a general factor and is exempt from the penalty; the criterion measures the between-group-factor cross-products of the squared loadings, so it is minimized when each variable loads on the general factor plus at most one group factor. The criterion is prone to local minima, so additional random starts are recommended.

Additional random orthogonal starts may be requested. To bound runtime the solver screens each random start by its objective, runs a short triage optimization on the best-screened starts, and fully optimizes only those that improve on the current incumbent by at least triage_improve_tol.

Value

A named list with the rotated loadings, the orthogonal rotation matrix Th (with L %*% Th reproducing the rotated loadings), the attained criterion value, and the convergence and validity flags. The list additionally reports the criterion value reached at each optimized start in all_values, with a per-start convergence flag in all_converged.

References

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.

Jennrich, R. I., & Bentler, P. M. (2011). Exploratory bi-factor analysis. Psychometrika, 76, 537-549.


Orthogonal Crawford-Ferguson factor rotation

Description

Rotate a loading matrix orthogonally under the Crawford-Ferguson criterion using a gradient-projection optimizer along the orthogonal (Stiefel) manifold.

Usage

.rotate_cf_orth(
  L,
  kappa,
  eps = 1e-05,
  normalize = TRUE,
  random_starts = 0L,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  screen_keep = 5L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

L

Numeric matrix. The unrotated loading matrix (variables by factors).

kappa

Numeric scalar in ⁠[0, 1]⁠. The Crawford-Ferguson parameter.

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

normalize

Logical scalar. If TRUE, apply Kaiser normalization before rotation and reverse it afterwards.

random_starts

Integer scalar. Number of additional random orthogonal starts.

maxit

Integer scalar. Maximum number of projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

The criterion value f and its gradient dQ/dL at the rotated loadings L = A %*% T define the search; the engine maps the gradient to the orthogonal transformation T, projects it onto the tangent space, performs a non-monotone line search, and retracts back onto the orthogonal group via a polar (singular value) projection. kappa = 0 is the quartimax criterion and kappa = ncol(A) / (2 * nrow(A)) is the equamax criterion.

Additional random orthogonal starts may be requested. To bound runtime the solver screens each random start by its objective, runs a short triage optimization on the best-screened starts, and fully optimizes only those that improve on the current incumbent by at least triage_improve_tol.

Value

A named list with the rotated loadings, the orthogonal rotation matrix Th (with L %*% Th reproducing the rotated loadings), the attained criterion value, and the convergence and validity flags. The list additionally reports the criterion value reached at each optimized start in all_values, with a per-start convergence flag in all_converged.

References

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.

Crawford, C. B., & Ferguson, G. A. (1970). A general rotation criterion and its use in orthogonal rotation. Psychometrika, 35, 321-332.


Oblique geomin factor rotation

Description

Rotate a loading matrix obliquely under the geomin criterion using a gradient-projection optimizer along the oblique (column-normalized) manifold.

Usage

.rotate_geomin_oblq(
  L,
  delta = 0.01,
  eps = 1e-05,
  normalize = TRUE,
  random_starts = 0L,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  screen_keep = 5L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

L

Numeric matrix. The unrotated loading matrix (variables by factors).

delta

Numeric scalar. The geomin offset added to the squared loadings; must be a positive finite scalar. delta = 0.01 is the usual default.

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

normalize

Logical scalar. If TRUE, apply Kaiser normalization before rotation and reverse it afterwards.

random_starts

Integer scalar. Number of additional random starts.

maxit

Integer scalar. Maximum number of projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

The criterion value f and its gradient dQ/dL at the rotated loadings L = A %*% solve(t(T)) define the search; the engine maps the gradient to the transformation T on the manifold diag(t(T) %*% T) = 1, projects it onto the tangent space, performs a non-monotone line search, and retracts back onto the manifold by column normalization. The geomin criterion sums the per-variable geometric mean of the squared loadings offset by delta; it is prone to local minima, so additional random starts are recommended.

Additional random starts may be requested. To bound runtime the solver screens each random start by its objective, runs a short triage optimization on the best-screened starts, and fully optimizes only those that improve on the current incumbent by at least triage_improve_tol.

Value

A named list with the rotated loadings, the transformation matrix Th (with L %*% t(solve(Th)) reproducing the rotated loadings), the factor correlation matrix Phi (t(Th) %*% Th), the attained criterion value, and the convergence and validity flags. The list additionally reports the criterion value reached at each optimized start in all_values, with a per-start convergence flag in all_converged.

References

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.

Browne, M. W. (2001). An overview of analytic rotation in exploratory factor analysis. Multivariate Behavioral Research, 36, 111-150.


Orthogonal geomin factor rotation

Description

Rotate a loading matrix orthogonally under the geomin criterion using a gradient-projection optimizer along the orthogonal (Stiefel) manifold.

Usage

.rotate_geomin_orth(
  L,
  delta = 0.01,
  eps = 1e-05,
  normalize = TRUE,
  random_starts = 0L,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  screen_keep = 5L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

L

Numeric matrix. The unrotated loading matrix (variables by factors).

delta

Numeric scalar. The geomin offset added to the squared loadings; must be a positive finite scalar. delta = 0.01 is the usual default.

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

normalize

Logical scalar. If TRUE, apply Kaiser normalization before rotation and reverse it afterwards.

random_starts

Integer scalar. Number of additional random orthogonal starts.

maxit

Integer scalar. Maximum number of projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

The criterion value f and its gradient dQ/dL at the rotated loadings L = A %*% T define the search; the engine maps the gradient to the orthogonal transformation T, projects it onto the tangent space, performs a non-monotone line search, and retracts back onto the orthogonal group via a polar (singular value) projection. The geomin criterion sums the per-variable geometric mean of the squared loadings offset by delta; it is prone to local minima, so additional random starts are recommended.

Additional random orthogonal starts may be requested. To bound runtime the solver screens each random start by its objective, runs a short triage optimization on the best-screened starts, and fully optimizes only those that improve on the current incumbent by at least triage_improve_tol.

Value

A named list with the rotated loadings, the orthogonal rotation matrix Th (with L %*% Th reproducing the rotated loadings), the attained criterion value, and the convergence and validity flags. The list additionally reports the criterion value reached at each optimized start in all_values, with a per-start convergence flag in all_converged.

References

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.

Browne, M. W. (2001). An overview of analytic rotation in exploratory factor analysis. Multivariate Behavioral Research, 36, 111-150.


Oblique oblimin factor rotation

Description

Rotate a loading matrix obliquely under the oblimin criterion using a gradient-projection optimizer along the oblique (column-normalized) manifold.

Usage

.rotate_oblimin(
  L,
  gam = 0,
  eps = 1e-05,
  normalize = TRUE,
  random_starts = 0L,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1,
  screen_keep = 5L,
  triage_maxit = 25L,
  triage_improve_tol = 0
)

Arguments

L

Numeric matrix. The unrotated loading matrix (variables by factors).

gam

Numeric scalar. The oblimin parameter; gam = 0 is the quartimin criterion.

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm.

normalize

Logical scalar. If TRUE, apply Kaiser normalization before rotation and reverse it afterwards.

random_starts

Integer scalar. Number of additional random starts.

maxit

Integer scalar. Maximum number of projected-gradient updates.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

screen_keep

Integer scalar. Number of screened random starts retained for triage optimization.

triage_maxit

Integer scalar. Number of short optimization iterations used in the triage stage.

triage_improve_tol

Numeric scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

The criterion value f and its gradient dQ/dL at the rotated loadings L = A %*% solve(t(T)) define the search; the engine maps the gradient to the transformation T on the manifold diag(t(T) %*% T) = 1, projects it onto the tangent space, performs a non-monotone line search, and retracts back onto the manifold by column normalization. gam = 0 is the quartimin criterion.

Additional random starts may be requested. To bound runtime the solver screens each random start by its objective, runs a short triage optimization on the best-screened starts, and fully optimizes only those that improve on the current incumbent by at least triage_improve_tol.

Value

A named list with the rotated loadings, the transformation matrix Th (with L %*% t(solve(Th)) reproducing the rotated loadings), the factor correlation matrix Phi (t(Th) %*% Th), the attained criterion value, and the convergence and validity flags. The list additionally reports the criterion value reached at each optimized start in all_values, with a per-start convergence flag in all_converged.

References

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.

Jennrich, R. I., & Sampson, P. F. (1966). Rotation for simple loadings. Psychometrika, 31, 313-323.


Oblique simplimax factor rotation

Description

Rotate a loading matrix obliquely under the simplimax criterion using a gradient-projection optimizer along the oblique (column-normalized) manifold.

Usage

.rotate_simplimax_oblq(
  L,
  k,
  eps = 1e-05,
  normalize = TRUE,
  random_starts = 0L,
  maxit = 1000L,
  max_line_search = 10L,
  step0 = 1
)

Arguments

L

Numeric matrix. The unrotated loading matrix (variables by factors).

k

Integer scalar. The number of "close-to-zero" loadings the criterion targets; must be in ⁠[1, nrow(L) * ncol(L)]⁠. k = nrow(L) is the usual default.

eps

Numeric scalar. Convergence tolerance for the projected-gradient norm. Because the simplimax criterion is only piecewise smooth, the projected gradient need not reach this tolerance at the optimum; convergence is then reported when the criterion value stalls (the non-monotone search described above), so eps mainly governs the smooth phases of the search.

normalize

Logical scalar. If TRUE, apply Kaiser normalization before rotation and reverse it afterwards.

random_starts

Integer scalar. Number of random orthogonal starts fully optimized in addition to the identity start.

maxit

Integer scalar. Maximum number of projected-gradient updates per start.

max_line_search

Integer scalar. Maximum number of step-halving attempts after the initial trial step in each line-search phase.

step0

Numeric scalar. Initial step size used in the projected-gradient update.

Details

The criterion value f and its gradient dQ/dL at the rotated loadings L = A %*% solve(t(T)) define the search; the engine maps the gradient to the transformation T on the manifold diag(t(T) %*% T) = 1, projects it onto the tangent space, performs a non-monotone line search, and retracts back onto the manifold by column normalization. The simplimax criterion sums the k smallest squared loadings, so it is minimized when the k "close-to-zero" loadings are driven toward zero; the count k is a tuning parameter. Because the set of k smallest loadings is reselected at every evaluation, the criterion is only piecewise smooth: its gradient jumps as loadings cross the kth-smallest threshold, so the line search accepts a step whenever it decreases the largest objective over a short window of recent iterations (a non-monotone test; Grippo, Lampariello, & Lucidi, 1986), letting the optimizer step across the kinks where a strictly monotone descent would stall.

The criterion is strongly prone to local minima, so the solver fully optimizes the identity start together with random_starts random orthogonal starts and keeps the solution with the lowest criterion value. Fully optimizing every start – rather than the screen-and-triage strategy used for the smooth criteria, which assumes the rational start lies in the global basin – is the standard remedy for the local minima of complexity-based rotation criteria (Kiers, 1994; Browne, 2001).

Value

A named list with the rotated loadings, the transformation matrix Th (with L %*% t(solve(Th)) reproducing the rotated loadings), the factor correlation matrix Phi (t(Th) %*% Th), the attained criterion value, and the convergence and validity flags. The list additionally reports the criterion value reached at each optimized start in all_values, with a per-start convergence flag in all_converged.

References

Bernaards, C. A., & Jennrich, R. I. (2005). Gradient projection algorithms and software for arbitrary rotation criteria in factor analysis. Educational and Psychological Measurement, 65, 676-696.

Browne, M. W. (2001). An overview of analytic rotation in exploratory factor analysis. Multivariate Behavioral Research, 36, 111-150.

Grippo, L., Lampariello, F., & Lucidi, S. (1986). A nonmonotone line search technique for Newton's method. SIAM Journal on Numerical Analysis, 23, 707-716.

Kiers, H. A. L. (1994). Simplimax: Oblique rotation to an optimal target with simple structure. Psychometrika, 59, 567-579.


Rotation Jacobians for analytic rotation standard errors

Description

Forward-difference the warm-started re-rotation map ⁠A -> (rotated loadings, Phi)⁠ over the unrotated loadings A to obtain the rotation Jacobians used by the analytic standard errors for rotated loadings (se = "information" in EFA()). The full nrow(A) * ncol(A) finite- difference loop runs in compiled code, re-solving the rotation from the converged transformation T_init at each perturbation; the caller forms ⁠J V J'⁠ in R.

Usage

.rotation_se_jacobian(
  A,
  T_init,
  method,
  param,
  normalize,
  oblique,
  eps,
  general_col = 0L
)

Arguments

A

Numeric matrix. The unrotated loading matrix at the solution.

T_init

Numeric matrix. The converged transformation that warm-starts each re-rotation.

method

Character scalar. The criterion family: one of "cf", "oblimin", "geomin", "bentler", "bifactor".

param

Numeric scalar. The criterion's tuning argument (kappa for "cf", gam for "oblimin", delta for "geomin"); ignored for "bentler" and "bifactor".

normalize

Logical scalar. Apply Kaiser normalization before rotation and reverse it after.

oblique

Logical scalar. Use the oblique (column-normalized) manifold; otherwise orthogonal.

eps

Numeric scalar. The forward-difference step on the loadings.

general_col

Integer scalar. For method = "bifactor", the zero-based column holding the general factor in the (factor-reordered) reported solution; ignored by the other criteria.

Value

A named list with the Jacobian J_L (⁠pk x pk⁠), the re-rotated base_loadings, a validity flag, and – when oblique – the Jacobian J_Phi (⁠k^2 x pk⁠) and base_Phi.

References

Jennrich, R. I. (1973). Standard errors for obliquely rotated factor loadings. Psychometrika, 38, 593-604.


Reference eigenvalues for the NEST simulation via the shared kernel.

Description

Internal helper called from NEST(). Simulates nreps datasets from an (nf - 1)-factor reference model, given that model's loadings Lambda and uniquenesses Psi, and returns the nf-th largest eigenvalue of each simulated correlation matrix. The data are drawn with the shared Z * M rule (see .simulate_cfm_mvn()) using the factor-score square root ⁠M = t([Lambda | diag(sqrt(Psi))])⁠, so a row randn(1, nf - 1 + p) * M is N(0, Lambda Lambda' + diag(Psi)). Drawing nf - 1 + p standard normals and post-multiplying by the factor-score matrix is faster than forming the model- implied correlation matrix and drawing from it, and matches the position at which NEST() reads the reference eigenvalue.

Usage

.simulate_cfm_eigen(nf, N, Lambda, Psi, nreps = 1000L)

Arguments

nf

integer. Position of the empirical eigenvalue being tested (1-based); the nf-th largest simulated eigenvalue is returned per replicate.

N

integer. Number of cases / observations per simulated dataset.

Lambda

numeric matrix. Loadings of the (nf - 1)-factor reference model (⁠p x (nf - 1)⁠); pass a ⁠p x 0⁠ matrix for the nf == 1 null (identity) model.

Psi

numeric vector. Uniquenesses (1 - h2) of the reference model.

nreps

integer. Number of datasets to simulate.


Draw multivariate-normal data from a population correlation matrix.

Description

Internal helper called from efa_simulate(). Draws N cases from a p-variate normal with correlation (or covariance) R by post-multiplying a matrix of standard normal deviates by a matrix square root M of R (with M' M = R, so the rows of Z * M are N(0, R)). This is the same Z * M rule used by the NEST reference simulation (.simulate_cfm_eigen): there M is the transposed factor-score matrix, here it is a Cholesky or eigen square root. A positive-definite R is factored by Cholesky; a positive-semidefinite but singular R (which makes the Cholesky fail although it is still a valid covariance, e.g. a no-factor block or a smoothed factor intercorrelation matrix) falls back to a symmetric eigen square root.

Usage

.simulate_cfm_mvn(R, N, tol = 1e-08)

Arguments

R

numeric matrix. Population correlation/covariance matrix.

N

integer. Number of cases to draw.

tol

numeric. Eigenvalues below -tol mark R as indefinite.


Tucker congruence between factors

Description

Compute the Tucker congruence matrix between the columns of two loading matrices.

Usage

.tucker_congruence(L1, L2)

Arguments

L1

Numeric matrix.

L2

Numeric matrix with the same dimensions as L1.

Value

A square matrix whose ⁠(i, j)⁠ entry is the Tucker congruence between column i of L1 and column j of L2.

References

Lorenzo-Seva, U., and ten Berge, J. M. F. (2006). Tucker's congruence coefficient as a meaningful index of factor similarity. Methodology, 2, 57-64.


Bartlett's test of sphericity

Description

This function tests whether a correlation matrix is significantly different from an identity matrix (Bartlett, 1951). If the Bartlett's test is not significant, the correlation matrix is not suitable for factor analysis because the variables show too little covariance.

Usage

BARTLETT(
  x,
  N = NA,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra")
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data or matrix with correlations.

N

numeric. The number of observations. Needs only be specified if a correlation matrix is used.

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. Correlation computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()), or "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data (a two-step estimator with no empty-cell continuity correction). Default is "pearson".

Details

Bartlett (1951) proposed this statistic to determine a correlation matrix' suitability for factor analysis. The statistic is approximately chi square distributed with df = \frac{p(p - 1)}{2} and is given by

chi^2 = -log(det(R)) (N - 1 - (2 * p + 5)/6)

where det(R) is the determinant of the correlation matrix, N is the sample size, and p is the number of variables.

This tests requires multivariate normality. If this condition is not met, the Kaiser-Meyer-Olkin criterion (KMO()) can still be used.

This function was heavily influenced by the psych::cortest.bartlett() function from the psych package.

The BARTLETT function can also be called together with the (KMO()) function and with factor retention criteria in the N_FACTORS() function.

Value

A list containing

chisq

The chi square statistic, or NA if N is too small for the Bartlett correction (i.e. N - 1 - (2p + 5)/6 \le 0).

p_value

The p value of the chi square statistic, or NA when chisq is NA.

df

The degrees of freedom for the chi square statistic.

settings

A list of the settings used.

Source

Bartlett, M. S. (1951). The effect of standardization on a Chi-square approximation in factor analysis. Biometrika, 38, 337-344.

See Also

KMO() for another measure to determine suitability for factor analysis.

N_FACTORS() as a wrapper function for this function, KMO() and several factor retention criteria.

Examples

BARTLETT(test_models$baseline$cormat, N = 500)


Comparison Data

Description

Factor retention method introduced by Ruscio and Roche (2012). The code was adapted from the CD code by Auerswald and Moshagen (2019) available at https://osf.io/x5cz2/?view_only=d03efba1fd0f4c849a87db82e6705668

Usage

CD(
  x,
  n_factors_max = NA,
  N_pop = 10000,
  N_samples = 500,
  alpha = 0.3,
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  max_iter = 50
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data.

n_factors_max

numeric. The maximum number of factors to test against. Larger numbers will increase the duration the procedure takes, but test more possible solutions. If left NA (default) the maximum number of factors for which the model is still over-identified (df > 0) is used.

N_pop

numeric. Size of finite populations of comparison data. Default is 10000.

N_samples

numeric. Number of samples drawn from each population. Default is 500.

alpha

numeric. The alpha level used to test the significance of the improvement added by an additional factor. Default is .30.

cor_method

character. One of "pearson", "spearman", or "kendall", passed to stats::cor(). "poly" and "tetra" are not supported because CD compares the data against simulated continuous reference data. Default is "pearson".

max_iter

numeric. The maximum number of iterations to perform after which the iterative PAF procedure is halted. Default is 50.

Details

Comparison data (CD) extends parallel analysis by reproducing the observed correlation matrix rather than generating random data: datasets with a known factor structure are generated with an increasing number of factors, and the smallest number for which adding a further factor no longer significantly improves the reproduction of the observed eigenvalues is retained (Ruscio & Roche, 2012).

Note that if the data contains missing values, these will be removed for the comparison data procedure using stats::na.omit(). If missing data should be treated differently, e.g., by imputation, do this outside CD and then pass the complete data.

Value

An object of class efa_retention (see print.efa_retention() and plot.efa_retention() for the print and plot methods). Its main fields are:

n_factors

A named numeric vector ("CD") with the suggested number of factors according to comparison data results.

results

A list with a single record holding the mean RMSE between the eigenvalues of the generated and the entered data per number of factors (used for the plot) and, in rmse_eigenvalues, the per-sample RMSE matrix (rows are samples, columns are factor counts; columns beyond the last tested factor count are left as zero).

settings

A list of the settings used.

Source

Auerswald, M., & Moshagen, M. (2019). How to determine the number of factors to retain in exploratory factor analysis: A comparison of extraction methods under realistic conditions. Psychological Methods, 24(4), 468–491. https://doi.org/10.1037/met0000200

Ruscio, J., & Roche, B. (2012). Determining the number of factors to retain in an exploratory factor analysis using comparison data of known factorial structure. Psychological Assessment, 24, 282–292. doi: 10.1037/a0025697

See Also

N_FACTORS() as a wrapper function for this and the other factor retention criteria.

Other factor retention criteria: EKC(), HULL(), KGC(), MAP(), NEST(), PARALLEL(), SCREE(), SMT()

Examples


# determine n factors of the GRiPS
CD(GRiPS_raw)

# determine n factors of the DOSPERT risk subscale
CD(DOSPERT_raw)


Compare two vectors or matrices (communalities or loadings)

Description

The function takes two objects of the same dimensions containing numeric information (loadings or communalities) and returns a list of class COMPARE containing summary information of the differences of the objects.

Usage

COMPARE(
  x,
  y,
  reorder = c("congruence", "names", "none"),
  corres = TRUE,
  thresh = 0.3,
  digits = 4,
  m_red = 0.001,
  range_red = 0.001,
  round_red = 3,
  print_diff = TRUE,
  na.rm = FALSE,
  x_labels = c("x", "y"),
  plot = TRUE,
  plot_red = 0.01
)

Arguments

x

matrix, or vector. Loadings or communalities of a factor analysis output.

y

matrix, or vector. Loadings or communalities of another factor analysis output to compare to x.

reorder

character. Whether and how elements / columns should be reordered. If "congruence" (default), the columns of y are matched to those of x by an optimal one-to-one assignment that maximizes Tucker's congruence coefficient, so each factor is matched exactly once; if "names", objects are reordered according to their names; if "none", no reordering is done.

corres

logical. Whether factor correspondences should be compared if a matrix is entered.

thresh

numeric. The threshold to classify a pattern coefficient as substantial. Default is .3.

digits

numeric. Number of decimals to print in the output. Default is 4.

m_red

numeric. Number above which the mean and median should be printed in red (i.e., if .001 is used, the mean will be in red if it is larger than .001, otherwise it will be displayed in green.) Default is .001.

range_red

numeric. Number above which the min and max should be printed in red (i.e., if .001 is used, min and max will be in red if the max is larger than .001, otherwise it will be displayed in green. Default is .001). Note that the color of min also depends on max, that is min will be displayed in the same color as max.

round_red

numeric. Number above which the max decimals to round to where all corresponding elements of x and y are still equal are displayed in red (i.e., if 3 is used, the number will be in red if it is smaller than 3, otherwise it will be displayed in green). Default is 3.

print_diff

logical. Whether the difference vector or matrix should be printed or not. Default is TRUE.

na.rm

logical. Whether NAs should be removed in the mean, median, min, and max functions. Default is FALSE.

x_labels

character. A vector of length two containing identifying labels for the two objects x and y that will be compared. These will be used as labels on the x-axis of the plot. Default is "x" and "y".

plot

logical. Retained for backwards compatibility; the difference plot is now drawn with plot.COMPARE() rather than when printing. Default is TRUE.

plot_red

numeric. Threshold above which to plot the absolute differences in red. Default is .01.

Value

A list of class COMPARE containing summary statistics on the differences of x and y.

diff

The vector or matrix containing the differences between x and y.

mean_abs_diff

The mean absolute difference between x and y.

median_abs_diff

The median absolute difference between x and y.

min_abs_diff

The minimum absolute difference between x and y.

max_abs_diff

The maximum absolute difference between x and y.

max_dec

The maximum number of decimals to which a comparison makes sense. For example, if x contains only values up to the third decimals, and y is a normal double, max_dec will be three.

are_equal

The maximal number of decimals to which all elements of x and y agree in absolute value. The comparison is on magnitudes, so two elements that are equal in size but opposite in sign count as agreeing; signed disagreements are reflected in diff and the mean / median / min / max absolute differences. NA if na.rm = FALSE and any element is missing.

diff_corres

The number of differing variable-to-factor correspondences between x and y, when only the highest loading is considered.

diff_corres_cross

The number of differing variable-to-factor correspondences between x and y when all loadings ⁠>= thresh⁠ are considered.

g

The root mean squared distance (RMSE) between x and y.

settings

List of the settings used.

Examples

# A type SPSS EFA to mimick the SPSS implementation
EFA_SPSS_6 <- EFA(test_models$case_11b$cormat, n_factors = 6, type = "SPSS")

# A type psych EFA to mimick the psych::fa() implementation
EFA_psych_6 <- EFA(test_models$case_11b$cormat, n_factors = 6, type = "psych")

# compare the two
COMPARE(EFA_SPSS_6$unrot_loadings, EFA_psych_6$unrot_loadings,
        x_labels = c("SPSS", "psych"))

DOSPERT

Description

A list containing the the bivariate correlations (cormat) of the 40 items of the Domain Specific Risk Taking Scale (DOSPERT; Weber, Blais, & Betz, 2002) and the sample size (N) based on the publicly available dataset at (https://osf.io/rce7g) of the Basel-Berlin Risk Study (Frey et al., 2017). The items measure risk-taking propensity on six different domains: social, recreational, gambling, health/ safety, investment, and ethical.

Usage

DOSPERT

Format

An object of class list of length 2.

Source

Weber, E. U., Blais, A.-R., & Betz, N. E. (2002). A domain specific risk-attitude scale: Measuring risk perceptions and risk behaviors. Journal of Behavioral Decision Making, 15(4), 263–290. doi: 10.1002/bdm.414

Frey, R., Pedroni, A., Mata, R., Rieskamp, J., & Hertwig, R. (2017). Risk preference shares the psychometric structure of major psychological traits. Science Advances, 3, e1701381.

https://osf.io/rce7g


DOSPERT_raw

Description

A data.frame containing responses to the risk subscale of the Domain Specific Risk Taking Scale (DOSPERT; Weber, Blais, & Betz, 2002) based on the publicly available dataset (at https://osf.io/pjt57/) by Frey, Duncan, and Weber (2020). The items measure risk-taking propensity on six different domains: social, recreational, gambling, health/ safety, investment, and ethical.

Usage

DOSPERT_raw

Format

An object of class data.frame with 3123 rows and 30 columns.

Source

Blais, A.-R., & Weber, E. U. (2002). A domain-specific risk-taking (DOSPERT) scale for adult populations. Judgment and Decision Making, 15(4), 263–290. doi: 10.1002/bdm.414

Frey, R., Duncan, S. M., & Weber, E. U. (2020). Towards a typology of risk preference: Four risk profiles describe two thirds of individuals in a large sample of the U.S. population. PsyArXiv Preprint. doi:10.31234/osf.io/yjwr9


Exploratory factor analysis (EFA)

Description

This function does an EFA with either PAF, ML, ULS/MINRES, or DWLS with or without subsequent rotation. All arguments with default value NA can be left to default if type is set to one of "EFAtools", "SPSS", or "psych". The respective specifications are then handled according to the specified type (see details).

Usage

EFA(
  x,
  n_factors,
  N = NA,
  method = c("PAF", "ML", "ULS", "MINRES", "DWLS"),
  rotation = c("none", "varimax", "equamax", "quartimax", "geominT", "bentlerT",
    "bifactorT", "promax", "oblimin", "quartimin", "simplimax", "bentlerQ", "geominQ",
    "bifactorQ"),
  se = c("none", "information", "sandwich", "np-boot"),
  type = c("EFAtools", "psych", "SPSS", "none"),
  max_iter = NA,
  init_comm = NA,
  criterion = NA,
  criterion_type = NA,
  abs_eigen = NA,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  varimax_type = NA,
  k = NA,
  normalize = TRUE,
  P_type = NA,
  precision = 1e-05,
  order_type = NA,
  start_method = "psych",
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra", "fiml"),
  b_boot = 1000,
  ci = 0.95,
  randomStarts = 100,
  seed = NULL,
  ...
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data or matrix with correlations. If raw data is entered, the correlation matrix is found from the data.

n_factors

numeric. Number of factors to extract.

N

numeric. The number of observations. Needs only be specified if a correlation matrix is used. If input is a correlation matrix and N = NA (default), not all fit indices can be computed. When raw data with missing values are entered and use is "complete.obs" or "na.or.complete", rows are deleted listwise, so N is taken as the number of complete cases.

method

character. The estimator used to fit the EFA: "PAF" (principal axis factoring), "ML" (maximum likelihood), "ULS" (unweighted least squares; "MINRES" is an accepted alias returning identical results), or "DWLS" (diagonally weighted least squares, for ordinal data). See the Estimators section in Details for their properties and data requirements.

rotation

character. Either perform no rotation ("none"; default), an orthogonal rotation ("varimax", "equamax", "quartimax", "geominT", "bentlerT", or "bifactorT"), or an oblique rotation ("promax", "oblimin", "quartimin", "simplimax", "bentlerQ", "geominQ", or "bifactorQ"). See the Rotations section in Details for their properties and known issues.

se

character. Whether and how to compute standard errors (and matching confidence intervals): "none" (default, no standard errors), "information" (analytic standard errors from the expected Fisher information of the ML solution), "sandwich" (robust Godambe sandwich standard errors from raw data), or "np-boot" (non-parametric bootstrap). The methods differ in their assumptions, their data requirements, and which estimator, rotation, and cor_method combinations they support; see the Standard errors section in Details.

type

character. If one of "EFAtools" (default), "psych", or "SPSS" is used, and the following arguments with default NA are left with NA, these implementations are executed according to the respective program ("psych" and "SPSS") or according to the best solution found in Grieder & Steiner (2022; "EFAtools"). Individual properties can be adapted using one of the three types and specifying some of the following arguments. If set to "none" additional arguments must be specified depending on the method and rotation used (see details).

max_iter

numeric. The maximum number of iterations to perform after which the iterative PAF procedure is halted with a warning. If type is one of "EFAtools", "SPSS", or "psych", this is automatically specified if max_iter is left to be NA, but can be overridden by entering a number. Default is NA.

init_comm

character. The method to estimate the initial communalities in PAF. "smc" will use squared multiple correlations, "mac" will use maximum absolute correlations, "unity" will use 1s (see details). Default is NA.

criterion

numeric. The convergence criterion used for PAF. If the change in communalities from one iteration to the next is smaller than this criterion the solution is accepted and the procedure ends. Default is NA.

criterion_type

character. Type of convergence criterion used for PAF. "max_individual" selects the maximum change in any of the communalities from one iteration to the next and tests it against the specified criterion. This is also used by SPSS. "sum" takes the difference of the sum of all communalities in one iteration and the sum of all communalities in the next iteration and tests this against the criterion. This procedure is used by the psych::fa() function. Default is NA.

abs_eigen

logical. Which algorithm to use in the PAF iterations. If FALSE, the loadings are computed from the eigenvalues. This is also used by the psych::fa() function. If TRUE the loadings are computed with the absolute eigenvalues as done by SPSS. Default is NA.

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

varimax_type

character. The type of the varimax rotation performed. If "svd", singular value decomposition is used, as stats::varimax() does. If "kaiser", the varimax procedure performed in SPSS is used, following the original procedure from Kaiser (1958) (see details). Default is NA.

k

numeric. Either the power used for computing the target matrix P in the promax rotation or the number of 'close to zero loadings' for the simplimax rotation. If left to NA (default), the value for promax depends on the specified type. For simplimax, nrow(L), where L is the matrix of unrotated loadings, is used by default.

normalize

logical. If TRUE, a kaiser normalization is performed before the specified rotation. Default is TRUE.

P_type

character. This specifies how the target matrix P is computed in promax rotation. If "unnorm" it will use the unnormalized target matrix as originally done in Hendrickson and White (1964). This is also used in the psych and stats packages. If "norm" it will use the normalized target matrix as used in SPSS. Default is NA.

precision

numeric. The tolerance for stopping in the rotation procedure. Default is 10^-5 for all rotation methods.

order_type

character. How to order the factors. "eigen" reorders the factors by descending explained variance, i.e. by their reported sums of squared loadings ("SS loadings"): the column sums of squares for orthogonal solutions and the factor-intercorrelation-weighted sums of squares for oblique solutions, so the reported variances decrease monotonically (as in the psych package). "ss_factors" reorders the factors by descending (unweighted) sum of squared factor loadings per factor; for oblique solutions this can differ from "eigen", whereas for orthogonal solutions the two coincide. Default is NA.

start_method

character. How to specify the starting values for the optimization procedure for ML. Default is "psych" which takes the starting values specified in psych::fa(). "factanal" takes the starting values specified in the stats::factanal() function. Solutions are very similar.

cor_method

character. How the correlation is computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()); "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data; or "fiml" for a two-stage full-information maximum-likelihood correlation from raw data with missing values. See the Correlation methods section in Details for their properties and the combinations they support. Default is "pearson".

b_boot

numeric. The number of bootstrap samples to draw. Default is 1000. Under cor_method = "fiml" each bootstrap sample re-runs the EM moment estimation, so a smaller value may be advisable.

ci

numeric. The confidence interval to create from the bootstrap samples. Must be between 0 and 1. Default is .95 for 95% CIs.

randomStarts

numeric. The number of random starts to use in the rotation. Some rotation criteria are prone to produce local minima, and several random starts are usually needed to locate the best solution. The rotation screens the random starts cheaply and fully optimises only the most promising ones, so a large value adds little cost for most criteria. The complexity criteria (simplimax and, to a lesser extent, geomin) are the most multimodal and may need a larger value on difficult data. Default is 100.

seed

numeric. An optional seed for the random-number generator used by the non-parametric bootstrap (se = "np-boot"), i.e. for the case resampling, the rotation random starts, and the Procrustes random starts. Setting it makes the bootstrap reproducible and independent of the number of parallel workers (see Details); the caller's random-number stream is restored afterwards, so supplying a seed leaves no lasting effect on it. Default is NULL, which uses (and advances) the current state of the generator.

...

Additional arguments passed to the rotation procedure (e.g., maxit for the maximum number of iterations).

Details

There are two main ways to use this function. The easiest way is to use it with a specified type (see above), which sets most of the other arguments accordingly. Another way is to use it more flexibly by explicitly specifying all arguments used and set type to "none" (see examples). A mix of the two can also be done by specifying a type as well as additional arguments. However, this will throw warnings to avoid unintentional deviations from the implementations according to the specified type.

Estimators

The estimator is chosen with method.

Correlation methods

When raw data are supplied, cor_method selects how the correlation matrix is computed (it is ignored when a correlation matrix is entered directly).

Rotations

A rotation transforms the unrotated loadings toward a simpler, more interpretable pattern; all rotations are performed by rotation engines built into the package. Orthogonal rotations keep the factors uncorrelated, whereas oblique rotations let them correlate (returning a pattern matrix, a structure matrix, and the factor intercorrelations Phi) and are usually more realistic for psychological constructs.

Orthogonal rotations:

Oblique rotations:

The criterion-based rotations (all except varimax and promax) are fitted by gradient projection with randomStarts random starts to guard against local minima; the complexity criteria (simplimax and geominQ in particular) are the most multimodal. The type argument changes the varimax and promax settings (see Using the type presets) and, for every rotation, the factor order_type. A single factor cannot be rotated.

Standard errors

se selects whether and how standard errors (and matching confidence intervals) are computed. They cover the unrotated loadings and uniquenesses and, when a rotation is applied, the rotated loadings, the communalities, and – for oblique rotations – the factor correlations and the structure coefficients (see the SE and CI entries in Value).

The analytic methods ("information" and "sandwich") are not available with the "promax" or "simplimax" rotations, which have no usable analytic rotation Jacobian; use "np-boot" there. Under cor_method = "fiml", "information" and "sandwich" instead return, for method = "ML" or "ULS", the corrected two-stage (Yuan & Bentler, 2000; Savalei & Bentler, 2009) sandwich standard errors, built on the saturated FIML asymptotic covariance with the estimator's own Stage-2 weight: the model is fitted to the EM-estimated correlation, so the naive Stage-2 standard errors (treating that correlation as complete data) are inconsistent under missingness and are not reported (method = "PAF" carries no Stage-2 weight, so use se = "np-boot" there).

Fit indices

For ML and ULS, EFA() returns the model chi-square (with its p-value and degrees of freedom), the Comparative Fit Index (CFI; Bentler, 1990), the Tucker-Lewis Index (TLI, also called the non-normed fit index; Tucker & Lewis, 1973), the Root Mean Square Error of Approximation (RMSEA) with its 90% confidence interval (Browne & Cudeck, 1992), the Akaike and Bayesian Information Criteria (AIC, BIC), the Expected Cross-Validation Index (ECVI; Browne & Cudeck, 1989), the Root Mean Squared Residual (RMSR), the Standardized Root Mean Squared Residual (SRMR; Bentler, 1995), and the common-part-accounted-for (CAF) index (Lorenzo-Seva, Timmerman, & Kiers, 2011). The print and summary methods show SRMR, not RMSR, because the two residual summaries differ only by the fixed scaling \sqrt{(p - 1) / (p + 1)} for a fixed number of variables; RMSR remains in the returned object. The model chi-square is the Bartlett-corrected discrepancy (matching stats::factanal() for ML); the AIC, BIC, and ECVI are the minimum-fit-function (chi-square-based) forms (\chi^2 - 2\,df and \chi^2 - \log(N)\,df for AIC and BIC, as in psych::fa()) and can therefore be negative. The RMSEA, CFI, and TLI place the model and baseline noncentrality on the uncorrected N - 1 discrepancy scale on which these approximate-fit indices are defined, so the Bartlett small-sample correction enters only the chi-square test, not the approximate-fit indices.

Which indices are reported depends on the estimator:

Whenever the chi-square is a scaled one (se = "sandwich", or any cor_method = "fiml" fit), the AIC, BIC, and ECVI are NA and the returned fit_indices additionally carry the scaled-statistic components (see the fit_indices entry in Value). Note that Lorenzo-Seva, Timmerman, and Kiers (2011) introduce the CAF as ranging between 0 and 1, with values close to 1 indicating close fit; this does not match the formula they apply, 1 - KMO(residuals), which only works if the diagonal of the residual matrix is set to 1s and then approximates 0.5 with close fit.

Available combinations

Not every estimator, rotation, standard-error, and correlation method can be combined:

Using the type presets

The type argument is evaluated for PAF and for all rotations (mainly important for the varimax and promax rotations). The type-specific settings for these functions are detailed below.

For PAF, the values of init_comm, criterion, criterion_type, max_iter, and abs_eigen depend on the type argument.

type = "EFAtools" will use the following argument specification: ⁠init_comm = "smc", criterion = .001, criterion_type = "sum", max_iter = 300, abs_eigen = TRUE⁠.

type = "psych" will use the following argument specification: ⁠init_comm = "smc", criterion = .001, criterion_type = "sum", max_iter = 50, abs_eigen = FALSE⁠.

type = "SPSS" will use the following argument specification: ⁠init_comm = "smc", criterion = .001, criterion_type = "max_individual", max_iter = 25, abs_eigen = TRUE⁠.

If SMCs fail, SPSS takes "mac". However, as SPSS takes absolute eigenvalues, this is hardly ever the case. Psych, on the other hand, takes "unity" if SMCs fail, but uses the Moore-Penrose Psudo Inverse of a matrix, thus, taking "unity" is only necessary if negative eigenvalues occur afterwards in the iterative PAF procedure. The EFAtools type setting combination was the best in terms of accuracy and number of Heywood cases compared to all the other setting combinations tested in simulation studies in Grieder & Steiner (2022), which is why this type is used as a default here.

For varimax, the values of varimax_type and order_type depend on the type argument.

type = "EFAtools" will use the following argument specification: ⁠varimax_type = "kaiser", order_type = "eigen"⁠.

type = "psych" will use the following argument specification: ⁠varimax_type = "svd", order_type = "eigen"⁠.

type = "SPSS" will use the following argument specification: ⁠varimax_type = "kaiser", order_type = "ss_factors"⁠.

For promax, the values of P_type, order_type, and k depend on the type argument.

type = "EFAtools" will use the following argument specification: ⁠P_type = "norm", order_type = "eigen", k = 4⁠.

type = "psych" will use the following argument specification: ⁠P_type = "unnorm", order_type = "eigen", k = 4⁠.

type = "SPSS" will use the following argument specification: ⁠P_type = "norm", order_type = "ss_factors", k = 4⁠.

The P_type argument can take two values, "unnorm" and "norm". It controls which formula is used to compute the target matrix P in the promax rotation. "unnorm" uses the formula from Hendrickson and White (1964), specifically: P = abs(A^(k + 1)) / A, where A is the unnormalized matrix containing varimax rotated loadings. "norm" uses the normalized varimax rotated loadings. Specifically it used the following formula, which can be found in the SPSS 23 and SPSS 27 Algorithms manuals: P = abs(A / sqrt(rowSums(A^2))) ^(k + 1) * (sqrt(rowSums(A^2)) / A). As for PAF, the EFAtools type setting combination for promax was the best compared to the other setting combinations tested in simulation studies in Grieder & Steiner (2022). Note that all type presets keep the EFAtools default Kaiser normalization (normalize = TRUE), whereas psych::fa() does not normalize before its promax target rotation; set normalize = FALSE to reproduce the psych::fa() promax result exactly.

The varimax_type argument can take two values, "svd", and "kaiser". "svd" uses singular value decomposition, by calling stats::varimax(). "kaiser" performs the varimax procedure as described in the SPSS Algorithms manual and by Kaiser (1958). The varimax simplicity criterion monitored for convergence is sum(n*colSums(lambda ^ 4) - colSums(lambda ^ 2) ^ 2) / n ^ 2, where n is the number of indicators, and lambda is the Kaiser-normalized rotated loadings matrix.

For all other rotations except varimax and promax, the type argument only controls the order_type argument with the same values as stated above for the varimax and promax rotations. Additional arguments can also be specified and will be passed to the rotation procedure (e.g., maxit to change the maximum number of iterations).

The type argument has no effect on ULS and ML. For ULS, no additional arguments are needed. For ML, an additional argument start_method is needed to determine the starting values for the optimization procedure. Default for this argument is "psych" which takes the starting values specified in psych::fa().

Value

A list of class EFA containing (a subset of) the following:

orig_R

Original correlation matrix.

h2_init

Initial communality estimates from PAF.

h2

Final communality estimates from the unrotated solution.

orig_eigen

Eigen values of the original correlation matrix.

init_eigen

Initial eigenvalues, obtained from the correlation matrix with the initial communality estimates as diagonal in PAF.

final_eigen

Eigenvalues obtained from the correlation matrix with the final communality estimates as diagonal.

iter

For PAF, the number of iterations until convergence. For ML, ULS, and DWLS, the number of objective-function evaluations used by the optimiser (not the number of optimiser iterations).

convergence

Integer convergence code (0 = converged). For ML, ULS, and DWLS this is the convergence code from the bounded optimiser (the same codes as stats::optim()'s "L-BFGS-B"); for PAF it is 1 if the maximum number of iterations was reached without meeting the convergence criterion and 0 otherwise. A non-zero code is also reported with a warning.

heywood

A named integer vector indicating which variables have a Heywood (improper) case in the unrotated solution; empty if there are none.

unrot_loadings

Loading matrix containing the final unrotated loadings.

vars_accounted

Matrix of explained variances and sums of squared loadings. Based on the unrotated loadings.

fit_indices

A named list of fit indices computed from the unrotated loadings. For ML and ULS it holds the model Chi Square (with its p-value and df), CFI, TLI, RMSEA with its 90% confidence interval, AIC, BIC, ECVI, RMSR, SRMR, and CAF; for PAF and DWLS only RMSR, SRMR, CAF, and df are populated and the Chi-Square-based indices are NA (for DWLS with se = "sandwich" the full block is filled from a scaled Chi Square instead). Whenever the Chi Square is a scaled statistic (se = "sandwich", or any cor_method = "fiml" fit) AIC, BIC, and ECVI are NA and the list additionally carries the scaling components: chi_scaling (the multiplier a in the scaled-and-shifted statistic aT + b, i.e. the reciprocal of lavaan's chisq.scaling.factor), chi_shift (b), chi_unscaled (the unscaled statistic T), and the alternative chi_mean_adjusted and chi_mean_var statistics with their df_mean_var. RMSR is retained for programmatic use and backward compatibility, although the print and summary methods display SRMR. See the Fit indices section in Details for how each index is defined, scaled, and referenced.

model_implied_R

The model implied correlation matrix.

residuals

Residual correlations, i.e., orig_R - model_implied_R

standardized_residuals

Residual correlations standardized by their bootstrap standard errors. Only returned, if se = "np-boot".

rot_loadings

Loading matrix containing the final rotated loadings (pattern matrix).

Phi

The factor intercorrelations (only for oblique rotations).

Structure

The structure matrix (only for oblique rotations).

rotmat

The rotation matrix. The rotated loadings are recovered from the unrotated loadings as unrot_loadings %*% rotmat for orthogonal rotations and for promax, and as unrot_loadings %*% t(solve(rotmat)) for the other oblique rotations.

vars_accounted_rot

Matrix of explained variances and sums of squared loadings. Based on rotated loadings and, for oblique rotations, the factor intercorrelations.

settings

A list of the settings used.

SE

A named list of standard error matrices. For se = "np-boot": bootstrap standard deviations of the unrotated and (when a rotation is applied) rotated loadings, the residuals, and the fit indices, plus – for oblique rotations – the factor correlations (Phi) and the structure coefficients. For se = "information": Wald standard errors from the expected (Fisher) information matrix for the unrotated loadings and the uniquenesses and, when a rotation is applied, the rotated loadings and the communalities (and, for oblique rotations, Phi and the structure coefficients). For se = "sandwich": robust Godambe sandwich standard errors with the same coverage as "information", robust to non-normality and weight misspecification. Only returned if se is not "none".

CI

A named list of confidence intervals of width ci. For se = "np-boot": percentile intervals matching the components of SE. For se = "information" and se = "sandwich": Wald intervals matching the components of SE. Only returned if se is not "none".

replicates

A named list of bootstrap replicate cubes for the aligned unrotated and (where applicable) rotated loadings, structure coefficients, factor correlations (Phi), residuals, and fit indices. Each cube's last dimension indexes the replicate. Populated only for se = "np-boot"; NULL for the analytic SE methods.

vcov_unrot_loadings

The full unrotated loading covariance matrix the marginal SE$unrot_loadings were derived from: a p * n_factors by p * n_factors numeric matrix in column-major vec(Lambda) order. Populated for se = "information" (expected-information block) and se = "sandwich" (robust V_AA), even when a rotation is applied (the persisted block is always the unrotated one); NA-filled if the analytic covariance is unreliable (a Heywood case or a singular bordered information matrix); NULL for se = "np-boot" and se = "none".

Gamma

The asymptotic covariance of the off-diagonal sample correlations – the meat of the robust sandwich SEs – on the variance scale (Var(rho-hat); lavaan's correlation NACOV is N * Gamma). A p (p - 1) / 2 by p (p - 1) / 2 numeric matrix; rows and columns ordered by utils::combn() over the column pairs and labelled "<var_i>-<var_j>". Populated only for se = "sandwich"; NULL otherwise.

Source

Grieder, S., & Steiner, M. D. (2022). Algorithmic jingle jungle: A comparison of implementations of principal axis factoring and promax rotation in R and SPSS. Behavior Research Methods, 54, 54–74. doi: 10.3758/s13428-021-01581-x

Hendrickson, A. E., & White, P. O. (1964). Promax: A quick method for rotation to oblique simple structure. British Journal of Statistical Psychology, 17 , 65–70. doi: 10.1111/j.2044-8317.1964.tb00244.x

Lorenzo-Seva, U., Timmerman, M. E., & Kiers, H. A. L. (2011). The Hull Method for Selecting the Number of Common Factors, Multivariate Behavioral Research, 46, 340-364, doi: 10.1080/00273171.2011.564527

Kaiser, H. F. (1958). The varimax criterion for analytic rotation in factor analysis. Psychometrika, 23, 187–200. doi: 10.1007/BF02289233

Lawley, D. N., & Maxwell, A. E. (1971). Factor analysis as a statistical method (2nd ed.). Butterworths.

Jennrich, R. I., & Thayer, D. T. (1973). A note on Lawley's formulas for standard errors in maximum likelihood factor analysis. Psychometrika, 38, 571–580. doi: 10.1007/BF02291495

Jennrich, R. I. (1973). Standard errors for obliquely rotated factor loadings. Psychometrika, 38, 593–604. doi: 10.1007/BF02291497

Zhang, G., & Preacher, K. J. (2015). Factor rotation and standard errors in exploratory factor analysis. Journal of Educational and Behavioral Statistics, 40, 579–603. doi: 10.3102/1076998615606098

Browne, M. W. (1984). Asymptotically distribution-free methods for the analysis of covariance structures. British Journal of Mathematical and Statistical Psychology, 37, 62–83. doi: 10.1111/j.2044-8317.1984.tb00789.x

Satorra, A., & Bentler, P. M. (1994). Corrections to test statistics and standard errors in covariance structure analysis. In A. von Eye & C. C. Clogg (Eds.), Latent variables analysis (pp. 399–419). Sage.

Asparouhov, T., & Muthén, B. (2010). Simple second order chi-square correction. Mplus Technical Appendix.

Muthén, B. (1984). A general structural equation model with dichotomous, ordered categorical, and continuous latent variable indicators. Psychometrika, 49, 115–132. doi: 10.1007/BF02294210

Yuan, K.-H., & Bentler, P. M. (2000). Three likelihood-based methods for mean and covariance structure analysis with nonnormal missing data. Sociological Methodology, 30, 165–200. doi: 10.1111/0081-1750.00078

Yuan, K.-H., Marshall, L. L., & Bentler, P. M. (2002). A unified approach to exploratory factor analysis with missing data, nonnormal data, and in the presence of outliers. Psychometrika, 67, 95–121. doi: 10.1007/BF02294711

Savalei, V., & Bentler, P. M. (2009). A two-stage approach to missing data: Theory and application to auxiliary variables. Structural Equation Modeling, 16, 477–497. doi: 10.1080/10705510903008238

Little, R. J. A., & Rubin, D. B. (2002). Statistical analysis with missing data (2nd ed.). Wiley.

Bartlett, M. S. (1951). The effect of standardization on approximation in factor analysis. Biometrika, 38, 337–344.

Bentler, P. M. (1990). Comparative fit indexes in structural models. Psychological Bulletin, 107, 238–246. doi: 10.1037/0033-2909.107.2.238

Tucker, L. R., & Lewis, C. (1973). A reliability coefficient for maximum likelihood factor analysis. Psychometrika, 38, 1–10. doi: 10.1007/BF02291170

Browne, M. W., & Cudeck, R. (1989). Single sample cross-validation indices for covariance structures. Multivariate Behavioral Research, 24, 445–455. doi: 10.1207/s15327906mbr2404_4

Browne, M. W., & Cudeck, R. (1992). Alternative ways of assessing model fit. Sociological Methods & Research, 21, 230–258. doi: 10.1177/0049124192021002005

Bentler, P. M. (1995). EQS structural equations program manual. Multivariate Software.

Examples


# Principal axis factoring with oblimin rotation
mod_oblimin <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500,
                   rotation = "oblimin")
mod_oblimin
summary(mod_oblimin)

# ML estimation with oblimin rotation
mod_oblimin <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500,
                   method = "ML", rotation = "oblimin")
mod_oblimin
summary(mod_oblimin)

# Analytic (expected-information) standard errors for the above
ML_info <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500,
               method = "ML", rotation = "oblimin", se = "information")
ML_info
summary(ML_info)


# Robust (sandwich) standard errors and a scaled chi-square for ordinal raw data.
# These need a polychoric/tetrachoric correlation method and method ML, ULS, or DWLS.
DWLS_rob <- EFA(DOSPERT_raw, n_factors = 6, cor_method = "poly",
                method = "DWLS", rotation = "oblimin", se = "sandwich")
DWLS_rob
summary(DWLS_rob)

# The same robust SEs and scaled chi-square for continuous data: a Pearson
# correlation with method ML or ULS (the fourth-moment ADF covariance).
ML_rob <- EFA(GRiPS_raw, n_factors = 1, cor_method = "pearson",
              method = "ML", rotation = "none", se = "sandwich")
ML_rob
summary(ML_rob)



# Two-stage FIML correlations from raw data with missing values: the saturated
# multivariate-normal moments are EM-estimated (assuming the data are missing at
# random) and the standardized covariance is analysed.
x_miss <- GRiPS_raw
x_miss[cbind(1:20, 1)] <- NA
EFA_fiml <- EFA(x_miss, n_factors = 1, method = "ML", cor_method = "fiml")
EFA_fiml


## Not run: 
# Bootstrap standard errors from raw data, reproducible via a fixed seed and run
# in parallel across replicates.
future::plan(future::multisession, workers = 2)
EFA_boot <- EFA(GRiPS_raw, n_factors = 1, method = "PAF", rotation = "none",
                se = "np-boot", b_boot = 1000, seed = 42)
future::plan(future::sequential)

## End(Not run)


Model averaging across different EFA methods and types

Description

Not all EFA procedures always arrive at the same solution. This function allows you perform a number of EFAs from different methods (e.g., Maximum Likelihood and Principal Axis Factoring), with different implementations (e.g., the SPSS and psych implementations of Principal Axis Factoring), and across different rotations of the same type (e.g., multiple oblique rotations, like promax and oblimin). EFA_AVERAGE will then run all these EFAs (using the EFA() function) and provide a summary across the different solutions.

Usage

EFA_AVERAGE(
  x,
  n_factors,
  N = NA,
  method = "PAF",
  rotation = "promax",
  type = "none",
  averaging = c("mean", "median"),
  trim = 0,
  salience_threshold = 0.3,
  max_iter = 10000,
  init_comm = c("smc", "mac", "unity"),
  criterion = c(0.001),
  criterion_type = c("sum", "max_individual"),
  abs_eigen = c(TRUE),
  varimax_type = c("svd", "kaiser"),
  normalize = TRUE,
  k_promax = 2:4,
  k_simplimax = ncol(x),
  P_type = c("norm", "unnorm"),
  precision = 1e-05,
  start_method = c("psych", "factanal"),
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra", "fiml"),
  show_progress = TRUE
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data or matrix with correlations. If raw data is entered, the correlation matrix is found from the data.

n_factors

numeric. Number of factors to extract.

N

numeric. The number of observations. Needs only be specified if a correlation matrix is used. If input is a correlation matrix and N = NA (default), not all fit indices can be computed.

method

character vector. Any combination of "PAF", "ML", and "ULS", to use principal axis factoring, maximum likelihood, or unweighted least squares, respectively, to fit the EFAs. "MINRES" is accepted as a synonym for "ULS" (the same estimator). Default is "PAF".

rotation

character vector. Either perform no rotation ("none"), any combination of orthogonal rotations ("varimax", "equamax", "quartimax", "geominT", "bentlerT", and "bifactorT"; using "orthogonal" runs all of these), or of oblique rotations ("promax", "oblimin", "quartimin", "simplimax", "bentlerQ", "geominQ", and "bifactorQ"; using "oblique" runs all of these). Rotation types (no rotation, orthogonal rotations, and oblique rotations) cannot be mixed. Default is "promax".

type

character vector. Any combination of "none" (default), "EFAtools", "psych", and "SPSS" can be entered. "none" allows the specification of various combinations of the arguments controlling both factor extraction methods and the rotations. The others ("EFAtools", "psych", and "SPSS"), control the execution of the respective factor extraction method and rotation to be in line with how it is executed in this package (i.e., the respective default procedure), in the psych package, and in SPSS. A specific psych implementation exists for PAF, ML, varimax, and promax. The SPSS implementation exists for PAF, varimax, and promax. For details, see EFA().

averaging

character. One of "mean" (default), and "median". Controls whether the different results should be averaged using the (trimmed) mean, or the median.

trim

numeric. If averaging is set to "mean", this argument controls the trimming of extremes (for details see base::mean()). By default no trimming is done (i.e., trim = 0).

salience_threshold

numeric. The threshold to use to classify a pattern coefficient or loading as salient (i.e., substantial enough to assign it to a factor). Default is 0.3. Indicator-to-factor correspondences will be inferred based on this threshold. Note that this may not be meaningful if rotation = "none" and n_factors > 1 are used, as no simple structure is present there.

max_iter

numeric. The maximum number of iterations to perform after which the iterative PAF procedure is halted with a warning. Default is 10,000. Note that non-converged procedures are excluded from the averaging procedure.

init_comm

character vector. Any combination of "smc", "mac", and "unity". Controls the methods to estimate the initial communalities in PAF if "none" is among the specified types. "smc" will use squared multiple correlations, "mac" will use maximum absolute correlations, "unity" will use 1s (for details see EFA()). Default is c("smc", "mac", "unity").

criterion

numeric vector. The convergence criterion used for PAF if "none" is among the specified types. If the change in communalities from one iteration to the next is smaller than this criterion the solution is accepted and the procedure ends. Default is 0.001.

criterion_type

character vector. Any combination of "max_individual" and "sum". Type of convergence criterion used for PAF if "none" is among the specified types. "max_individual" selects the maximum change in any of the communalities from one iteration to the next and tests it against the specified criterion. "sum" takes the difference of the sum of all communalities in one iteration and the sum of all communalities in the next iteration and tests this against the criterion (for details see EFA()). Default is c("sum", "max_individual").

abs_eigen

logical vector. Any combination of TRUE and FALSE. Which algorithm to use in the PAF iterations if "none" is among the specified types. If FALSE, the loadings are computed from the eigenvalues. This is also used by the psych::fa() function. If TRUE the loadings are computed with the absolute eigenvalues as done by SPSS (for details see EFA()). Default is TRUE.

varimax_type

character vector. Any combination of "svd" and "kaiser". The type of the varimax rotation performed if "none" is among the specified types and "varimax", "promax", "orthogonal", or "oblique" is among the specified rotations. "svd" uses singular value decomposition, as stats::varimax() does, and "kaiser" uses the varimax procedure performed in SPSS. This is the original procedure from Kaiser (1958), but with slight alterations in the varimax criterion (for details, see EFA() and Grieder & Steiner, 2022). Default is c("svd", "kaiser").

normalize

logical vector. Any combination of TRUE and FALSE. TRUE performs a kaiser normalization before the specified rotation(s). Default is TRUE.

k_promax

numeric vector. The power used for computing the target matrix P in the promax rotation if "none" is among the specified types and "promax" or "oblique" is among the specified rotations. Default is 2:4.

k_simplimax

numeric. The number of 'close to zero loadings' for the simplimax rotation if "simplimax" or "oblique" is among the specified rotations. Default is ncol(x), where x is the entered data.

P_type

character vector. Any combination of "norm" and "unnorm". This specifies how the target matrix P is computed in promax rotation if "none" is among the specified types and "promax" or "oblique" is among the specified rotations. "unnorm" will use the unnormalized target matrix as originally done in Hendrickson and White (1964). "norm" will use a normalized target matrix (for details see EFA()). Default is c("norm", "unnorm").

precision

numeric vector. The tolerance for stopping in the rotation procedure(s). Default is 10^-5.

start_method

character vector. Any combination of "psych" and "factanal". How to specify the starting values for the optimization procedure for ML. "psych" takes the starting values specified in psych::fa(). "factanal" takes the starting values specified in the stats::factanal() function. Default is c("psych", "factanal").

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. Correlation computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()), "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data (a two-step estimator with no empty-cell continuity correction), or "fiml" for a two-stage full-information maximum-likelihood correlation from raw data with missing values. With "fiml" the saturated multivariate-normal mean and covariance are estimated by an EM algorithm assuming the data are missing at random and the standardized covariance is analysed, reproducing psych::corFiml() followed by psych::fa() and lavaan(missing = "two.stage"), not lavaan::efa(missing = "ml") (see EFA() and the details). Default is "pearson".

show_progress

logical. Whether a progress bar should be shown in the console. Default is TRUE.

Details

As a first step in this function, a grid is produced containing the setting combinations for the to-be-performed EFAs. These settings are then entered as arguments to the EFA() function and the EFAs are run in a second step. After all EFAs are run, the factor solutions are averaged and their variability determined in a third step.

When raw data are supplied, the correlation matrix is computed once before the grid is run and reused for every EFA in it. Under cor_method = "fiml" this means the saturated multivariate-normal moments are EM-estimated a single time (from the raw data with missing values, assuming the data are missing at random) and the resulting two-stage correlation is analysed by every solution in the grid; the EM is not re-run per solution. Under cor_method = "fiml", use does not select cases (every case contributes to the EM). The averaged loadings and communalities are then the two-stage FIML estimates, but the averaged Chi-Square and the indices derived from it (CFI, TLI, RMSEA, AIC, BIC, ECVI) are the ordinary ML/ULS discrepancy statistics on the EM correlation, not the corrected two-stage (Satorra-Bentler) statistics that a standalone EFA() with cor_method = "fiml" reports; in particular the averaged AIC and BIC are finite here rather than NA.

The grid containing the setting combinations is produced based on the entries to the respective arguments. To this end, all possible combinations resulting in unique EFA models are considered. That is, if, for example, the type argument was set to c("none", "SPSS") and one combination of the specific settings entered was identical to the SPSS combination, this combination would be included in the grid and run only once. We include here a list of arguments that are only evaluated under specific conditions:

The arguments init_comm, criterion, criterion_type, abs_eigen are only evaluated if "PAF" is included in method and "none" is included in type.

The argument varimax_type is only evaluated if "varimax", "promax", "oblique", or "orthogonal" is included in rotation and "none" is included in type.

The argument normalize is only evaluated if rotation is not set to "none" and "none" is included in type.

The argument k_simplimax is only evaluated if "simplimax" or "oblique" is included in rotation.

The arguments k_promax and P_type are only evaluated if "promax" or "oblique" is included in rotation and "none" is included in type.

The argument start_method is only evaluated if "ML" is included in method.

To avoid a bias in the averaged factor solutions from problematic solutions, these are excluded prior to averaging. A solution is deemed problematic if at least one of the following is true: an error occurred, the model did not converge, or there is at least one Heywood (improper) case (a communality at or above 1, or, for ML/ULS, a uniqueness pinned at the estimator's lower bound). Information on errors, convergence, and Heywood cases are returned in the implementations_grid and a summary of these is given when printing the output. In addition to these, information on the admissibility of the factor solutions is also included. A solution was deemed admissible if (1) no error occurred, (2) the model converged, (3) no Heywood cases are present, and (4) there are at least two salient loadings (i.e., loadings exceeding the specified salience_threshold) for each factor. So, solutions failing one of the first three of these criteria of admissibility are also deemed problematic and therefore excluded from averaging. However, solutions failing only the fourth criterion of admissibility are still included for averaging. Finally, if all solutions are problematic (e.g., all solutions contain Heywood cases), no averaging is performed and the respective outputs are NA. In this case, the implementations_grid should be inspected to see if there are any error messages, and the separate EFA solutions that are also included in the output can be inspected as well, for example, to see where Heywood cases occurred.

A core output of this function includes the average, minimum, and maximum loadings derived from all non-problematic (see above) factor solutions. Please note that these are not entire solutions, but the matrices include the average, minimum, or maximum value for each cell (i.e., each loading separately). This means that, for example, the matrix with the minimum loadings will contain the minimum value in any of the factor solutions for each specific loading, and therefore most likely contains loadings from different factor solutions. The matrices containing the minimum and maximum factor solutions can therefore not be interpreted as whole factor solutions.

The output also includes information on the average, minimum, maximum, and variability of the fit indices across the non-problematic factor solutions. It is important to note that not all fit indices are computed for all fit methods: For ML and ULS, all fit indices can be computed, while for PAF the chi-square-based indices (the chi-square statistic and its significance, CFI, TLI, RMSEA, AIC, BIC, and ECVI) are NA. The common part accounted for (CAF) index (Lorenzo-Seva, Timmerman, & Kiers, 2011) and the residual-based SRMR and RMSR are still computed for PAF. As a consequence, if only "PAF" is included in the method argument, averaging is performed for the CAF, SRMR, and RMSR, while the chi-square-based indices are NA. If a combination of "PAF" and "ML" and/or "ULS" are included in the method argument, the CAF, SRMR, and RMSR are averaged across all non-problematic factor solutions, while the chi-square-based indices are only averaged across the ML and ULS solutions. The user should therefore keep in mind that the number of EFAs across which the fit indices are averaged can diverge for the CAF, SRMR, and RMSR compared to the chi-square-based indices.

Each reported fit index is summarised across the (non-problematic) solutions in the same descriptive way: the average, standard deviation, minimum, and maximum of the per-solution values. This includes the chi-square significance level (p_chi), which is therefore the mean (or median) of the per-solution p-values and is purely descriptive; it is not the p-value of any pooled chi-square test.

Value

A list of class EFA_AVERAGE containing

orig_R

Original correlation matrix.

h2

A list with the average, standard deviation, minimum, maximum, and range of the final communality estimates across the factor solutions.

loadings

A list with the average, standard deviation, minimum, maximum, and range of the final loadings across the factor solutions. If rotation was "none", the unrotated loadings, otherwise the rotated loadings (pattern coefficients).

Phi

A list with the average, standard deviation, minimum, maximum, and range of the factor intercorrelations across factor solutions obtained with oblique rotations.

ind_fac_corres

A matrix with each cell containing the proportion of the factor solutions in which the respective indicator-to-factor correspondence occurred, i.e., in which the loading exceeded the specified salience threshold. Note: Rowsums can exceed 1 due to cross-loadings.

vars_accounted

A list with the average, standard deviation, minimum, maximum, and range of explained variances and sums of squared loadings across the factor solutions. Based on the unrotated loadings if rotation was "none" or only one factor was extracted, otherwise on the rotated loadings.

fit_indices

A matrix containing the average, standard deviation, minimum, maximum, and range for all applicable fit indices across the respective factor solutions, and the degrees of freedom (df). If the method argument contains ML or ULS: Fit indices derived from the unrotated factor loadings: Chi Square (chisq), including significance level, Comparative Fit Index (CFI), Tucker-Lewis Index (TLI), Root Mean Square Error of Approximation (RMSEA), Akaike Information Criterion (AIC), Bayesian Information Criterion (BIC), Expected Cross-Validation Index (ECVI), and the common part accounted for (CAF) index as proposed by Lorenzo-Seva, Timmerman, & Kiers (2011). The residual-based Standardized Root Mean Square Residual (SRMR) and Root Mean Square Residual (RMSR) and the CAF are also computed for PAF; for PAF the remaining (chi-square-based) indices are not available (see details).

implementations_grid

A matrix containing, for each performed EFA, the setting combination, if an error occurred (logical), the error message (character), an integer convergence code (0 = converged; for ML and ULS the same codes as stats::optim()'s "L-BFGS-B", for PAF 1 if the maximum number of iterations was reached without meeting the convergence criterion and 0 otherwise), if heywood cases occurred (logical, see details for definition), if the solution was admissible (logical, see details for definition), and the fit indices.

efa_list

A list containing the outputs of all performed EFAs. The names correspond to the rownames from the implementations_grid.

settings

A list of the settings used.

Source

Grieder, S., & Steiner, M. D. (2022). Algorithmic jingle jungle: A comparison of implementations of principal axis factoring and promax rotation in R and SPSS. Behavior Research Methods, 54, 54–74. doi: 10.3758/s13428-021-01581-x

Hendrickson, A. E., & White, P. O. (1964). Promax: A quick method for rotation to oblique simple structure. British Journal of Statistical Psychology, 17 , 65–70. doi: 10.1111/j.2044-8317.1964.tb00244.x

Lorenzo-Seva, U., Timmerman, M. E., & Kiers, H. A. L. (2011). The Hull Method for Selecting the Number of Common Factors, Multivariate Behavioral Research, 46, 340-364, doi: 10.1080/00273171.2011.564527

Kaiser, H. F. (1958). The varimax criterion for analytic rotation in factor analysis. Psychometrika, 23, 187–200. doi: 10.1007/BF02289233

Examples

## Not run: 
# Averaging across different implementations of PAF and promax rotation (72 EFAs)
Aver_PAF <- EFA_AVERAGE(test_models$baseline$cormat, n_factors = 3, N = 500)

# Use median instead of mean for averaging (72 EFAs)
Aver_PAF_md <- EFA_AVERAGE(test_models$baseline$cormat, n_factors = 3, N = 500,
                           averaging = "median")

# Averaging across different implementations of PAF and promax rotation,
# and across ULS and different versions of ML (108 EFAs)
Aver_meth_ext <- EFA_AVERAGE(test_models$baseline$cormat, n_factors = 3, N = 500,
                             method = c("PAF", "ULS", "ML"))

# Averaging across one implementation each of PAF (EFAtools type), ULS, and
# ML with one implementation of promax (EFAtools type) (3 EFAs)
Aver_meth <- EFA_AVERAGE(test_models$baseline$cormat, n_factors = 3, N = 500,
                         method = c("PAF", "ULS", "ML"), type = "EFAtools",
                         start_method = "psych")

# Averaging across different oblique rotation methods, using one implementation
# of ML and one implementation of promax (EFAtools type) (7 EFAs)
Aver_rot <- EFA_AVERAGE(test_models$baseline$cormat, n_factors = 3, N = 500,
                         method = "ML", rotation = "oblique", type = "EFAtools",
                         start_method = "psych")

## End(Not run)

## Not run: 
# Two-stage FIML correlations from raw data with missing values: the EM
# saturated moments are estimated once and the resulting correlation is
# averaged across the grid of EFAs.
x_miss <- GRiPS_raw
x_miss[cbind(1:20, 1)] <- NA
Aver_fiml <- EFA_AVERAGE(x_miss, n_factors = 1, method = c("PAF", "ML"),
                         cor_method = "fiml")

## End(Not run)


Exploratory factor analysis on multiple data imputations

Description

Fits EFA() to each of several imputed datasets, aligns the factor solutions to a common factor space, and pools the resulting estimates and selected fit quantities across imputations.

Usage

EFA_POOLED(
  data_list,
  p = 0.05,
  target_method = c("first_target", "consensus"),
  align_unrotated = c("signed_tucker_congruence", "none", "procrustes"),
  fit_pool_method = c("D2"),
  consensus_args = list(),
  procrustes_args = list(),
  rmsea_ci_level = 0.9,
  rmsr_upper = TRUE,
  ...
)

Arguments

data_list

A list of length m, where m is the number of imputations. Each list element is a data frame or matrix of raw data, or a correlation matrix. See argument x in EFA().

p

Numeric in (0, 1). One minus the confidence level used for pooled Wald-type bootstrap/MI confidence intervals when bootstrap replicates are available. For example, p = .05 gives 95% intervals.

target_method

Character. How rotated solutions are aligned across imputations before pooling: "first_target" (the default) aligns every imputation to the first imputation's rotated solution, while "consensus" refines a centroid target by Generalized Procrustes Analysis (orthogonal rotations only). See Aligning solutions across imputations in Details.

align_unrotated

Character. How unrotated loadings are aligned before pooling: "signed_tucker_congruence" (the default; sign/permutation via Tucker congruence), "procrustes" (orthogonal Procrustes to the first imputation), or "none". See Aligning solutions across imputations in Details.

fit_pool_method

Character. Currently only "D2" is implemented for chi-square-type fit. If no chi-square is available, only residual-based fit and descriptive quantities are returned. See Pooling the model chi-square and fit indices in Details.

consensus_args

List of additional arguments controlling the GPA-consensus iteration when target_method = "consensus". Recognised tuning parameters include the convergence tolerances tol and loss_tol, the iteration bounds min_iter and max_iter, the target-update damping alpha, and the multi-start controls multi_start and starts.

procrustes_args

List of additional arguments passed to PROCRUSTES for fixed-target alignment.

rmsea_ci_level

Numeric. Confidence level for the RMSEA CI.

rmsr_upper

Logical. If TRUE, compute RMSR from the unique off-diagonal residual correlations. If FALSE, use the full off-diagonal matrix.

...

Additional arguments passed to EFA() (e.g. method, rotation, se, n_factors, N). These select the estimator, rotation, standard-error method, and fit indices used for every imputation; see EFA() for the available options, their properties, and which combinations are valid.

Details

EFA_POOLED() is the multiple-imputation route to handling missing data: several imputed datasets are each fitted with EFA() and the solutions pooled. A single-fit alternative is full-information maximum likelihood, available directly in EFA() as cor_method = "fiml", which EM-estimates a two-stage correlation from one raw dataset with missing values. Both feed the same correlation-scale EFA core and differ only in how the missingness is handled; FIML is intentionally not routed through EFA_POOLED(), which is a multi-fit pooler by construction.

Standard-error pooling routes

The pooling pathway is selected automatically from the se method recorded on the component EFA() fits, which must be identical across imputations:

On the information and np-boot routes, if pooled standard errors cannot be produced (for example an unreliable analytic covariance or too few bootstrap replicates) the pool falls back to point-estimate-only pooling and downgrades settings$se to "none". The MI2S route is the exception: its single fit fuses the point estimates and standard errors through the pooled asymptotic covariance, so a structural failure aborts directly rather than falling back.

Aligning solutions across imputations

The same EFA() model is fitted to each imputed dataset and the solutions are put into a common factor space before averaging. For oblique solutions the factor intercorrelations are aligned together with the loadings so the model stays internally consistent.

target_method controls how rotated solutions are aligned. "first_target" (the default) aligns every imputation to the first imputation's rotated solution by one Procrustes rotation each. "consensus" instead refines a centroid target by Generalized Procrustes Analysis (Gower 1975; van Ginkel & Kroonenberg 2014; Lorenzo-Seva & Van Ginkel 2016). The two give the same pooled estimate for orthogonal rotations (consensus is just more expensive), and "consensus" is only supported there. Anchoring on the first imputation can understate the between-imputation variability when the imputations disagree substantially, whereas "consensus" is more robust to an atypical first imputation (van Ginkel & Kroonenberg 2014).

align_unrotated controls how unrotated loadings are aligned before pooling: "signed_tucker_congruence" (the default) matches them up to factor reordering and sign changes, "procrustes" aligns them to the first imputation by orthogonal Procrustes rotation, and "none" averages them as returned by EFA().

Pooling point estimates

Point estimates are pooled by arithmetic averaging after alignment. For oblique rotations the structure matrix is recomputed from the pooled pattern matrix and pooled factor correlations, Structure = \Lambda \Phi, and communalities are the diagonal of the reproduced correlation matrix, diag(\Lambda \Phi \Lambda') for oblique rotations and diag(\Lambda \Lambda') otherwise. Residuals are not averaged across imputations; they are the pooled observed correlation matrix minus the model-implied correlation of the pooled solution, so RMSR/SRMR are based on these pooled residuals. Both are returned, though the print and summary methods show SRMR only.

Pooling the model chi-square and fit indices

The model chi-square and the indices derived from it (RMSEA, ECVI, and the descriptive AIC/BIC) are pooled with the D2 rule (Li, Meng, Raghunathan & Rubin, 1991), not arithmetically averaged. Because D2 shrinks the pooled chi-square in proportion to the between-imputation variability, the pooled RMSEA can fall below the mean of the per-imputation RMSEAs (as it does in lavaan.mi); read it together with the per-imputation fit. The incremental indices CFI (Bentler, 1990) and TLI (Tucker & Lewis, 1973) are instead the average of the per-imputation indices, which keeps them consistent with the component fits and avoids the out-of-range values that separately pooling the model and baseline noncentralities (as lavaan.mi/semTools do) can produce; those separately pooled noncentralities remain available in mi_diagnostics. AIC and BIC, if returned, are chi-square-derived descriptive quantities and are not likelihood-based MI information criteria. On the sandwich/MI2S route the chi-square is the single fit's scaled statistic rather than a D2 pool.

Bootstrap pooling (np-boot)

If each component EFA call was run with se = "np-boot", pooled bootstrap SEs and Wald-type MI confidence intervals are computed for loadings, communalities, residuals, and, when applicable, factor correlations and structure coefficients. The unrotated bootstrap replicates are re-aligned to the final MI target before the within-imputation covariance is estimated, and Rubin pooling is applied with T = Ubar + (1 + 1/m) B. The confidence level of the pooled intervals is set by p, not by the component EFA calls' ci.

Analytic pooling (information)

With se = "information", the analytic unrotated-loading and uniqueness SEs returned by each fit are pooled element-wise with Rubin's rules (T = Ubar + (1 + 1/m) B), with Wald intervals on the plain Rubin (1987) degrees of freedom (the analytic loadings are asymptotically normal, so the Barnard-Rubin (1999) adjustment reduces to this form, matching lavaan.mi). NA propagation is fail-closed: if any imputation is NA at an element, all pooled outputs for that element are NA. When a rotation was requested, the rotated loadings, communalities, and (for oblique rotations) factor correlations and structure coefficients are pooled as well; residual SE pooling is available only on the bootstrap path. Under align_unrotated = "procrustes" the full unrotated covariance vcov_unrot_loadings (populated by se = "information") is propagated through the alignment, so it must be present and reliable on every fit.

A rotated-loading standard error is conditional on the rotation criterion (Jennrich 1973, 1974; Browne 2001; Zhang & Preacher 2015). For both orthogonal and oblique rotations the within-imputation variance is therefore each fit's own criterion-aware delta-method rotated SE (the quantity EFA() returns), reused after a signed-permutation alignment to the MI target, and the between-imputation variance is the sample variance of the aligned rotated loadings. This is a deliberate approximation – each SE is conditional on its own fit's rotation optimum rather than on a common gauge – and is flagged by ⁠MI$<param>$method = "signed_permutation_approx"⁠. Communalities are rotation-invariant and pool element-wise. For a fully gauge-consistent rotated uncertainty, cross-check with se = "np-boot".

Two-stage pooling (sandwich / MI2S)

With se = "sandwich" (robust SEs from a polychoric/tetrachoric or continuous-Pearson asymptotic covariance), pooling follows the two-stage, pooled-inputs approach (Chung & Cai 2019; Sriutaisuk, Liu, Chung, Kim & Gu 2025): the correlation matrix and the asymptotic covariance of its off-diagonal entries are Rubin-pooled across imputations,

\tilde\Gamma = \Gamma_W + \left(1 + \frac{1}{m}\right)\Gamma_B,

and a single EFA model is fitted to the pooled correlation with \tilde\Gamma as the robust meat (its diagonal as the weights for method = "DWLS"). Because there is only one fit and one rotational gauge, this route bypasses the per-imputation alignment: target_method and align_unrotated do not apply. The fitted object carries native scaled-shifted chi-square statistics and sandwich SEs that already reflect the multiple-imputation uncertainty, so the chi-square is not D2-pooled and the likelihood-ratio-based AIC/BIC/ECVI are NA; it is returned in the mi_fit slot, with the per-imputation fits retained for diagnostics. At least 20 imputations are recommended for the scaled-shifted statistic, and more (around 100) at higher rates of missingness (Sriutaisuk et al. 2025). The polychoric/tetrachoric (ordinal) case is the primary, best-evaluated target; the continuous-Pearson case uses the same recipe but is less benchmarked.

Value

A list of class "EFA_POOLED" containing pooled estimates, residuals, fit indices, the individual fits, and MI diagnostics. In addition to the slots inherited from EFA() (including SE, CI, and, on the bootstrap path, replicates), the object carries:

MI

Multiple-imputation diagnostics for each pooled parameter family. On the bootstrap path: unrot_loadings, h2, residuals, optionally rot_loadings, Phi, Structure, and fit_indices_descriptive, plus integer vectors bootstrap_source_failures (replicates the component EFA could not fit), bootstrap_rotation_failures (replicates whose Procrustes alignment to the target was invalid), and bootstrap_rotation_valid (those that entered the pool, B - source - rotation failures). Both paths use the plain Rubin (1987) df. On the analytic path (se = "information"): unrot_loadings and uniquenesses, plus, when a rotation was requested, rot_loadings, h2, and (oblique) Phi and Structure. Each per-family entry is a list with RIV (relative increase in variance), FMI (the fraction of missing information, reported as Rubin's asymptotic \lambda = RIV / (1 + RIV), equal to lavaan.mi's fmi), and df; the rotated families on the analytic path additionally carry a method string recording the gauge alignment used ("gauge_invariant" for communalities and "signed_permutation_approx" for rotated loadings and, for oblique rotations, factor correlations and structure coefficients). fit_indices_descriptive, on the bootstrap path, pools every per-imputation fit index, so the structural constants among them (df, df_null) appear with a standard error of 0.

mi_fit

On the se = "sandwich" (MI2S) path only: the single EFA() fit on the pooled correlation matrix \bar r and pooled asymptotic covariance \tilde\Gamma. Its orig_R is \bar r and its Gamma is \tilde\Gamma; the pooled SE, CI, and fit_indices are taken from it. MI is NULL on this path because the imputation uncertainty is carried by \tilde\Gamma rather than by per-parameter Rubin pooling.

Conditions

All conditions are classed (prefix efa_pooled_, or efa_consensus_ for the consensus target) so they can be caught by class. The ones most likely to be encountered:

The remaining conditions concern partial or insufficient bootstrap replicates and unequal sample sizes across imputations.

Author(s)

Andreas Soteriades, Markus Steiner

References

Barnard, J., & Rubin, D. B. (1999). Small-sample degrees of freedom with multiple imputation. Biometrika, 86(4), 948-955.

Bentler, P. M. (1990). Comparative fit indexes in structural models. Psychological Bulletin, 107(2), 238-246.

Browne, M. W. (2001). An overview of analytic rotation in exploratory factor analysis. Multivariate Behavioral Research, 36(1), 111-150.

Chan, K. W., & Meng, X.-L. (2022). Multiple improvements of multiple imputation likelihood ratio tests. Statistica Sinica, 32, 1489-1514.

Chung, S., & Cai, L. (2019). Alternative multiple imputation inference for categorical structural equation modeling. Multivariate Behavioral Research, 54(3), 323-337.

Gower, J. C. (1975). Generalized Procrustes analysis. Psychometrika, 40(1), 33-51.

Li, K. H., Meng, X.-L., Raghunathan, T. E., & Rubin, D. B. (1991). Significance levels from repeated p-values with multiply-imputed data. Statistica Sinica, 1(1), 65-92.

Jennrich, R. I. (1973). Standard errors for obliquely rotated factor loadings. Psychometrika, 38(4), 593-604.

Jennrich, R. I. (1974). Simplified formulae for standard errors in maximum-likelihood factor analysis. British Journal of Mathematical and Statistical Psychology, 27(1), 122-131.

Lorenzo-Seva, U., & Van Ginkel, J. R. (2016). Multiple imputation of missing values in exploratory factor analysis of multidimensional scales. Anales de Psicologia, 32(2), 596-608.

Rubin, D. B. (1987). Multiple imputation for nonresponse in surveys. Wiley.

Schoenemann, P. H. (1966). A generalized solution of the orthogonal Procrustes problem. Psychometrika, 31(1), 1-10.

Sriutaisuk, S., Liu, Y., Chung, S., Kim, H., & Gu, F. (2025). Evaluating imputation-based fit statistics in structural equation modeling with ordinal data: The MI2S approach. Educational and Psychological Measurement, 85(1), 82-113.

Tucker, L. R., & Lewis, C. (1973). A reliability coefficient for maximum likelihood factor analysis. Psychometrika, 38(1), 1-10.

van Ginkel, J. R., & Kroonenberg, P. M. (2014). Using generalized Procrustes analysis for multiple imputation in principal component analysis. Journal of Classification, 31(2), 242-269.

Zhang, G., & Preacher, K. J. (2015). Factor rotation and standard errors in exploratory factor analysis. Journal of Educational and Behavioral Statistics, 40(6), 579-603.

Examples


# create a list of three datasets, mimicking a list you would obtain from
# e.g. mice.
dat_list <- lapply(1:3, function(x) GRiPS_raw[sample(1:nrow(GRiPS_raw), replace = TRUE),])
mod <- EFA_POOLED(dat_list, n_factors = 1, method = "ML")
mod


# add computation of standard errors and CIs
mod <- EFA_POOLED(dat_list, n_factors = 1, method = "ML", se = "np-boot")
mod


Empirical Kaiser Criterion

Description

The empirical Kaiser criterion incorporates random sampling variations of the eigenvalues from the Kaiser-Guttman criterion (KGC(); see Auerswald & Moshagen , 2019; Braeken & van Assen, 2017). The code is based on Braeken & van Assen, (2017) and on Auerswald and Moshagen (2019).

Usage

EKC(
  x,
  N = NA,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  type = "BvA2017"
)

Arguments

x

data.frame or matrix. data.frame or matrix of raw data or matrix with correlations.

N

numeric. The number of observations. Only needed if x is a correlation matrix.

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. Correlation computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()), or "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data (a two-step estimator with no empty-cell continuity correction). Default is "pearson".

type

character. The calculation of EKC. type "BvA2017" is the original implementation; type "AM2019" differs from the original implementation but was used in simulation studies (Auerswald & Moshagen, 2019; Caron, 2025). See details. Use type = c("BvA2017", "AM2019") for both implementations. Make sure to report which version you used.

Details

The Kaiser-Guttman criterion was defined with the intend that a factor should only be extracted if it explains at least as much variance as a single factor (see KGC()). However, this only applies to population-level correlation matrices. Due to sampling variation, the KGC strongly overestimates the number of factors to retrieve (e.g., Zwick & Velicer, 1986). To account for this and to introduce a factor retention method that performs well with small number of indicators and correlated factors (cases where the performance of parallel analysis, see PARALLEL(), is known to deteriorate) Braeken and van Assen (2017) introduced the empirical Kaiser criterion in which a series of reference eigenvalues is created as a function of the variables-to-sample-size ratio and the observed eigenvalues.

Braeken and van Assen (2017) showed that "(a) EKC performs about as well as parallel analysis for data arising from the null, 1-factor, or orthogonal factors model; and (b) clearly outperforms parallel analysis for the specific case of oblique factors, particularly whenever factor intercorrelation is moderate to high and the number of variables per factor is small, which is characteristic of many applications these days" (p.463-464).

In EFAtools version <= 0.5.0 only the implementation of Auerswald and Moshagen (2019) was implemented (now available with type = "AM2019"). However, this implementation, that was probably also used in Caron (2025), differs from the original implementation by Braeken and van Assen (2017) in that it corrects by the reference values, i.e., without using the empirical eigenvalues used in the original implementation. Thanks to Luis Eduardo Garrido for pointing this out and to Johan Braeken for sharing sample code, based on which the original version is now implemented and used by default with type = "BvA2017".

While the adapted version performed relatively well in the simulation studies by Auerswald and Moshagen (2019) and Caron (2025), the theoretical derivations of the EKC as introduced by Braeken and van Assen (2017) may no longer hold. Currently we are unaware of studies comparing the two implementations, but based on our own brief comparisons across multiple datasets, the two implementations appear to often differ substantially regarding the number of factors suggested.

As both implementations exist in different packages and studies, we provide both versions here. Be sure to state clearly which version you use when reporting your results to avoid confusion and ensure reproducibility.

Value

An object of class efa_retention (see print.efa_retention() and plot.efa_retention() for the print and plot methods). Its main fields are:

n_factors

A named numeric vector with the suggested number of factors for each requested implementation ("BvA2017" and/or "AM2019").

results

A list with one record per implementation, each holding the eigenvalues, the reference eigenvalues, and the retained solution used for printing and plotting.

settings

A list with the settings used.

Source

Auerswald, M., & Moshagen, M. (2019). How to determine the number of factors to retain in exploratory factor analysis: A comparison of extraction methods under realistic conditions. Psychological Methods, 24(4), 468–491. https://doi.org/10.1037/met0000200

Braeken, J., & van Assen, M. A. (2017). An empirical Kaiser criterion. Psychological Methods, 22, 450 – 466. http://dx.doi.org/10.1037/met0000074

Caron, P.-O. (2025). A Comparison of the Next Eigenvalue Sufficiency Test to Other Stopping Rules for the Number of Factors in Factor Analysis. Educational and Psychological Measurement, Online-first publication. https://doi.org/10.1177/00131644241308528

Zwick, W. R., & Velicer, W. F. (1986). Comparison of five rules for determining the number of components to retain. Psychological Bulletin, 99, 432–442. http://dx.doi.org/10.1037/0033-2909.99.3.432

See Also

N_FACTORS() as a wrapper function for this and the other factor retention criteria.

Other factor retention criteria: CD(), HULL(), KGC(), MAP(), NEST(), PARALLEL(), SCREE(), SMT()

Examples

# original implementation
EKC(test_models$baseline$cormat, N = 500)

Estimate factor scores for an EFA model

Description

A convenience wrapper around efa_scores() that returns factor scores and weights in a compact list. Factor scores are calculated according to the specified method if raw data are provided, and only factor weights if a correlation matrix is provided.

Usage

FACTOR_SCORES(
  x,
  f,
  Phi = NULL,
  rho = NULL,
  method = c("Thurstone", "tenBerge", "Anderson", "Bartlett", "Harman", "components")
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data (needed to get factor scores) or matrix with correlations.

f

object of class EFA() or matrix.

Phi

matrix. A matrix of factor intercorrelations. Only needs to be specified if a factor loadings matrix is entered directly into f; for an EFA() object the intercorrelations are taken from the object. Default is NULL, in which case the intercorrelations of a directly supplied loading matrix are assumed to be zero.

rho

matrix. Correlation matrix used to derive the scoring weights. Defaults to NULL, in which case the matrix the EFA in f was fit on (f$orig_R) is used, so the weights stay consistent with the loadings even for a non-Pearson correlation (e.g. polychoric); for a directly supplied loading matrix, x itself is used when it is a correlation matrix, otherwise the Pearson correlation of x. Pass a matrix here to score against a different correlation.

method

character. The method used to calculate factor scores. One of "Thurstone" (regression-based; default), "tenBerge", "Anderson", "Bartlett", "Harman", or "components".

Value

A list of class FACTOR_SCORES containing the following:

scores

The factor scores (only if raw data are provided.)

weights

The factor weights.

r.scores

The correlations of the factor score estimates.

missing

Whether the raw data contained missing values (only if raw data are provided).

R2

The squared factor-score determinacy for each factor: the squared correlation between a factor and its estimated score. For orthogonal factors this equals the squared multiple correlation between the factor and the observed variables; for oblique factors it is the score-specific determinacy. See efa_scores() for the underlying score-quality diagnostics.

settings

A list of the settings used.

See Also

efa_scores() for the factor-score weights together with the full set of score-quality diagnostics (determinacy, univocality, and Guttman indeterminacy index) and a print/summary method.

Other factor scoring: efa_scores(), print.efa_scores()

Examples

# Example with raw data with method "Bartlett"
EFA_raw <- EFA(DOSPERT_raw, n_factors = 10, type = "EFAtools", method = "PAF",
               rotation = "oblimin", randomStarts = 0)
fac_scores_raw <- FACTOR_SCORES(DOSPERT_raw, f = EFA_raw, method = "Bartlett")

# Same as above, but with raw data AND a correlation matrix
cor_pearson <- cor(DOSPERT_raw)
EFA_cor_pearson <- EFA(cor_pearson, n_factors = 10, N = nrow(DOSPERT_raw),
                       type = "EFAtools", method = "PAF",
                       rotation = "oblimin", randomStarts = 0)
fac_scores_cor_pearson <- FACTOR_SCORES(DOSPERT_raw, f = EFA_cor_pearson,
                                        rho = cor_pearson,
                                        method = "Bartlett")

# Scores between two alternatives above are identical
isTRUE(all.equal(fac_scores_raw$scores, fac_scores_cor_pearson$scores,
                 check.attributes = FALSE))

# Example with a correlation matrix only (does not return factor scores)
EFA_cor <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500,
               type = "EFAtools", method = "PAF", rotation = "oblimin")
fac_scores_cor <- FACTOR_SCORES(test_models$baseline$cormat, f = EFA_cor)


GRiPS_raw

Description

A data.frame containing responses to the General Risk Propensity Scale (GRiPS, Zhang, Highhouse & Nye, 2018) of 810 participants of Study 1 of Steiner and Frey (2020). The original data can be accessed via https://osf.io/kxp8t/.

Usage

GRiPS_raw

Format

An object of class data.frame with 810 rows and 8 columns.

Source

Zhang, D. C., Highhouse, S., & Nye, C. D. (2018). Development and validation of the general risk propensity scale (GRiPS).Journal of Behavioral Decision Making, 32, 152–167. doi: 10.1002/bdm.2102

Steiner, M., & Frey, R. (2020). Representative design in psychological assessment: A case study using the Balloon Analogue Risk Task (BART). PsyArXiv Preprint. doi:10.31234/osf.io/dg4ks


Hull method for determining the number of factors to retain

Description

Implementation of the Hull method suggested by Lorenzo-Seva, Timmerman, and Kiers (2011), with an extension to principal axis factoring. See details for parallelization.

Usage

HULL(
  x,
  N = NA,
  n_fac_theor = NA,
  method = c("PAF", "ULS", "ML"),
  gof = c("CAF", "CFI", "RMSEA"),
  eigen_type = c("SMC", "PCA", "EFA"),
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  n_datasets = 1000,
  percent = 95,
  decision_rule = c("means", "percentile", "crawford"),
  n_factors = 1,
  ...
)

Arguments

x

matrix or data.frame. Dataframe or matrix of raw data or matrix with correlations.

N

numeric. Number of cases in the data. This is passed to PARALLEL. Only has to be specified if x is a correlation matrix, otherwise it is determined based on the dimensions of x.

n_fac_theor

numeric. Theoretical number of factors to retain. One plus the larger of this number and the number of factors suggested by PARALLEL is used as the upper bound J of factors to extract in the Hull method.

method

character. The estimation method to use. One of "PAF", "ULS", or "ML", for principal axis factoring, unweighted least squares, and maximum likelihood, respectively.

gof

character. The goodness of fit index to use. Either "CAF", "CFI", or "RMSEA", or any combination of them. If method = "PAF" is used, only the CAF can be used as goodness of fit index. For details on the CAF, see Lorenzo-Seva, Timmerman, and Kiers (2011).

eigen_type

character. On what the eigenvalues should be found in the parallel analysis. Can be one of "SMC", "PCA", or "EFA". If using "SMC" (default), the diagonal of the correlation matrices is replaced by the squared multiple correlations (SMCs) of the indicators. If using "PCA", the diagonal values of the correlation matrices are left to be 1. If using "EFA", eigenvalues are found on the correlation matrices with the final communalities of an EFA solution as diagonal. This is passed to PARALLEL().

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. One of "pearson", "spearman", or "kendall", passed to stats::cor(). "poly" and "tetra" are not supported because HULL derives its factor-search bound from an internal parallel analysis against continuous reference data. Default is "pearson".

n_datasets

numeric. The number of datasets to simulate. Default is 1000. This is passed to PARALLEL().

percent

numeric. The percentile to take from the simulated eigenvalues. Default is 95. This is passed to PARALLEL().

decision_rule

character. Which rule to use to determine the number of factors to retain. Default is "means", which will use the average simulated eigenvalues. "percentile", uses the percentiles specified in percent. "crawford" uses the 95th percentile for the first factor and the mean afterwards (based on Crawford et al, 2010). This is passed to PARALLEL().

n_factors

numeric. Number of factors to extract if "EFA" is included in eigen_type. Default is 1. This is passed to PARALLEL().

...

Further arguments passed to EFA(), also in PARALLEL().

Details

The Hull method aims to find a model with an optimal balance between model fit and number of parameters, retaining only major factors (Lorenzo-Seva, Timmerman, & Kiers, 2011). It fits 0 to J factors – where J is the number of factors suggested by parallel analysis (or n_fac_theor, if that is larger), plus one – keeps the solutions on the upper boundary of the convex hull of goodness-of-fit against degrees of freedom, and selects the one at the sharpest elbow, i.e. with the highest st value.

The PARALLEL function and the principal axis factoring of the different number of factors can be parallelized using the future framework, by calling the future::plan() function. The examples provide example code on how to enable parallel processing.

Note that if gof = "RMSEA" is used, 1 - RMSEA is actually used to compare the different solutions. Thus, the threshold of .05 is then .95. This is necessary due to how the heuristic to locate the elbow of the hull works.

The ML estimation method uses the psych::fa() starting values. See also the EFA documentation.

Value

An object of class efa_retention (see print.efa_retention() and plot.efa_retention() for the print and plot methods). Its main fields are:

n_factors

A named numeric vector with the suggested number of factors for each requested goodness-of-fit index ("CAF", "CFI", and/or "RMSEA").

results

A list with one record per goodness-of-fit index, each holding the goodness-of-fit values, the degrees of freedom, the hull membership, and the retained solution used for printing and plotting.

settings

A list of the settings used, including n_fac_max, the upper bound J of the number of factors to extract (see details).

Source

Lorenzo-Seva, U., Timmerman, M. E., & Kiers, H. A. (2011). The Hull method for selecting the number of common factors. Multivariate Behavioral Research, 46(2), 340-364.

See Also

N_FACTORS() as a wrapper function for this and the other factor retention criteria.

Other factor retention criteria: CD(), EKC(), KGC(), MAP(), NEST(), PARALLEL(), SCREE(), SMT()

Examples


# using PAF (this will throw a warning if gof is not specified manually
# and CAF will be used automatically)
HULL(test_models$baseline$cormat, N = 500, gof = "CAF")

# using ML with all available fit indices (CAF, CFI, and RMSEA)
HULL(test_models$baseline$cormat, N = 500, method = "ML")

# using ULS with only RMSEA
HULL(test_models$baseline$cormat, N = 500, method = "ULS", gof = "RMSEA")


## Not run: 
# using parallel processing (Note: plans can be adapted, see the future
# package for details)
future::plan(future::multisession)
HULL(test_models$baseline$cormat, N = 500, gof = "CAF")

## End(Not run)

Intelligence subtests from the Intelligence and Development Scales–2

Description

A matrix containing the bivariate correlations of the 14 intelligence subtests from the Intelligence and Development Scales–2 (IDS-2; Grob & Hagmann-von Arx, 2018), an intelligence and development test battery for children and adolescents aged 5 to 20 years, for the standardization and validation sample (N = 1,991). Details can be found in Grieder & Grob (2019).

Usage

IDS2_R

Format

A 14 x 14 matrix of bivariate correlations

GS

(numeric) - Geometric shapes.

PL

(numeric) - Plates.

TC

(numeric) - Two characteristics.

CB

(numeric) - Crossing out boxes.

NL

(numeric) - Numbers / letters.

NLM

(numeric) - Numbers / letter mixed.

GF

(numeric) - Geometric figures.

RGF

(numeric) - Rotated geometric figures.

CM

(numeric) - Completing matrices.

EP

(numeric) - Excluding pictures.

CA

(numeric) - Categories.

OP

(numeric) - Opposites.

RS

(numeric) - Retelling a story.

DP

(numeric) - Describing pictures.

Source

Grieder, S., & Grob, A. (2019). Exploratory factor analyses of the intelligence and development scales–2: Implications for theory and practice. Assessment. Advance online publication. doi:10.1177/10731911198450

Grob, A., & Hagmann-von Arx, P. (2018). Intelligence and Development Scales–2 (IDS-2). Intelligenz- und Entwicklungsskalen für Kinder und Jugendliche. [Intelligence and Development Scales for Children and Adolescents.]. Bern, Switzerland: Hogrefe.


Kaiser-Guttman Criterion

Description

Probably the most popular factor retention criterion. Kaiser and Guttman suggested to retain as many factors as there are sample eigenvalues greater than 1. This is why the criterion is also known as eigenvalues-greater-than-one rule.

Usage

KGC(
  x,
  eigen_type = c("PCA", "SMC", "EFA"),
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  n_factors = 1,
  ...
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data or matrix with correlations.

eigen_type

character. On what the eigenvalues should be found. Can be either "PCA", "SMC", or "EFA", or some combination of them. If using "PCA", the diagonal values of the correlation matrices are left to be 1. If using "SMC", the diagonal of the correlation matrices is replaced by the squared multiple correlations (SMCs) of the indicators. If using "EFA", eigenvalues are found on the correlation matrices with the final communalities of an exploratory factor analysis solution (default is principal axis factoring extracting 1 factor) as diagonal.

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. Correlation computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()), or "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data (a two-step estimator with no empty-cell continuity correction). Default is "pearson".

n_factors

numeric. Number of factors to extract if "EFA" is included in eigen_type. Default is 1.

...

Additional arguments passed to EFA(). For example, to change the extraction method (PAF is default).

Details

Originally, the Kaiser-Guttman criterion was intended for the use with principal components, hence with eigenvalues derived from the original correlation matrix. This can be done here by setting eigen_type to "PCA". However, it is well-known that this criterion is often inaccurate and that it tends to overestimate the number of factors, especially for unidimensional or orthogonal factor structures (e.g., Zwick & Velicer, 1986).

The criterion's inaccuracy in these cases is somewhat addressed if it is applied on the correlation matrix with communalities in the diagonal, either initial communalities estimated from SMCs (done setting eigen_type to "SMC") or final communality estimates from an EFA (done setting eigen_type to "EFA"; see Auerswald & Moshagen, 2019). However, although this variant of the KGC is more accurate in some cases compared to the traditional KGC, it is at the same time less accurate than the PCA-variant in other cases, and it is still often less accurate than other factor retention methods, for example parallel analysis (PARALLEL()), the Hull method HULL(), or sequential chi^2 model tests (SMT(); see Auerswald & Moshagen, 2019).

The KGC function can also be called together with other factor retention criteria in the N_FACTORS() function.

Value

An object of class efa_retention (see print.efa_retention() and plot.efa_retention() for the print and plot methods). Its main fields are:

n_factors

A named numeric vector with the suggested number of factors for each requested eigenvalue type ("PCA", "SMC", and/or "EFA").

results

A list with one record per eigenvalue type, each holding the eigenvalues and the retained solution used for printing and plotting.

settings

A list of the settings used.

Source

Auerswald, M., & Moshagen, M. (2019). How to determine the number of factors to retain in exploratory factor analysis: A comparison of extraction methods under realistic conditions. Psychological Methods, 24(4), 468–491. https://doi.org/10.1037/met0000200

Guttman, L. (1954). Some necessary conditions for common-factor analysis. Psychometrika, 19, 149 –161. http://dx.doi.org/10.1007/BF02289162

Kaiser, H. F. (1960). The application of electronic computers to factor analysis. Educational and Psychological Measurement, 20, 141–151. http://dx.doi.org/10.1177/001316446002000116

Zwick, W. R., & Velicer, W. F. (1986). Comparison of five rules for determining the number of components to retain. Psychological Bulletin, 99, 432–442. http://dx.doi.org/10.1037/0033-2909.99.3.432

See Also

N_FACTORS() as a wrapper function for this and the other factor retention criteria.

Other factor retention criteria: CD(), EKC(), HULL(), MAP(), NEST(), PARALLEL(), SCREE(), SMT()

Examples

KGC(test_models$baseline$cormat, eigen_type = c("PCA", "SMC"))

Kaiser-Meyer-Olkin criterion

Description

This function computes the Kaiser-Meyer-Olkin (KMO) criterion overall and for each variable in a correlation matrix. The KMO represents the degree to which each observed variable is predicted by the other variables in the dataset and with this indicates the suitability for factor analysis.

Usage

KMO(
  x,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra")
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data or matrix with correlations.

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. Correlation computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()), or "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data (a two-step estimator with no empty-cell continuity correction). Default is "pearson".

Details

Kaiser (1970) proposed this index, originally called measure of sampling adequacy (MSA), that indicates how near the inverted correlation matrix R^{-1} is to a diagonal matrix S to determine a given correlation matrix's (R) suitability for factor analysis. The index is

KMO = \frac{\sum_{i \neq j} r_{ij}^2}{\sum_{i \neq j} r_{ij}^2 + \sum_{i \neq j} q_{ij}^2}

with Q = SR^{-1}S and S = (diag R^{-1})^{-1/2} where \sum_{i \neq j} r_{ij}^2 is the sum of squares of the off-diagonal elements of R and \sum_{i \neq j} q_{ij}^2 is the sum of squares of the off-diagonal elements of Q (see also Cureton & D'Agostino, 1983).

So KMO varies between 0 and 1, with larger values indicating higher suitability for factor analysis. Kaiser and Rice (1974) suggest that KMO should at least exceed .50 for a correlation matrix to be suitable for factor analysis.

This function was heavily influenced by the psych::KMO() function.

See also BARTLETT() for another test of suitability for factor analysis.

The KMO function can also be called together with the BARTLETT() function and with factor retention criteria in the N_FACTORS() function.

Value

A list containing

KMO

Overall KMO.

KMO_i

KMO for each variable.

settings

A list of the settings used.

Source

Kaiser, H. F. (1970). A second generation little jiffy. Psychometrika, 35, 401-415.

Kaiser, H. F. & Rice, J. (1974). Little jiffy, mark IV. Educational and Psychological Measurement, 34, 111-117.

Cureton, E. E. & D'Agostino, R. B. (1983). Factor analysis: An applied approach. Hillsdale, N.J.: Lawrence Erlbaum Associates, Inc.

See Also

BARTLETT() for another measure to determine suitability for factor analysis.

N_FACTORS() as a wrapper function for this function, BARTLETT() and several factor retention criteria.

Examples

KMO(test_models$baseline$cormat)

Velicer's Minimum Average Partial (MAP) Criterion

Description

Computes Velicer's Minimum Average Partial (MAP) criterion for determining the number of factors/components to retain. The function implements the original MAP criterion (Velicer, 1976), expressed via the \mathrm{TR2} representation, and the revised \mathrm{TR4} variant proposed by Velicer, Eaton, and Fava (2000).

Usage

MAP(
  x,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra")
)

Arguments

x

A numeric matrix or data.frame. Can be either (a) a correlation matrix, or (b) raw data (rows = observations, columns = variables) from which correlations are computed.

use

Character string specifying the treatment of missing values when computing correlations. Passed to stats::cor(). Defaults to "pairwise.complete.obs".

cor_method

Character string specifying the correlation coefficient to be computed if raw data are supplied. One of "pearson", "spearman", or "kendall" (passed to stats::cor()), or "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data (a two-step estimator with no empty-cell continuity correction). Defaults to "pearson".

Details

MAP partials successive principal components out of the correlation matrix and, after removing m components, summarizes the off-diagonal partial correlations r^*_{ij} that remain; the suggested number of factors is the m that minimizes the criterion. Two criteria are returned:

A non-positive-definite input correlation matrix (e.g. from sampling error) is smoothed with psych::cor.smooth().

Value

An object of class efa_retention (see print.efa_retention() for the print method) with the following main elements:

Source

Velicer, W. F. (1976). Determining the number of components from the matrix of partial correlations. Psychometrika, 41, 321–327.

Velicer, W. F., Eaton, C. A., & Fava, J. L. (2000). Construct explication through factor or component analysis: A review and evaluation of alternative procedures for determining the number of factors or components. In Goffin, R. D. & Helmes, E. (Eds.), Problems and Solutions in Human Assessment: Honoring Douglas N. Jackson at Seventy (pp. 41–71). Boston: Kluwer.

See Also

N_FACTORS() as a wrapper function for this and the other factor retention criteria.

Other factor retention criteria: CD(), EKC(), HULL(), KGC(), NEST(), PARALLEL(), SCREE(), SMT()

Examples

## Example with raw data
res <- MAP(GRiPS_raw)
res

## Example with a correlation matrix
res2 <- MAP(test_models$baseline$cormat)
res2


Next eigenvalue sufficiency test (NEST)

Description

NEST uses many synthetic datasets to generate reference eigenvalues against which to compare the empirical eigenvalues. This is similar to parallel analysis, but other than parallel analysis, NEST does not just rely on synthetic eigenvalues based on an identity matrix as null model. It was introduced by Achim (2017), see also Brandenburg and Papenberg (2024) and Caron (2025) for further simulation studies including NEST.

Usage

NEST(
  x,
  N = NA,
  alpha = 0.05,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  n_datasets = 1000,
  ...
)

Arguments

x

data.frame or matrix. data.frame or matrix of raw data or matrix with correlations.

N

numeric. The number of observations. Only needed if x is a correlation matrix.

alpha

numeric. The alpha level to use (i.e., 1-alpha percentile of eigenvalues is used for reference values).

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. One of "pearson", "spearman", or "kendall", passed to stats::cor(). "poly" and "tetra" are not supported because NEST compares the data against simulated continuous reference data. Default is "pearson".

n_datasets

numeric. The number of datasets to simulate. Default is 1000.

...

Additional arguments passed to EFA(). For example, the extraction method can be changed here (default is "PAF"). PAF is more robust, but it will take longer compared to the other estimation methods available ("ML" and "ULS").

Details

NEST compares the first empirical eigenvalue against the first eigenvalues of n_dataset synthetic datasets based on a null model (i.e., with uncorrelated variables; same as in parallel analysis, see PARALLEL()). The following eigenvalues are compared against synthetic datasets based on an EFA-model with one fewer factors than the position of the respective empirical eigenvalue. E.g, the second empirical eigenvalue is compared against synthetic data based on a one-factor model. In each comparison the k-th empirical eigenvalue is tested against the k-th largest eigenvalue of the synthetic datasets. The alpha-level defines against which percentile of the synthetic eigenvalue distribution to compare the empirical eigenvalues against, i.e., an alpha of .05 (the default) uses the 95th percentile as reference value.

The number of factors tested is capped at \lfloor 0.8 \times p \rfloor (with p the number of variables; Achim, 2017) and additionally limited so that the (k - 1)-factor reference model used at each step stays over-identified. If no empirical eigenvalue falls at or below its reference within this range, every tested factor is accepted and this capped number is returned.

For details on the method, including simulation studies, see Achim (2017), Brandenburg and Papenberg (2024), and Caron (2025).

The NEST function can also be called together with other factor retention criteria in the N_FACTORS() function.

Value

An object of class efa_retention (see print.efa_retention() for the print method). Its main fields are:

n_factors

A named numeric vector ("NEST") with the suggested number of factors according to the NEST procedure.

results

A list with a single record holding the empirical eigenvalues and the reference eigenvalues.

settings

A list of control settings used.

Source

Achim, A. (2017). Testing the number of required dimensions in exploratory factor analysis. The Quantitative Methods for Psychology, 13(1), 64–74. https://doi.org/10.20982/tqmp.13.1.p064

Brandenburg, N., & Papenberg, M. (2024). Reassessment of innovative methods to determine the number of factors: A simulation-based comparison of exploratory graph analysis and Next Eigenvalue Sufficiency Test. Psychological Methods, 29(1), 21–47. https://doi.org/10.1037/met0000527

Caron, P.-O. (2025). A Comparison of the Next Eigenvalue Sufficiency Test to Other Stopping Rules for the Number of Factors in Factor Analysis. Educational and Psychological Measurement, Online-first publication. https://doi.org/10.1177/00131644241308528

See Also

N_FACTORS() as a wrapper function for this and the other factor retention criteria.

Other factor retention criteria: CD(), EKC(), HULL(), KGC(), MAP(), PARALLEL(), SCREE(), SMT()

Examples


# with correlation matrix
NEST(test_models$baseline$cormat, N = 500)

# with raw data
NEST(GRiPS_raw)

Various Factor Retention Criteria

Description

Among the most important decisions for an exploratory factor analysis (EFA) is the choice of the number of factors to retain. Several factor retention criteria have been developed for this. With this function, various factor retention criteria can be performed simultaneously. Additionally, the data can be checked for their suitability for factor analysis.

Usage

N_FACTORS(
  x,
  criteria = c("CD", "EKC", "HULL", "MAP", "NEST", "PARALLEL"),
  suitability = TRUE,
  N = NA,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  n_factors_max = NA,
  N_pop = 10000,
  N_samples = 500,
  alpha = 0.3,
  max_iter_CD = 50,
  n_fac_theor = NA,
  method = c("ML", "PAF", "ULS"),
  gof = c("CAF", "CFI", "RMSEA"),
  eigen_type_HULL = c("SMC", "PCA", "EFA"),
  eigen_type_other = c("SMC"),
  n_factors = 1,
  n_datasets = 1000,
  percent = 95,
  decision_rule = c("means", "percentile", "crawford"),
  ekc_type = c("BvA2017"),
  n_datasets_nest = 1000,
  alpha_nest = 0.05,
  show_progress = FALSE,
  ...
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data or matrix with correlations. If "CD" is included as a criterion, x must be raw data.

criteria

character. A vector with the factor retention methods to perform. Possible inputs are: "CD", "EKC", "HULL", "KGC", "MAP", "NEST","PARALLEL", "SCREE", and "SMT" (see details). By default, a subset of often used, well-performing methods are performed.

suitability

logical. Whether the data should be checked for suitability for factor analysis using the Bartlett's test of sphericity and the Kaiser-Meyer-Olkin criterion (see details). Default is TRUE.

N

numeric. The number of observations. Only needed if x is a correlation matrix.

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. Correlation computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()), or "poly" / "tetra" for polychoric / tetrachoric correlations (a two-step estimator with no empty-cell continuity correction). CD, PARALLEL, NEST, and HULL compare against simulated continuous data, and SMT relies on a normal-theory chi-square test; none of these support "poly" / "tetra", so they are skipped in that case. Default is "pearson".

n_factors_max

numeric. Passed to CD(). The maximum number of factors to test against. Larger numbers will increase the duration the procedure takes, but test more possible solutions. If left NA (default), the maximum number of factors for which the model is still over-identified (df > 0) is used.

N_pop

numeric. Passed to CD(). Size of finite populations of comparison data. Default is 10000.

N_samples

numeric. Passed to CD(). Number of samples drawn from each population. Default is 500.

alpha

numeric. Passed to CD(). The alpha level used to test the significance of the improvement added by an additional factor. Default is .30.

max_iter_CD

numeric. Passed to CD(). The maximum number of iterations to perform after which the iterative PAF procedure is halted. Default is 50.

n_fac_theor

numeric. Passed to HULL(). Theoretical number of factors to retain. The maximum of this number and the number of factors suggested by PARALLEL plus one will be used in the Hull method.

method

character. Passed to EFA() in HULL(), KGC(), SCREE(), PARALLEL(), and NEST(). The estimation method to use. One of "PAF", "ULS", or "ML", for principal axis factoring, unweighted least squares, and maximum likelihood, respectively. In KGC(), SCREE(), and PARALLEL() it only takes effect when the respective eigen_type includes "EFA".

gof

character. Passed to HULL(). The goodness of fit index to use. Either "CAF", "CFI", or "RMSEA", or any combination of them. If method = "PAF" is used, only the CAF can be used as goodness of fit index. For details on the CAF, see Lorenzo-Seva, Timmerman, and Kiers (2011).

eigen_type_HULL

character. Passed to PARALLEL() in HULL(). On what the eigenvalues should be found in the parallel analysis. Can be one of "SMC", "PCA", or "EFA". If using "SMC" (default), the diagonal of the correlation matrices is replaced by the squared multiple correlations (SMCs) of the indicators. If using "PCA", the diagonal values of the correlation matrices are left to be 1. If using "EFA", eigenvalues are found on the correlation matrices with the final communalities of an EFA solution as diagonal.

eigen_type_other

character. Passed to KGC(), SCREE(), and PARALLEL(). The same as eigen_type_HULL, but multiple inputs are possible here (any combination of "PCA", "SMC", and "EFA"). Default is "SMC".

n_factors

numeric. Passed to PARALLEL() (also within HULL()), KGC(), and SCREE(). Number of factors to extract if "EFA" is included in eigen_type_HULL or eigen_type_other. Default is 1.

n_datasets

numeric. Passed to PARALLEL() (also within HULL()). The number of datasets to simulate. Default is 1000.

percent

numeric. Passed to PARALLEL() (also within HULL()). The percentile to take from the simulated eigenvalues. Default is 95.

decision_rule

character. Passed to PARALLEL() (also within HULL()). Which rule to use to determine the number of factors to retain. Default is "means", which will use the average simulated eigenvalues. "percentile", uses the percentiles specified in percent. "crawford" uses the 95th percentile for the first factor and the mean afterwards (based on Crawford et al, 2010).

ekc_type

character. Passed to the type argument of EKC(). Either "BvA2017" for the original implementation by Braeken and van Assen (2017), or "AM2019" for the adapted implementation by Auerswald and Moshagen (2019).

n_datasets_nest

numeric. The number of datasets to simulate in NEST(). Default is 1000.

alpha_nest

numeric. The alpha level to use in NEST() (i.e., 1-alpha percentile of eigenvalues is used for reference values).

show_progress

logical. Whether a progress bar should be shown in the console. Default is FALSE.

...

Further arguments passed to EFA() in PARALLEL() (also within HULL()) and KGC().

Details

By default, the entered data are checked for suitability for factor analysis using the following methods (see respective documentations for details):

The available factor retention criteria are the following (see respective documentations for details):

Value

A list of class N_FACTORS containing

suitability

A list with the results from BARTLETT() and KMO() (bartlett and kmo), or NULL if suitability = FALSE.

outputs

A named list with one efa_retention object per factor retention criterion that was run (see, e.g., EKC()).

n_factors

A named numeric vector with the suggested number of factors per criterion and, where a criterion has several variants, per variant (e.g. EKC_BvA2017 or PARALLEL_SMC). Criteria without a numeric suggestion (the scree plot) are not included.

not_run

A named character vector with the criteria that were skipped or failed and the reason, or NULL if all requested criteria ran.

settings

A list of the settings used.

Examples


# Default criteria, with correlation matrix and fit method "ML" (where needed)
# This will throw a warning for CD, as no raw data were specified
nfac_all <- N_FACTORS(test_models$baseline$cormat, N = 500, method = "ML")

# The same as above, but without "CD"
nfac_wo_CD <- N_FACTORS(test_models$baseline$cormat, criteria = c("EKC",
                        "HULL", "PARALLEL", "NEST"), N = 500,
                        method = "ML")

# Use PAF instead of ML (this will take longer). For this, gof has
# to be set to "CAF" for the Hull method.
nfac_PAF <- N_FACTORS(test_models$baseline$cormat, criteria = c("EKC",
                        "HULL", "PARALLEL", "NEST"), N = 500,
                      method = "PAF", gof = "CAF")

# Do KGC and PARALLEL with only "PCA" type of eigenvalues
nfac_PCA <- N_FACTORS(test_models$baseline$cormat, criteria = c("EKC",
                      "HULL", "PARALLEL", "NEST"), N = 500,
                      method = "ML", eigen_type_other = "PCA")

# Use raw data, such that CD can also be performed
nfac_raw <- N_FACTORS(GRiPS_raw, method = "ML")


McDonald's omega

Description

This function finds omega total, hierarchical, and subscale, as well as additional model-based indices of interpretive relevance (H index, ECV, PUC) from a Schmid-Leiman (SL) solution or lavaan single factor, second-order (see below), or bifactor solution. The SL-based omegas can either be found from a psych::schmid(), SL(), or, in a more flexible way, by leaving model = NULL and specifying additional arguments. By setting the type argument, results from psych::omega() can be reproduced.

Usage

OMEGA(
  model = NULL,
  type = c("EFAtools", "psych"),
  g_name = "g",
  group_names = NULL,
  add_ind = TRUE,
  factor_corres = NULL,
  var_names = NULL,
  fac_names = NULL,
  g_load = NULL,
  s_load = NULL,
  u2 = NULL,
  cormat = NULL,
  pattern = NULL,
  Phi = NULL,
  variance = c("correlation", "sums_load")
)

Arguments

model

class SL(), class schmid, or class lavaan object. That is, an output object from SL() or psych::schmid(), or a lavaan fit object with a single factor, second-order, or bifactor solution. If of class lavaan, only g_name needs to be specified additionally. If of class SL() or schmid, only the arguments factor_corres and cormat need to be specified additionally.

type

character. Either "EFAtools" (default) or "psych" (see details)

g_name

character. The name of the general factor from the lavaan solution. This needs only be specified if model is a lavaan second-order or bifactor solution. Default is "g".

group_names

character. An optional vector of group names. The length must correspond to the number of groups for which the lavaan model was fitted.

add_ind

logical. Whether additional indices (H index, ECV, PUC) should be calculated or not (see details for these indices). If FALSE, only omegas are returned. Default is TRUE.

factor_corres

matrix. A logical matrix or a numeric matrix containing 0's and 1's that indicates which variable corresponds to which group factor. Must have the same dimensions as the matrix of group factor loadings from the SL solution. Cross-loadings are allowed here. See examples for use.

var_names

character. A vector with subtest names in the order of the rows from the SL solution. This needs only be specified if model is left NULL.

fac_names

character. An optional vector of group factor names in the order of the columns of the SL solution. If left NULL, names of the group factors from the entered solution are taken.

g_load

numeric. A vector of general factor loadings from an SL solution. This needs only be specified if model is left NULL.

s_load

matrix. A matrix of group factor loadings from an SL solution. This needs only be specified if model is left NULL.

u2

numeric. A vector of uniquenesses from an SL solution. This needs only be specified if model is left NULL.

cormat

matrix. A correlation matrix to be used when variance = "correlation". If left NULL and an SL() output is entered in model, the correlation matrix is taken from the output. If left NULL and a psych::schmid() output is entered, the correlation matrix will be found based on the pattern matrix and Phi from the psych::schmid() output using psych::factor.model(). If left NULL and model is also left NULL, the correlation matrix is found based on the pattern matrix and Phi entered. However, if the correlation matrix is available, cormat should be specified instead of Phi and pattern.

pattern

matrix. Pattern coefficients from an oblique factor solution. This needs only be specified if model is left NULL, variance = "correlation" and cormat is also left NULL.

Phi

matrix. Factor intercorrelations from an oblique factor solution. This needs only be specified if model is left NULL, variance = "correlation" and cormat is also left NULL.

variance

character. If "correlation" (default), then total variances for the whole scale as well as for the subscale composites are calculated based on the correlation matrix. If "sums_load", then total variances are calculated using the squared sums of general factor loadings and group factor loadings and the sum of uniquenesses (see details).

Details

What this function does

This function calculates McDonald's omegas (McDonald, 1978, 1985, 1999), the H index (Hancock & Mueller, 2001), the explained common variance (ECV; Rodriguez et al., 2016a, 2016b), and the percent of uncontaminated correlations (PUC; Bonifay et al., 2015; Reise et al., 2013).

All types of omegas (total, hierarchical, and subscale) are calculated for the general factor as well as for the subscales / group factors (see, e.g., Gignac, 2014; Rodriguez et al., 2016a, 2016b). Omegas refer to the correlation between a factor and a unit-weighted composite score and thus the true score variance in a unit-weighted composite based on the respective indicators. Omega total is the total true score variance in a composite. Omega hierarchical is the true score variance in a composite that is attributable to the general factor, and omega subscale is the true score variance in a composite attributable to all subscales / group factors (for the whole scale) or to the specific subscale / group factor (for subscale composites).

Accordingly, on a subscale row the hier column reports the share of that subscale's composite variance due to the general factor and the sub column the share due to the subscale-specific factor; the latter corresponds to the omega hierarchical subscale of Rodriguez et al. (2016a, 2016b).

The H index (also construct reliability or replicability index) is the correlation between an optimally-weighted composite score and a factor (Hancock & Mueller, 2001; Rodriguez et al., 2016a, 2016b). It, too, can be calculated for the whole scale / general factor as well as for the subscales / group factors. Low values indicate that a latent variable is not well defined by its indicators.

The ECV (Rodriguez et al., 2016a, 2016b) is the ratio of the variance explained by the general factor and the variance explained by the general factor and the group factors.

The PUC (Bonifay et al., 2015; Reise et al., 2013, Rodriguez et al., 2016a, 2016b) refers to the proportion of correlations in the underlying correlation matrix that is not contaminated by variance of both the general factor and the group factors (i.e., correlations between indicators from different group factors, which reflect only general factor variance). The higher the PUC, the more similar a general factor from a multidimensional model will be to the single factor from a unidimensional model.

How to use this function

If model is a lavaan second-order or bifactor solution, only the name of the general factor from the lavaan model needs to be specified additionally with the g_name argument. It is then determined whether this general factor is a second-order factor (second-order model with one second-order factor assumed) or a breadth factor (bifactor model assumed). Please note that this function only works for second-order models if they contain no more than one second-order factor. In case of a second-order solution, a Schmid-Leiman transformation is performed on the first- and second-order loadings and omega coefficients are obtained from the transformed (orthogonalized) solution (see SL() for more information on Schmid-Leiman transformation). There is also the possibility to enter a lavaan single factor solution. In this case, g_name is not needed. Finally, if a solution from a lavaan multiple group analysis is entered, the indices are computed for each group. For lavaan input the composite variances entering the omegas are model-implied (computed from the fitted loadings and residual variances), so the coefficients coincide with the observed-score versions when the model fits perfectly. The type argument is not evaluated if model is of class lavaan.

If model is of class SL() or psych::schmid() only the type and, depending on the type (see below), the factor_corres arguments need to be specified additionally. If model is of class psych::schmid() and variance = "correlation" (default), it is recommended to also provide the original correlation matrix in cormat to get more accurate results. Otherwise, the correlation matrix will be found based on the pattern matrix and Phi from the psych::schmid() output using the psych::factor.model() function.

If model = NULL, the arguments type, factor_corres (depending on the type, see below), var_names, g_load, s_load, and u2 and either cormat (recommended) or Phi and pattern need to be specified. If Phi and pattern are specified instead of cormat, the correlation matrix is found using the psych::factor.model() function.

The only difference between type = "EFAtools" and type = "psych" is the determination of variable-to-factor correspondences. type = "psych" reproduces the psych::omega() results, where variable-to-factor correspondences are found by taking the highest group factor loading for each variable as the relevant group factor loading. To do this, factor_corres must be left NULL.

The variance argument controls how the total variances (for the whole scale and the subscale composites) are computed. "correlation" (default) finds them from the correlation matrix – the observed-variance form of omega, which reproduces psych::omega(). "sums_load" instead uses the model-implied variances from the squared sums of the general and group factor loadings and the sum of the uniquenesses, so the whole-scale omega total is McDonald's model-implied total and partitions exactly into omega hierarchical plus omega subscale. The two settings agree on the whole-scale omega total and omega hierarchical up to model misfit, and differ mainly in the whole-scale omega subscale, which counts all group-factor variance under "sums_load" but only the assigned subscale composites under "correlation". On the subscale rows the two conventions agree when simple structure is well-achieved.

Value

If found for an SL or lavaan second-order or bifactor solution without multiple groups: A matrix with omegas for the whole scale and for the subscales and (only if add_ind = TRUE) with the H index, ECV, and PUC.

tot

Omega total.

hier

Omega hierarchical.

sub

Omega subscale.

H

H index.

ECV

Explained common variance.

PUC

Percent of uncontaminated correlations.

If found for a lavaan single factor solution without multiple groups: A (named) vector with omega total and (if add_ind = TRUE) the H index for the single factor.

If found for a lavaan output from a multiple group analysis: A list containing the output described above for each group.

Source

McDonald, R. P. (1978). Generalizability in factorable domains: ‘‘Domain validity and generalizability’’. Educational and Psychological Measurement, 38, 75–79.

McDonald, R. P. (1985). Factor analysis and related methods. Hillsdale, NJ: Erlbaum.

McDonald, R. P. (1999). Test theory: A unified treatment. Mahwah, NJ: Erlbaum.

Rodriguez, A., Reise, S. P., & Haviland, M. G. (2016a). Applying bifactor statistical indices in the evaluation of psychological measures. Journal of Personality Assessment, 98, 223-237.

Rodriguez, A., Reise, S. P., & Haviland, M. G. (2016b). Evaluating bifactor models: Calculating and interpreting statistical indices. Psychological Methods, 21, 137-150.

Hancock, G. R., & Mueller, R. O. (2001). Rethinking construct reliability within latent variable systems. In R. Cudeck, S. du Toit, & D. Sörbom (Eds.), Structural equation modeling: Present and future—A Festschrift in honor of Karl Jöreskog (pp. 195–216). Lincolnwood, IL: Scientific Software International.

Reise, S. P., Scheines, R., Widaman, K. F., & Haviland, M. G. (2013). Multidimensionality and structural coefficient bias in structural equation modeling: A bifactor perspective. Educational and Psychological Measurement, 73, 5–26.

Bonifay, W. E., Reise, S. P., Scheines, R., & Meijer, R. R. (2015). When are multidimensional data unidimensional enough for structural equation modeling?: An evaluation of the DETECT multidimensionality index. Structural Equation Modeling, 22, 504—516.

Gignac, G. E. (2014). On the Inappropriateness of Using Items to Calculate Total Scale Score Reliability via Coefficient Alpha for Multidimensional Scales. European Journal of Psychological Assessment, 30, 130-139.

Examples


## Use with lavaan outputs
if (requireNamespace("lavaan", quietly = TRUE)) {

# Create and fit bifactor model in lavaan (assume all variables have SDs of 1)
mod <- 'F1 =~ V1 + V2 + V3 + V4 + V5 + V6
        F2 =~ V7 + V8 + V9 + V10 + V11 + V12
        F3 =~ V13 + V14 + V15 + V16 + V17 + V18
        g =~ V1 + V2 + V3 + V4 + V5 + V6 + V7 + V8 + V9 + V10 + V11 + V12 +
             V13 + V14 + V15 + V16 + V17 + V18'
fit_bi <- lavaan::cfa(mod, sample.cov = test_models$baseline$cormat,
                      sample.nobs = 500, estimator = "ml", orthogonal = TRUE)

# Compute omegas and additional indices for bifactor solution
OMEGA(fit_bi, g_name = "g")

# Compute only omegas
OMEGA(fit_bi, g_name = "g", add_ind = FALSE)

# Create and fit second-order model in lavaan (assume all variables have SDs of 1)
mod <- 'F1 =~ V1 + V2 + V3 + V4 + V5 + V6
        F2 =~ V7 + V8 + V9 + V10 + V11 + V12
        F3 =~ V13 + V14 + V15 + V16 + V17 + V18
        g =~ F1 + F2 + F3'
fit_ho <- lavaan::cfa(mod, sample.cov = test_models$baseline$cormat,
                      sample.nobs = 500, estimator = "ml")

# Compute omegas and additional indices for second-order solution
OMEGA(fit_ho, g_name = "g")
}


## Use with an output from the SL function, with type EFAtools
efa_mod <- EFA(test_models$baseline$cormat, N = 500, n_factors = 3,
               type = "EFAtools", method = "PAF", rotation = "promax")
sl_mod <- SL(efa_mod, type = "EFAtools", method = "PAF")

# Two examples how to specify the indicator-to-factor correspondences:

# Based on a specific salience threshold for the loadings (here: .20):
factor_corres_1 <- sl_mod$sl[, c("F1", "F2", "F3")] >= .2

# Or more flexibly (could also be TRUE and FALSE instead of 0 and 1):
factor_corres_2 <- matrix(c(rep(0, 12), rep(1, 6), rep(0, 6), rep(1, 6),
                         rep(0, 6), rep(1, 6), rep(0, 12)), ncol = 3,
                         byrow = FALSE)

OMEGA(sl_mod, type = "EFAtools", factor_corres = factor_corres_1)

## Use with an output from the psych::schmid function, with type psych for
## OMEGA
schmid_mod <- psych::schmid(test_models$baseline$cormat, nfactors = 3,
                            n.obs = 500, fm = "pa", rotate = "Promax")
# Find correlation matrix from phi and pattern matrix from psych::schmid output
OMEGA(schmid_mod, type = "psych")
# Use specified correlation matrix
OMEGA(schmid_mod, type = "psych", cormat = test_models$baseline$cormat)

## Manually specify components (useful if omegas should be computed for a SL
## or bifactor solution found with another program)
## As an example, we extract the elements from an SL output here. This gives
## the same results as in the second example above.

efa_mod <- EFA(test_models$baseline$cormat, N = 500, n_factors = 3,
               type = "EFAtools", method = "PAF", rotation = "promax")
sl_mod <- SL(efa_mod, type = "EFAtools", method = "PAF")

factor_corres <- matrix(c(rep(0, 12), rep(1, 6), rep(0, 6), rep(1, 6),
                        rep(0, 6), rep(1, 6), rep(0, 12)), ncol = 3,
                        byrow = FALSE)

OMEGA(model = NULL, type = "EFAtools", var_names = rownames(sl_mod$sl),
      g_load = sl_mod$sl[, "g"], s_load = sl_mod$sl[, c("F1", "F2", "F3")],
      u2 = sl_mod$sl[, "u2"], cormat = test_models$baseline$cormat,
      factor_corres = factor_corres)


Parallel analysis

Description

Various methods for performing parallel analysis. This function uses future_lapply() for which a parallel processing plan can be selected. To do so, call library(future) and, for example, plan(multisession); see examples.

Usage

PARALLEL(
  x = NULL,
  N = NA,
  n_vars = NA,
  n_datasets = 1000,
  percent = 95,
  eigen_type = c("PCA", "SMC", "EFA"),
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  decision_rule = c("means", "percentile", "crawford"),
  n_factors = 1,
  ...
)

Arguments

x

matrix or data.frame. The real data to compare the simulated eigenvalues against. Must not contain variables of classes other than numeric. Can be a correlation matrix or raw data.

N

numeric. The number of cases / observations to simulate. Only has to be specified if x is either a correlation matrix or NULL. If x contains raw data, N is found from the dimensions of x.

n_vars

numeric. The number of variables / indicators to simulate. Only has to be specified if x is left as NULL as otherwise the dimensions are taken from x.

n_datasets

numeric. The number of datasets to simulate. Default is 1000.

percent

numeric. The percentile to take from the simulated eigenvalues. Default is 95.

eigen_type

character. On what the eigenvalues should be found. Can be either "SMC", "PCA", or "EFA". If using "SMC", the diagonal of the correlation matrix is replaced by the squared multiple correlations (SMCs) of the indicators. If using "PCA", the diagonal values of the correlation matrices are left to be 1. If using "EFA", eigenvalues are found on the correlation matrices with the final communalities of an EFA solution as diagonal.

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. One of "pearson", "spearman", or "kendall", passed to stats::cor(). "poly" and "tetra" are not supported because PARALLEL compares the data against simulated continuous reference data. Default is "pearson".

decision_rule

character. Which rule to use to determine the number of factors to retain. Default is "means", which will use the average simulated eigenvalues. "percentile", uses the percentiles specified in percent. "crawford" uses the 95th percentile for the first factor and the mean afterwards (based on Crawford et al, 2010). The "means" rule retains a factor whenever its real eigenvalue exceeds the average simulated one and thus tends to retain more factors than the more conservative "percentile" rule (Glorfeld, 1995).

n_factors

numeric. Number of factors to extract if "EFA" is included in eigen_type. Default is 1.

...

Additional arguments passed to EFA(). For example, the extraction method can be changed here (default is "PAF"). PAF is more robust, but it will take longer compared to the other estimation methods available ("ML" and "ULS").

Details

Parallel analysis (Horn, 1965) compares the eigenvalues obtained from the sample correlation matrix against those of null model correlation matrices (i.e., with uncorrelated variables) of the same sample size. This way, it accounts for the variation in eigenvalues introduced by sampling error and thus eliminates the main problem inherent in the Kaiser-Guttman criterion (KGC()).

Parallel analysis is often argued to be one of the most accurate factor retention criteria. However, for highly correlated factor structures it has been shown to underestimate the correct number of factors. The reason for this is that a null model (uncorrelated variables) is used as reference. However, when factors are highly correlated, the first eigenvalue will be much larger compared to the following ones, as later eigenvalues are conditional on the earlier ones in the sequence and thus the shared variance is already accounted in the first eigenvalue (e.g., Braeken & van Assen, 2017).

The PARALLEL function can also be called together with other factor retention criteria in the N_FACTORS() function.

Value

An object of class efa_retention (see print.efa_retention() and plot.efa_retention() for the print and plot methods). Its main fields are:

n_factors

A named numeric vector with the suggested number of factors for each requested eigenvalue type ("PCA", "SMC", and/or "EFA"). These are NA when no real data are supplied (i.e. only N and n_vars are given). When every real eigenvalue exceeds its reference (no crossing is found), all n_vars components are retained and a warning is issued.

results

A list with one record per eigenvalue type, each holding the real eigenvalues (when real data were supplied) and the simulated reference eigenvalues (means and percentiles) used for printing and plotting.

settings

A list of the settings used.

Source

Braeken, J., & van Assen, M. A. (2017). An empirical Kaiser criterion. Psychological Methods, 22, 450 – 466. http://dx.doi.org/10.1037/ met0000074

Crawford, A. V., Green, S. B., Levy, R., Lo, W. J., Scott, L., Svetina, D., & Thompson, M. S. (2010). Evaluation of parallel analysis methods for determining the number of factors. Educational and Psychological Measurement, 70(6), 885-901.

Glorfeld, L. W. (1995). An improvement on Horn's parallel analysis methodology for selecting the correct number of factors to retain. Educational and Psychological Measurement, 55(3), 377-393.

Horn, J. L. (1965). A rationale and test for the number of factors in factor analysis. Psychometrika, 30(2), 179–185. doi: 10.1007/BF02289447

See Also

N_FACTORS() as a wrapper function for this and the other factor retention criteria.

Other factor retention criteria: CD(), EKC(), HULL(), KGC(), MAP(), NEST(), SCREE(), SMT()

Examples


# example without real data
pa_unreal <- PARALLEL(N = 500, n_vars = 10)

# example with correlation matrix with all eigen_types and PAF estimation
pa_paf <- PARALLEL(test_models$case_11b$cormat, N = 500)

# example with correlation matrix with all eigen_types and ML estimation
# this will be faster than the above with PAF)
pa_ml <- PARALLEL(test_models$case_11b$cormat, N = 500, method = "ML")


## Not run: 
# for parallel computation
future::plan(future::multisession)
pa_faster <- PARALLEL(test_models$case_11b$cormat, N = 500)

## End(Not run)

Rotate a loading matrix to a target using Procrustes alignment

Description

PROCRUSTES() aligns one loading matrix to a target loading matrix with the same dimensions. It is used internally by EFA_POOLED(), but can also be used directly when factor columns must be brought into a common orientation before averaging or comparing solutions.

Usage

PROCRUSTES(
  A,
  Target,
  rotation = c("orthogonal", "oblique"),
  S = NULL,
  T_init = NULL,
  oblique_eps = 1e-05,
  oblique_maxit = 1000,
  oblique_max_line_search = 10,
  oblique_step0 = 1,
  oblique_normalize = FALSE,
  oblique_random_starts = 0,
  oblique_screen_keep = 2,
  oblique_triage_maxit = 25,
  oblique_triage_improve_tol = 0
)

Arguments

A

Numeric loading matrix to be aligned.

Target

Numeric target matrix with the same dimensions as A.

rotation

Character string, either "orthogonal" or "oblique".

S

Optional ⁠k x k⁠ cross-product matrix crossprod(A). Supplying this is useful when the same A is rotated repeatedly. S is used only when oblique_normalize = FALSE; if Kaiser normalization is requested, the cross-product must be recomputed on the normalized matrix.

T_init

Optional ⁠k x k⁠ nonsingular starting transformation matrix for the oblique solver. Its columns are normalized internally. If NULL (the default), the oblique solver is warm-started from the closed-form orthogonal Procrustes solution.

oblique_eps

Positive convergence tolerance for the projected-gradient norm in the oblique solver.

oblique_maxit

Non-negative integer. Maximum number of projected-gradient updates in the full oblique solver.

oblique_max_line_search

Non-negative integer. Maximum number of step-halving attempts after the initial line-search step.

oblique_step0

Positive initial step size for the oblique solver.

oblique_normalize

Logical; if TRUE, apply Kaiser row normalization to the loadings (only) in the oblique solver and back-transform the aligned loadings afterwards, leaving Target unnormalized (as in GPArotation::targetQ(normalize = TRUE)).

oblique_random_starts

Non-negative integer. Number of additional random starts used by the oblique solver.

oblique_screen_keep

Non-negative integer. Number of random starts retained after cheap objective screening and sent to triage optimization.

oblique_triage_maxit

Non-negative integer. Number of short optimization iterations used in the triage stage.

oblique_triage_improve_tol

Non-negative scalar. Relative improvement required for a triaged start to be promoted to full optimization.

Details

For rotation = "orthogonal", the function solves the closed-form orthogonal Procrustes problem

\min_T \frac{1}{2}\|A T - B\|_F^2 \quad \textrm{subject to}\quad T'T = I,

where A is the loading matrix and B is Target.

For rotation = "oblique", the function calls the compiled .oblique_procrustes() optimizer. The oblique convention is the same as in GPArotation::targetQ():

L = A T^{-T}, \qquad \Phi = T'T, \qquad diag(\Phi) = 1.

By default the oblique solver is warm-started from the closed-form orthogonal Procrustes solution, which resolves the factor permutation and sign indeterminacy and avoids the poor local minima an identity start can fall into. Supply T_init to override this start. Random starts are only used for oblique alignment. For one-factor models, oblique and orthogonal alignment are equivalent, so the function uses the stable one-factor orthogonal solution instead of calling the oblique optimizer.

Value

A list containing aligned loadings, transformation matrix T, factor intercorrelation matrix Phi, target criterion value, convergence diagnostics, line-search diagnostics, and multi-start summaries. Row and column names are preserved where possible. When oblique_normalize = TRUE the returned loadings are back-transformed to the original scale, but value is the criterion on the Kaiser-normalized loadings, so it is not 0.5 * sum((loadings - Target)^2).


RiskDimensions

Description

A list containing the bivariate correlations (cormat) of the 9 dimensions on which participants in Fischhoff et al. (1978) rated different activities and technologies as well as the sample size (N). This was then analyzed together with ratings of the risks and benefits of these activities and technologies.

Usage

RiskDimensions

Format

An object of class list of length 2.

Source

Fischhoff, B, Slovic, P, Lichtenstein, S, Read, S, and Combs, B. (1978). How safe is safe enough? A psychometric study of attitudes towards technological risks and benefits. Policy Sciences, 9, 127-152. doi: 10.1007/BF00143739


Scree Plot

Description

The scree plot was originally introduced by Cattell (1966) to perform the scree test. In a scree plot, the eigenvalues of the factors / components are plotted against the index of the factors / components, ordered from 1 to N factors components, hence from largest to smallest eigenvalue. According to the scree test, the number of factors / components to retain is the number of factors / components to the left of the "elbow" (where the curve starts to level off) in the scree plot.

Usage

SCREE(
  x,
  eigen_type = c("PCA", "SMC", "EFA"),
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  n_factors = 1,
  ...
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data or matrix with correlations.

eigen_type

character. On what the eigenvalues should be found. Can be either "PCA", "SMC", or "EFA", or some combination of them. If using "PCA", the diagonal values of the correlation matrices are left to be 1. If using "SMC", the diagonal of the correlation matrices is replaced by the squared multiple correlations (SMCs) of the indicators. If using "EFA", eigenvalues are found on the correlation matrices with the final communalities of an exploratory factor analysis solution (default is principal axis factoring extracting 1 factor) as diagonal.

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. Correlation computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()), or "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data (a two-step estimator with no empty-cell continuity correction). Default is "pearson".

n_factors

numeric. Number of factors to extract if "EFA" is included in eigen_type. Default is 1.

...

Additional arguments passed to EFA(). For example, to change the extraction method (PAF is default).

Details

As the scree test requires visual examination, the test has been especially criticized for its subjectivity and with this low inter-rater reliability. Moreover, a scree plot can be ambiguous if there are either no clear "elbow" or multiple "elbows", making it difficult to judge just where the eigenvalues do level off. Finally, the scree test has also been found to be less accurate than other factor retention criteria. For all these reasons, the scree test has been recommended against, at least for exclusive use as a factor retention criterion (Zwick & Velicer, 1986)

The SCREE function can also be called together with other factor retention criteria in the N_FACTORS() function.

Value

An object of class efa_retention (see print.efa_retention() and plot.efa_retention() for the print and plot methods). The scree plot is a visual criterion, so it returns no numeric suggestion. Its main fields are:

results

A list with one record per requested eigenvalue type, each holding the eigenvalues used for the scree plot.

settings

A list of the settings used.

Source

Cattell, R. B. (1966). The scree test for the number of factors. Multivariate Behavioral Research, 1(2), 245–276. https://doi.org/10.1207/s15327906mbr0102_10

Zwick, W. R., & Velicer, W. F. (1986). Comparison of five rules for determining the number of components to retain. Psychological Bulletin, 99, 432–442. http://dx.doi.org/10.1037/0033-2909.99.3.432

See Also

N_FACTORS() as a wrapper function for this and the other factor retention criteria.

Other factor retention criteria: CD(), EKC(), HULL(), KGC(), MAP(), NEST(), PARALLEL(), SMT()

Examples

SCREE(test_models$baseline$cormat, eigen_type = c("PCA", "SMC"))

Schmid-Leiman Transformation

Description

This function implements the Schmid-Leiman (SL) transformation (Schmid & Leiman, 1957). It takes the pattern coefficients and factor intercorrelations from an oblique factor solution as input and can reproduce the results from psych::schmid() and from the SPSS implementation from Wolff & Preising (2005). Other arguments from EFA() can be used to control the procedure to find the second-order loadings more flexibly. The function can also be used on a second-order confirmatory factor analysis (CFA) solution from lavaan.

Usage

SL(
  x,
  Phi = NULL,
  type = c("EFAtools", "psych", "SPSS", "none"),
  method = c("PAF", "ML", "ULS", "MINRES"),
  g_name = "g",
  ...
)

Arguments

x

object of class EFA(), class psych::fa(), class lavaan::lavaan(), a matrix, or a LOADINGS/loadings object. If class EFA() or class psych::fa(), pattern coefficients and factor intercorrelations are taken from this object. If class lavaan::lavaan(), it must be a second-order CFA solution. In this case first-order and second-order factor loadings are taken from this object and the g_name argument has to be specified. x can also be a pattern matrix from an oblique factor solution (see Phi) or a matrix of first-order factor loadings from a higher-order confirmatory factor analysis (see L2).

Phi

matrix. A matrix of factor intercorrelations from an oblique factor solution. Only needs to be specified if a pattern matrix is entered directly into x.

type

character. One of "EFAtools" (default), "psych", "SPSS", or "none". This is used to control the procedure of the second-order factor analysis. See EFA() for details.

method

character. One of "PAF", "ML", or "ULS" to use principal axis factoring, maximum likelihood, or unweighted least squares, respectively, used in EFA() to find the second-order loadings. "MINRES" is accepted as a synonym for "ULS" (the same estimator).

g_name

character. The name of the general factor. This needs only be specified if x is a lavaan second-order solution. Default is "g".

...

Arguments to be passed to EFA().

Details

The SL transformation (also called SL orthogonalization) is a procedure with which an oblique factor solution is transformed into a hierarchical, orthogonalized solution. As a first step, the factor intercorrelations are factor analyzed to extract a single second-order (general) factor, yielding a two-level hierarchical structure. The first-order factor and the second-order factor are then orthogonalized, resulting in an orthogonalized factor solution with proportionality constraints. The procedure thus makes a suggested hierarchical data structure based on factor intercorrelations explicit. One major advantage of SL transformation is that it enables variance partitioning between higher-order and first-order factors, including the calculation of McDonald's omegas (see OMEGA()).

Value

A list of class SL containing the following

orig_R

Original correlation matrix.

sl

A matrix with general factor loadings, group factor loadings, communalities, and uniquenesses.

L2

Second-order factor loadings.

vars_accounted

A matrix of explained variances and sums of squared loadings.

iter

The number of iterations needed for convergence in EFA.

convergence

Integer convergence code of the second-order EFA (0 = converged); NA for a lavaan input. See EFA().

settings

list. The settings (arguments) used in EFA to get the second-order loadings.

Source

Schmid, J. & Leiman, J. M. (1957). The development of hierarchical factor solutions. Psychometrika, 22(1), 53–61. doi:10.1007/BF02289209

Wolff, H.-G., & Preising, K. (2005). Exploring item and higher order factor structure with the Schmid-Leiman solution: Syntax codes for SPSS and SAS. Behavior Research Methods, 37 , 48–58. doi:10.3758/BF03206397

Examples

## Use with an output from the EFAtools::EFA function, both with type EFAtools
EFA_mod <- EFA(test_models$baseline$cormat, N = 500, n_factors = 3,
               type = "EFAtools", method = "PAF", rotation = "promax")
SL_EFAtools <- SL(EFA_mod, type = "EFAtools", method = "PAF")


## Use with an output from the psych::fa function with type psych in SL
fa_mod <- psych::fa(test_models$baseline$cormat, nfactors = 3, n.obs = 500,
                    fm = "pa", rotate = "Promax")
SL_psych <- SL(fa_mod, type = "psych", method = "PAF")


## Use more flexibly by entering a pattern matrix and phi directly (useful if
## a factor solution found with another program should be subjected to SL
## transformation)

## For demonstration, take pattern matrix and phi from an EFA output
## This gives the same solution as the first example
EFA_mod <- EFA(test_models$baseline$cormat, N = 500, n_factors = 3,
               type = "EFAtools", method = "PAF", rotation = "promax")
SL_flex <- SL(EFA_mod$rot_loadings, Phi = EFA_mod$Phi, type = "EFAtools",
              method = "PAF")


## Use with a lavaan second-order CFA output
if (requireNamespace("lavaan", quietly = TRUE)) {

# Create and fit model in lavaan (assume all variables have SDs of 1)
mod <- 'F1 =~ V1 + V2 + V3 + V4 + V5 + V6
        F2 =~ V7 + V8 + V9 + V10 + V11 + V12
        F3 =~ V13 + V14 + V15 + V16 + V17 + V18
        g =~ F1 + F2 + F3'
fit <- lavaan::cfa(mod, sample.cov = test_models$baseline$cormat,
                   sample.nobs = 500, estimator = "ml")

SL_lav <- SL(fit, g_name = "g")

}


Sequential Chi Square Model Tests, RMSEA lower bound, and AIC

Description

Sequential Chi Square Model Tests (SMT) are a factor retention method where multiple EFAs with increasing numbers of factors are fitted and the number of factors for which the Chi Square value first becomes non-significant is taken as the suggested number of factors. Preacher, Zhang, Kim, & Mels (2013) suggested a similar approach with the lower bound of the 90% confidence interval of the Root Mean Square Error of Approximation (RMSEA; Browne & Cudeck, 1992; Steiger & Lind, 1980), and with the Akaike Information Criterion (AIC). For the RMSEA, the number of factors for which this lower bound first falls below .05 is the suggested number of factors to retain. For the AIC, it is the number of factors where the AIC is lowest.

Usage

SMT(
  x,
  N = NA,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra")
)

Arguments

x

data.frame or matrix. Dataframe or matrix of raw data or matrix with correlations.

N

numeric. The number of observations. Needs only be specified if a correlation matrix is used.

use

character. Passed to stats::cor() if raw data is given as input. Default is "pairwise.complete.obs".

cor_method

character. Correlation computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()), or "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data (a two-step estimator with no empty-cell continuity correction). Default is "pearson".

Details

As a first step in the procedure, a maximum number of factors to extract is determined for which the model is still over-identified (df > 0).

Then, EFAs with increasing numbers of factors from 1 to the maximum number are fitted with maximum likelihood estimation.

For the SMT, first the significance of the chi square value for a model with 0 factors is determined. If this value is not significant, 0 factors are suggested to retain. If it is significant, a model with 1 factor is estimated and the significance of its chi square value is determined, and so on, until a non-significant result is obtained. The suggested number of factors is the number of factors for the model where the chi square value first becomes non-significant.

Regarding the RMSEA, the suggested number of factors is the number of factors for the model where the lower bound of the 90% confidence interval of the RMSEA first falls below the .05 threshold.

Regarding the AIC, the suggested number of factors is the number of factors for the model with the lowest AIC.

In comparison with other prominent factor retention criteria, SMT performed well at determining the number of factors to extract in EFA (Auerswald & Moshagen, 2019). The RMSEA lower bound also performed well at determining the true number of factors, while the AIC performed well at determining the most generalizable model (Preacher, Zhang, Kim, & Mels, 2013).

Value

An object of class efa_retention (see print.efa_retention() for the print method). Its main fields are:

n_factors

A named numeric vector ("chi", "RMSEA", "AIC") with the suggested number of factors from the sequential chi-square model tests, the RMSEA lower bound, and the AIC.

results

A list with one record per criterion, each holding the criterion values for the null model (zero factors) through the maximum number of factors.

settings

A list of the settings used.

Source

Auerswald, M., & Moshagen, M. (2019). How to determine the number of factors to retain in exploratory factor analysis: A comparison of extraction methods under realistic conditions. Psychological Methods, 24(4), 468–491. https://doi.org/10.1037/met0000200

Browne, M.W., & Cudeck, R. (1992). Alternative ways of assessing model fit. Sociological Methods and Research, 21, 230–258.

Preacher, K. J., Zhang G., Kim, C., & Mels, G. (2013). Choosing the Optimal Number of Factors in Exploratory Factor Analysis: A Model Selection Perspective, Multivariate Behavioral Research, 48(1), 28-56, doi:10.1080/00273171.2012.710386

Steiger, J. H., & Lind, J. C. (1980, May). Statistically based tests for the number of common factors. Paper presented at the annual meeting of the Psychometric Society, Iowa City, IA.

See Also

N_FACTORS() as a wrapper function for this and the other factor retention criteria.

Other factor retention criteria: CD(), EKC(), HULL(), KGC(), MAP(), NEST(), PARALLEL(), SCREE()

Examples

SMT_base <- SMT(test_models$baseline$cormat, N = 500)
SMT_base


Various outputs from SPSS (version 23) FACTOR

Description

Various outputs from SPSS (version 23) FACTOR for the IDS-2 (Grob & Hagmann-von Arx, 2018), the WJIV (3 to 5 and 20 to 39 years; McGrew, LaForte, & Schrank, 2014), the DOSPERT (Frey et al., 2017; Weber, Blais, & Betz, 2002), the NEO-PI-R (Costa, & McCrae, 1992), and four simulated datasets (baseline, case_1a, case_6b, and case_11b, see test_models and population_models) used in Grieder and Steiner (2022).

Usage

SPSS_23

Format

A list of 9 containing EFA results for each of the data sets mentioned above. Each of these nine entries is a list of 4 or 8 (see details), of the following structure:

paf_comm

(vector) - The final communalities obtained with the FACTOR algorithm with PAF and no rotation. For details, see Grieder and Grob (2019).

paf_load

(matrix) - F1 to FN = unrotated factor loadings obtained with the FACTOR algorithm with PAF. Rownames are the abbreviated subtest names.

paf_iter

(numeric) - Number of iterations needed for the principal axis factoring to converge.

var_load

(matrix) - F1 to FN = varimax rotated factor loadings obtained with the FACTOR algorithm with PAF. Rownames are the abbreviated subtest names.

pro_load

(matrix) - F1 to FN = promax rotated factor loadings obtained with the FACTOR algorithm with PAF. Rownames are the abbreviated subtest names.

pro_phi

(matrix) - F1 to FN = intercorrelations of the promax rotated loadings.

sl

(matrix) - g = General / second order factor of the Schmid-Leiman solution. F1 to FN = First order factors of the Schmid-Leiman solution. h2 = Communalities of the Schmid-Leiman solution. This Schmid-Leiman solution was found using the SPSS Syntax provided by Wolff and Preising (2005).

L2

(matrix) - Second order loadings used for the Schmid-Leiman transformation. This Schmid-Leiman solution was found using the SPSS Syntax provided by Wolff and Preising (2005).

Details

The IDS-2, the two WJIV, the DOSPERT, and the NEO-PI-R contain all the above entries, while the four simulated datasets contain only paf_load, var_load, pro_load, and pro_phi.

Source

Grieder, S., & Steiner, M. D. (2022). Algorithmic jingle jungle: A comparison of implementations of principal axis factoring and promax rotation in R and SPSS. Behavior Research Methods, 54, 54–74. doi: 10.3758/s13428-021-01581-x

Wolff, H.G., & Preising, K. (2005). Exploring item and higher order factor structure with the Schmid-Leiman solution: Syntax codes for SPSS and SAS. Behavior Research Methods, 37, 48–58. doi: 10.3758/BF03206397

Grieder, S., & Grob, A. (2019). Exploratory factor analyses of the intelligence and development scales–2: Implications for theory and practice. Assessment. Advance online publication. doi:10.1177/10731911198450

Grob, A., & Hagmann-von Arx, P. (2018). Intelligence and Development Scales–2 (IDS-2). Intelligenz- und Entwicklungsskalen für Kinder und Jugendliche. [Intelligence and Development Scales for Children and Adolescents.]. Bern, Switzerland: Hogrefe.

Frey, R., Pedroni, A., Mata, R., Rieskamp, J., & Hertwig, R. (2017). Risk preference shares the psychometric structure of major psychological traits. Science Advances, 3, e1701381.

McGrew, K. S., LaForte, E. M., & Schrank, F. A. (2014). Technical Manual. Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Schrank, F. A., McGrew, K. S., & Mather, N. (2014). Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Costa, P. T., & McCrae, R. R. (1992). NEO PI-R professional manual. Odessa, FL: Psychological Assessment Resources, Inc.


Various outputs from SPSS (version 27) FACTOR

Description

Various outputs from SPSS (version 27) FACTOR for the IDS-2 (Grob & Hagmann-von Arx, 2018), the WJIV (3 to 5 and 20 to 39 years; McGrew, LaForte, & Schrank, 2014), the DOSPERT (Frey et al., 2017; Weber, Blais, & Betz, 2002), the NEO-PI-R (Costa, & McCrae, 1992), and four simulated datasets (baseline, case_1a, case_6b, and case_11b, see test_models and population_models) used in Grieder and Steiner (2022).

Usage

SPSS_27

Format

A list of 9 containing EFA results for each of the data sets mentioned above. Each of these nine entries is a list of 4 or 8 (see details), of the following structure:

paf_comm

(vector) - The final communalities obtained with the FACTOR algorithm with PAF and no rotation. For details, see Grieder and Grob (2019).

paf_load

(matrix) - F1 to FN = unrotated factor loadings obtained with the FACTOR algorithm with PAF. Rownames are the abbreviated subtest names.

paf_iter

(numeric) - Number of iterations needed for the principal axis factoring to converge.

var_load

(matrix) - F1 to FN = varimax rotated factor loadings obtained with the FACTOR algorithm with PAF. Rownames are the abbreviated subtest names.

pro_load

(matrix) - F1 to FN = promax rotated factor loadings obtained with the FACTOR algorithm with PAF. Rownames are the abbreviated subtest names.

pro_phi

(matrix) - F1 to FN = intercorrelations of the promax rotated loadings.

sl

(matrix) - g = General / second order factor of the Schmid-Leiman solution. F1 to FN = First order factors of the Schmid-Leiman solution. h2 = Communalities of the Schmid-Leiman solution. This Schmid-Leiman solution was found using the SPSS Syntax provided by Wolff and Preising (2005).

L2

(matrix) - Second order loadings used for the Schmid-Leiman transformation. This Schmid-Leiman solution was found using the SPSS Syntax provided by Wolff and Preising (2005).

Details

The IDS-2, the two WJIV, the DOSPERT, and the NEO-PI-R contain all the above entries, while the four simulated datasets contain only paf_load, var_load, pro_load, and pro_phi.

Source

Grieder, S., & Steiner, M. D. (2022). Algorithmic jingle jungle: A comparison of implementations of principal axis factoring and promax rotation in R and SPSS. Behavior Research Methods, 54, 54–74. doi: 10.3758/s13428-021-01581-x

Wolff, H.G., & Preising, K. (2005). Exploring item and higher order factor structure with the Schmid-Leiman solution: Syntax codes for SPSS and SAS. Behavior Research Methods, 37, 48–58. doi: 10.3758/BF03206397

Grieder, S., & Grob, A. (2019). Exploratory factor analyses of the intelligence and development scales–2: Implications for theory and practice. Assessment. Advance online publication. doi:10.1177/10731911198450

Grob, A., & Hagmann-von Arx, P. (2018). Intelligence and Development Scales–2 (IDS-2). Intelligenz- und Entwicklungsskalen für Kinder und Jugendliche. [Intelligence and Development Scales for Children and Adolescents.]. Bern, Switzerland: Hogrefe.

Frey, R., Pedroni, A., Mata, R., Rieskamp, J., & Hertwig, R. (2017). Risk preference shares the psychometric structure of major psychological traits. Science Advances, 3, e1701381.

McGrew, K. S., LaForte, E. M., & Schrank, F. A. (2014). Technical Manual. Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Schrank, F. A., McGrew, K. S., & Mather, N. (2014). Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Costa, P. T., & McCrae, R. R. (1992). NEO PI-R professional manual. Odessa, FL: Psychological Assessment Resources, Inc.


UPPS_raw

Description

A dataframe containing responses to the UPPS personality scale (Whiteside & Lynam, 2005) of 645 participants of Study 2 of Steiner and Frey (2020). Each column are the ratings to one of 45 items to assess urgency, premeditation, perseverance, and sensation seeking. The original data can be accessed via https://osf.io/kxp8t/.

Usage

UPPS_raw

Format

An object of class data.frame with 645 rows and 45 columns.

Source

Whiteside, S. P., Lynam, D. R., Miller, J. D., & Reynolds, S. K. (2005). Validation of the UPPS impulsive behaviour scale: A four-factor model of impulsivity. European Journal of Personality, 19 (7), 559–574.

Steiner, M., & Frey, R. (2020). Representative design in psychological assessment: A case study using the Balloon Analogue Risk Task (BART). PsyArXiv Preprint. doi:10.31234/osf.io/dg4ks


Woodcock Johnson IV: ages 14 to 19

Description

A list containing the bivariate correlations (N = 1,685) of the 47 cognitive and achievement subtests from the WJ IV for 14- to 19-year-olds from the standardization sample obtained from the WJ-IV technical manual (McGrew, LaForte, & Schrank, 2014). Tables are reproduced with permission from the publisher.

Usage

WJIV_ages_14_19

Format

A list of 2 with elements "cormat" (47 x 47 matrix of bivariate correlations) and "N" (scalar). The correlation matrix contains the following variables:

ORLVOC

(numeric) - Oral Vocabulary.

NUMSER

(numeric) - Number Series.

VRBATN

(numeric) - Verbal Attention.

LETPAT

(numeric) - Letter-Pattern Matching.

PHNPRO

(numeric) - Phonological Processing.

STYREC

(numeric) - Story Recall.

VISUAL

(numeric) - Visualization.

GENINF

(numeric) - General Information.

CONFRM

(numeric) - Concept Formation.

NUMREV

(numeric) - Numbers Reversed.

NUMPAT

(numeric) - Number-Pattern Matching.

NWDREP

(numeric) - Nonword Repetition.

VAL

(numeric) - Visual-Auditory Learning.

PICREC

(numeric) - Picture Recognition.

ANLSYN

(numeric) - Analysis-Synthesis.

OBJNUM

(numeric) - Object-Number Sequencing.

PAIRCN

(numeric) - Pair Cancellation.

MEMWRD

(numeric) - Memory for Words.

PICVOC

(numeric) - Picture Vocabulary.

ORLCMP

(numeric) - Oral Comprehension.

SEGMNT

(numeric) - Segmentation.

RPCNAM

(numeric) - Rapid Picture Naming.

SENREP

(numeric) - Sentence Repetition.

UNDDIR

(numeric) - Understanding Directions.

SNDBLN

(numeric) - Sound Blending.

RETFLU

(numeric) - Retrieval Fluency.

SNDAWR

(numeric) - Sound Awareness.

LWIDNT

(numeric) - Letter-Word Identification.

APPROB

(numeric) - Applied Problems.

SPELL

(numeric) - Spelling.

PSGCMP

(numeric) - Passage Comprehension.

CALC

(numeric) - Calculation.

WRTSMP

(numeric) - Writing Samples.

WRDATK

(numeric) - Word Attack.

ORLRDG

(numeric) - Oral Reading.

SNRDFL

(numeric) - Sentence Reading Fluency.

MTHFLU

(numeric) - Math Facts Fluency.

SNWRFL

(numeric) - Sentence Writing Fluency.

RDGREC

(numeric) - Reading Recall.

NUMMAT

(numeric) - Number Matrices.

EDIT

(numeric) - Editing.

WRDFLU

(numeric) - Word Reading Fluency.

SPLSND

(numeric) - Spelling of Sounds.

RDGVOC

(numeric) - Reading Vocabulary.

SCI

(numeric) - Science.

SOC

(numeric) - Social Studies.

HUM

(numeric) - Humanities.

Source

McGrew, K. S., LaForte, E. M., & Schrank, F. A. (2014). Technical Manual. Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Schrank, F. A., McGrew, K. S., & Mather, N. (2014). Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.


Woodcock Johnson IV: ages 20 to 39

Description

A list containing the bivariate correlations (N = 1,251) of the 47 cognitive and achievement subtests from the WJ IV for the 20- to 39-year-olds from the standardization sample obtained from the WJ-IV technical manual (McGrew, LaForte, & Schrank, 2014). Tables are reproduced with permission from the publisher.

Usage

WJIV_ages_20_39

Format

A list of 2 with elements "cormat" (47 x 47 matrix of bivariate correlations) and "N" (scalar). The correlation matrix contains the following variables:

ORLVOC

(numeric) - Oral Vocabulary.

NUMSER

(numeric) - Number Series.

VRBATN

(numeric) - Verbal Attention.

LETPAT

(numeric) - Letter-Pattern Matching.

PHNPRO

(numeric) - Phonological Processing.

STYREC

(numeric) - Story Recall.

VISUAL

(numeric) - Visualization.

GENINF

(numeric) - General Information.

CONFRM

(numeric) - Concept Formation.

NUMREV

(numeric) - Numbers Reversed.

NUMPAT

(numeric) - Number-Pattern Matching.

NWDREP

(numeric) - Nonword Repetition.

VAL

(numeric) - Visual-Auditory Learning.

PICREC

(numeric) - Picture Recognition.

ANLSYN

(numeric) - Analysis-Synthesis.

OBJNUM

(numeric) - Object-Number Sequencing.

PAIRCN

(numeric) - Pair Cancellation.

MEMWRD

(numeric) - Memory for Words.

PICVOC

(numeric) - Picture Vocabulary.

ORLCMP

(numeric) - Oral Comprehension.

SEGMNT

(numeric) - Segmentation.

RPCNAM

(numeric) - Rapid Picture Naming.

SENREP

(numeric) - Sentence Repetition.

UNDDIR

(numeric) - Understanding Directions.

SNDBLN

(numeric) - Sound Blending.

RETFLU

(numeric) - Retrieval Fluency.

SNDAWR

(numeric) - Sound Awareness.

LWIDNT

(numeric) - Letter-Word Identification.

APPROB

(numeric) - Applied Problems.

SPELL

(numeric) - Spelling.

PSGCMP

(numeric) - Passage Comprehension.

CALC

(numeric) - Calculation.

WRTSMP

(numeric) - Writing Samples.

WRDATK

(numeric) - Word Attack.

ORLRDG

(numeric) - Oral Reading.

SNRDFL

(numeric) - Sentence Reading Fluency.

MTHFLU

(numeric) - Math Facts Fluency.

SNWRFL

(numeric) - Sentence Writing Fluency.

RDGREC

(numeric) - Reading Recall.

NUMMAT

(numeric) - Number Matrices.

EDIT

(numeric) - Editing.

WRDFLU

(numeric) - Word Reading Fluency.

SPLSND

(numeric) - Spelling of Sounds.

RDGVOC

(numeric) - Reading Vocabulary.

SCI

(numeric) - Science.

SOC

(numeric) - Social Studies.

HUM

(numeric) - Humanities.

Source

McGrew, K. S., LaForte, E. M., & Schrank, F. A. (2014). Technical Manual. Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Schrank, F. A., McGrew, K. S., & Mather, N. (2014). Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.


Woodcock Johnson IV: ages 3 to 5

Description

A list containing the bivariate correlations (N = 435) of the 29 cognitive and achievement subtests from the WJ IV for 3- to 5-year-olds from the standardization sample obtained from the WJ IV technical Manual (McGrew, LaForte, & Schrank, 2014). Tables are reproduced with permission from the publisher.

Usage

WJIV_ages_3_5

Format

A list of 2 with elements "cormat" (29 x 29 matrix of bivariate correlations) and "N" (scalar). The correlation matrix contains the following variables:

ORLVOC

(numeric) - Oral Vocabulary.

VRBATN

(numeric) - Verbal Attention.

LETPAT

(numeric) - Phonological Processing.

STYREC

(numeric) - Story Recall.

VISUAL

(numeric) - Visualization.

GENINF

(numeric) - General Information.

CONFRM

(numeric) - Concept Formation.

NUMREV

(numeric) - Numbers Reversed.

NUMPAT

(numeric) - Number-Pattern Matching.

NWDREP

(numeric) - Nonword Repetition.

VAL

(numeric) - Visual-Auditory Learning.

PICREC

(numeric) - Picture Recognition.

MEMWRD

(numeric) - Memory for Words.

PICVOC

(numeric) - Picture Vocabulary.

ORLCMP

(numeric) - Oral Comprehension.

SEGMNT

(numeric) - Segmentation.

RPCNAM

(numeric) - Rapid Picture Naming.

SENREP

(numeric) - Sentence Repetition.

UNDDIR

(numeric) - Understanding Directions.

SNDBLN

(numeric) - Sound Blending.

RETFLU

(numeric) - Retrieval Fluency.

SNDAWR

(numeric) - Sound Awareness.

LWIDNT

(numeric) - Letter-Word Identification.

APPROB

(numeric) - Applied Problems.

SPELL

(numeric) - Spelling.

PSGCMP

(numeric) - Passage Comprehension.

SCI

(numeric) - Science.

SOC

(numeric) - Social Studies.

HUM

(numeric) - Humanities.

Source

McGrew, K. S., LaForte, E. M., & Schrank, F. A. (2014). Technical Manual. Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Schrank, F. A., McGrew, K. S., & Mather, N. (2014). Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.


Woodcock Johnson IV: ages 40 to 90 plus

Description

A list containing the bivariate correlations (N = 1,146) of the 47 cognitive and achievement subtests from the WJ IV for 40- to 90+-year-olds from the standardization sample obtained from the WJ-IV technical manual (McGrew, LaForte, & Schrank, 2014). Tables are reproduced with permission from the publisher.

Usage

WJIV_ages_40_90

Format

A list of 2 with elements "cormat" (47 x 47 matrix of bivariate correlations) and "N". The correlation matrix contains the following variables:

ORLVOC

(numeric) - Oral Vocabulary.

NUMSER

(numeric) - Number Series.

VRBATN

(numeric) - Verbal Attention.

LETPAT

(numeric) - Letter-Pattern Matching.

PHNPRO

(numeric) - Phonological Processing.

STYREC

(numeric) - Story Recall.

VISUAL

(numeric) - Visualization.

GENINF

(numeric) - General Information.

CONFRM

(numeric) - Concept Formation.

NUMREV

(numeric) - Numbers Reversed.

NUMPAT

(numeric) - Number-Pattern Matching.

NWDREP

(numeric) - Nonword Repetition.

VAL

(numeric) - Visual-Auditory Learning.

PICREC

(numeric) - Picture Recognition.

ANLSYN

(numeric) - Analysis-Synthesis.

OBJNUM

(numeric) - Object-Number Sequencing.

PAIRCN

(numeric) - Pair Cancellation.

MEMWRD

(numeric) - Memory for Words.

PICVOC

(numeric) - Picture Vocabulary.

ORLCMP

(numeric) - Oral Comprehension.

SEGMNT

(numeric) - Segmentation.

RPCNAM

(numeric) - Rapid Picture Naming.

SENREP

(numeric) - Sentence Repetition.

UNDDIR

(numeric) - Understanding Directions.

SNDBLN

(numeric) - Sound Blending.

RETFLU

(numeric) - Retrieval Fluency.

SNDAWR

(numeric) - Sound Awareness.

LWIDNT

(numeric) - Letter-Word Identification.

APPROB

(numeric) - Applied Problems.

SPELL

(numeric) - Spelling.

PSGCMP

(numeric) - Passage Comprehension.

CALC

(numeric) - Calculation.

WRTSMP

(numeric) - Writing Samples.

WRDATK

(numeric) - Word Attack.

ORLRDG

(numeric) - Oral Reading.

SNRDFL

(numeric) - Sentence Reading Fluency.

MTHFLU

(numeric) - Math Facts Fluency.

SNWRFL

(numeric) - Sentence Writing Fluency.

RDGREC

(numeric) - Reading Recall.

NUMMAT

(numeric) - Number Matrices.

EDIT

(numeric) - Editing.

WRDFLU

(numeric) - Word Reading Fluency.

SPLSND

(numeric) - Spelling of Sounds.

RDGVOC

(numeric) - Reading Vocabulary.

SCI

(numeric) - Science.

SOC

(numeric) - Social Studies.

HUM

(numeric) - Humanities.

Source

McGrew, K. S., LaForte, E. M., & Schrank, F. A. (2014). Technical Manual. Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Schrank, F. A., McGrew, K. S., & Mather, N. (2014). Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.


Woodcock Johnson IV: ages 6 to 8

Description

A list containing the bivariate correlations (N = 825) of the 47 cognitive and achievement subtests from the WJ IV for 6- to 8-year-olds from the standardization sample obtained from the WJ-IV technical manual (McGrew, LaForte, & Schrank, 2014). Tables are reproduced with permission from the publisher.

Usage

WJIV_ages_6_8

Format

A list of 2 with elements "cormat" (47 x 47 matrix of bivariate correlations) and "N". The correlation matrix contains the following variables:

ORLVOC

(numeric) - Oral Vocabulary.

NUMSER

(numeric) - Number Series.

VRBATN

(numeric) - Verbal Attention.

LETPAT

(numeric) - Letter-Pattern Matching.

PHNPRO

(numeric) - Phonological Processing.

STYREC

(numeric) - Story Recall.

VISUAL

(numeric) - Visualization.

GENINF

(numeric) - General Information.

CONFRM

(numeric) - Concept Formation.

NUMREV

(numeric) - Numbers Reversed.

NUMPAT

(numeric) - Number-Pattern Matching.

NWDREP

(numeric) - Nonword Repetition.

VAL

(numeric) - Visual-Auditory Learning.

PICREC

(numeric) - Picture Recognition.

ANLSYN

(numeric) - Analysis-Synthesis.

OBJNUM

(numeric) - Object-Number Sequencing.

PAIRCN

(numeric) - Pair Cancellation.

MEMWRD

(numeric) - Memory for Words.

PICVOC

(numeric) - Picture Vocabulary.

ORLCMP

(numeric) - Oral Comprehension.

SEGMNT

(numeric) - Segmentation.

RPCNAM

(numeric) - Rapid Picture Naming.

SENREP

(numeric) - Sentence Repetition.

UNDDIR

(numeric) - Understanding Directions.

SNDBLN

(numeric) - Sound Blending.

RETFLU

(numeric) - Retrieval Fluency.

SNDAWR

(numeric) - Sound Awareness.

LWIDNT

(numeric) - Letter-Word Identification.

APPROB

(numeric) - Applied Problems.

SPELL

(numeric) - Spelling.

PSGCMP

(numeric) - Passage Comprehension.

CALC

(numeric) - Calculation.

WRTSMP

(numeric) - Writing Samples.

WRDATK

(numeric) - Word Attack.

ORLRDG

(numeric) - Oral Reading.

SNRDFL

(numeric) - Sentence Reading Fluency.

MTHFLU

(numeric) - Math Facts Fluency.

SNWRFL

(numeric) - Sentence Writing Fluency.

RDGREC

(numeric) - Reading Recall.

NUMMAT

(numeric) - Number Matrices.

EDIT

(numeric) - Editing.

WRDFLU

(numeric) - Word Reading Fluency.

SPLSND

(numeric) - Spelling of Sounds.

RDGVOC

(numeric) - Reading Vocabulary.

SCI

(numeric) - Science.

SOC

(numeric) - Social Studies.

HUM

(numeric) - Humanities.

Source

McGrew, K. S., LaForte, E. M., & Schrank, F. A. (2014). Technical Manual. Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Schrank, F. A., McGrew, K. S., & Mather, N. (2014). Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.


Woodcock Johnson IV: ages 9 to 13

Description

A list containing the bivariate correlations (N = 1,572) of the 47 cognitive and achievement subtests from the WJ IV for 9- to 13-year-olds from the standardization sample obtained from the WJ-IV technical manual (McGrew, LaForte, & Schrank, 2014). Tables are reproduced with permission from the publisher.

Usage

WJIV_ages_9_13

Format

A list of 2 with elements "cormat" (47 x 47 matrix of bivariate correlations) and "N". The correlation matrix contains the following variables:

ORLVOC

(numeric) - Oral Vocabulary.

NUMSER

(numeric) - Number Series.

VRBATN

(numeric) - Verbal Attention.

LETPAT

(numeric) - Letter-Pattern Matching.

PHNPRO

(numeric) - Phonological Processing.

STYREC

(numeric) - Story Recall.

VISUAL

(numeric) - Visualization.

GENINF

(numeric) - General Information.

CONFRM

(numeric) - Concept Formation.

NUMREV

(numeric) - Numbers Reversed.

NUMPAT

(numeric) - Number-Pattern Matching.

NWDREP

(numeric) - Nonword Repetition.

VAL

(numeric) - Visual-Auditory Learning.

PICREC

(numeric) - Picture Recognition.

ANLSYN

(numeric) - Analysis-Synthesis.

OBJNUM

(numeric) - Object-Number Sequencing.

PAIRCN

(numeric) - Pair Cancellation.

MEMWRD

(numeric) - Memory for Words.

PICVOC

(numeric) - Picture Vocabulary.

ORLCMP

(numeric) - Oral Comprehension.

SEGMNT

(numeric) - Segmentation.

RPCNAM

(numeric) - Rapid Picture Naming.

SENREP

(numeric) - Sentence Repetition.

UNDDIR

(numeric) - Understanding Directions.

SNDBLN

(numeric) - Sound Blending.

RETFLU

(numeric) - Retrieval Fluency.

SNDAWR

(numeric) - Sound Awareness.

LWIDNT

(numeric) - Letter-Word Identification.

APPROB

(numeric) - Applied Problems.

SPELL

(numeric) - Spelling.

PSGCMP

(numeric) - Passage Comprehension.

CALC

(numeric) - Calculation.

WRTSMP

(numeric) - Writing Samples.

WRDATK

(numeric) - Word Attack.

ORLRDG

(numeric) - Oral Reading.

SNRDFL

(numeric) - Sentence Reading Fluency.

MTHFLU

(numeric) - Math Facts Fluency.

SNWRFL

(numeric) - Sentence Writing Fluency.

RDGREC

(numeric) - Reading Recall.

NUMMAT

(numeric) - Number Matrices.

EDIT

(numeric) - Editing.

WRDFLU

(numeric) - Word Reading Fluency.

SPLSND

(numeric) - Spelling of Sounds.

RDGVOC

(numeric) - Reading Vocabulary.

SCI

(numeric) - Science.

SOC

(numeric) - Social Studies.

HUM

(numeric) - Humanities.

Source

McGrew, K. S., LaForte, E. M., & Schrank, F. A. (2014). Technical Manual. Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.

Schrank, F. A., McGrew, K. S., & Mather, N. (2014). Woodcock-Johnson IV. Rolling Meadows, IL: Riverside.


Multigroup exploratory factor analysis

Description

Fit an exploratory factor analysis in each of several groups at a common number of factors and bring the per-group solutions into one shared orientation so their loadings can be compared. Each group is fitted with EFA(); the solutions are then aligned either to a symmetric consensus target or to a chosen reference group (see Alignment).

Usage

efa_group(
  x,
  groups = NULL,
  n_factors,
  N = NA,
  reference_group = NULL,
  b_boot = 0L,
  ci = 0.95,
  seed = NULL,
  delta = 0.1,
  invariance = FALSE,
  ...
)

Arguments

x

A data frame or matrix of raw data (with groups), or a named list of per-group data sets – either raw data frames/matrices or correlation matrices (all of one kind).

groups

A vector with one value per row of x, giving each row's group. Only used when x is a single raw data set; leave NULL when x is a list. Rows with a missing group value are dropped with a warning.

n_factors

numeric. The common number of factors extracted in every group.

N

numeric. The number of observations per group, used only for correlation-matrix input: either a single value applied to all groups or one value per group. Ignored for raw data, where N is taken from each group's data. Default is NA.

reference_group

The group to align the others to (a group name or an integer index). If NULL (default), orthogonal and unrotated solutions use the symmetric consensus target; oblique solutions fall back to the first group as reference. Supplying a value forces the reference alignment.

b_boot

numeric. The number of non-parametric bootstrap replicates used to form percentile confidence intervals for the between-group Tucker congruences. 0 (the default) skips the bootstrap and returns the congruence point estimates only. Bootstrapping requires raw data; it is skipped with a warning for correlation-matrix input.

ci

numeric. The confidence level for the bootstrap congruence intervals, a single value in ⁠(0, 1)⁠. Default is 0.95.

seed

numeric or NULL. An optional seed making the bootstrap reproducible and independent of the number of parallel workers (the replicate fits run with future_lapply(), for which a parallel plan can be set via future::plan()). When supplied, the caller's random-number stream is restored afterwards, leaving no side effect. Default is NULL.

delta

numeric. The salience threshold for the per-item loading-difference flag table: an item's loading on a factor is flagged for a group pair when the groups' aligned loadings differ by at least delta in absolute value. This is a descriptive salience heuristic, not a significance test; common alternatives are 0.15 and 0.20. The threshold applies to whatever loading metric the chosen rotation produces (pattern coefficients for an oblique rotation). 0 flags every cell. Default is 0.1.

invariance

logical. Whether to add an approximate-invariance verdict per factor and group pair from the Lorenzo-Seva and ten Berge (2006) congruence bands (see Value). Default is FALSE.

...

Additional arguments passed to EFA() for every group (for example method, rotation, cor_method, type).

Details

Input

Groups can be supplied in two ways: raw data together with a grouping vector (x a data frame or matrix, groups one value per row), or a named list of per-group data sets in x (with groups left NULL). The list may hold raw data frames or correlation matrices (supply N), but not a mix of the two. All groups must contain the same items in the same order; a different item set or order is an error rather than being silently reordered.

Every group is fitted at the same n_factors (a common-k multigroup model). Extra arguments in ... (for example method, rotation, cor_method, or type) are forwarded unchanged to each EFA() call, so the estimator and rotation are common to all groups.

The k-factor model must be identified for the shared item set: its degrees of freedom ((p - k)^2 - (p + k)) / 2 must be non-negative. Unlike a single EFA() fit – which only warns on an under-identified model – a multigroup fit aborts, because a shared alignment target across an under-identified group is not interpretable.

Alignment

A factor solution is identified only up to a rotation of its factors, so the per-group solutions must be brought into a common orientation before their loadings can be compared. Two strategies are available and are chosen automatically:

In both cases the returned per-group loadings share the column order and sign of the returned target.

Comparing the aligned loadings

Because the per-group loadings share one orientation, they can be compared cell by cell. efa_group() reports a per-pair summary of their differences (diffs) and a per-item, per-factor flag table (flags) marking cells whose absolute difference reaches delta. delta is a descriptive salience heuristic, not a significance test; a bootstrap (b_boot > 0) additionally reports whether each difference's confidence interval excludes zero. With invariance = TRUE, a per-factor verdict grades the matched Tucker congruence by the Lorenzo-Seva and ten Berge (2006) similarity bands – "equal" (⁠>= .95⁠) and "fair" (⁠[.85, .95)⁠) – labelling weaker congruences "incongruent"; when a bootstrap is available the verdict uses the congruence CI lower bound, so a factor is judged "equal" only if even the lower bound clears the band.

Value

An object of class efa_group, a list containing:

loadings

A named list of the aligned per-group loading matrices. Their columns match the columns of target in order and sign.

target

The alignment target: the symmetric consensus target, or the reference group's own loadings.

Phi

A named list of the aligned per-group factor intercorrelations for an oblique rotation; NULL otherwise.

congruence

Tucker congruence between the aligned group loadings, a list with: matrices, a nested list whose ⁠[[g]][[h]]⁠ element is the factor-by-factor congruence matrix between the aligned loadings of groups g and h; matched, a groups-by-groups-by-factors array of the matched-factor congruences (the diagonal of each pairwise matrix); and degenerate, a groups-by-groups logical matrix flagging pairs whose congruence is undefined (for example, a near-zero factor), for which the corresponding entries are NA. When b_boot > 0 (raw data), three further elements are added: matched_se, the bootstrap standard error of each matched congruence; matched_ci, a list of lower and upper percentile confidence limits (each a groups-by-groups-by-factors array); and n_boot, the number of bootstrap replicates the intervals are based on.

diffs

A data frame with one row per group pair summarising the differences between their aligned loadings: the mean, median, minimum, and maximum absolute difference, the root-mean-square difference (rmse), and n_flagged, the number of loading cells whose absolute difference reaches delta.

flags

A data frame with one row per group pair, item, and factor giving the signed loading difference (diff), its absolute value (abs_diff), and flagged, whether it reaches delta. When a bootstrap was run (b_boot > 0, raw data), ci_lower, ci_upper, and ci_excludes_0 add the percentile confidence interval for the difference and whether it excludes zero; otherwise these are NA.

invariance

When invariance = TRUE, a data frame with one row per group pair and factor giving the matched Tucker congruence (phi), its bootstrap CI lower bound (phi_lower, NA without a bootstrap), and an approximate-invariance verdict based on the Lorenzo-Seva and ten Berge (2006) similarity bands: phi >= 0.95 is "equal" and ⁠[0.85, 0.95)⁠ is "fair"; congruences ⁠< 0.85⁠, below their bands, are labelled "incongruent". The verdict is read from phi_lower when a bootstrap is available (conservative) and from phi otherwise. NULL when invariance = FALSE.

efa

The named list of per-group EFA() objects (each retains its own diagnostics, e.g. heywood).

alignment

The alignment result: the consensus object (see PROCRUSTES()), or a list with the reference group, the target, and the per-group Procrustes results.

settings

A list of the settings used, including the per-group N, the alignment method, the rotation, the estimator, the input type, and whether a bootstrap is available (can_bootstrap, FALSE for correlation-matrix input).

References

Efron, B., & Tibshirani, R. J. (1993). An Introduction to the Bootstrap. Chapman & Hall.

Gower, J. C. (1975). Generalized Procrustes analysis. Psychometrika, 40, 33-51. doi: 10.1007/BF02291478

Lorenzo-Seva, U., and ten Berge, J. M. F. (2006). Tucker's congruence coefficient as a meaningful index of factor similarity. Methodology, 2, 57-64. doi: 10.1027/1614-2241.2.2.57

See Also

Other factor analysis: plot.efa_group(), print.efa_group()

Examples

# Raw data split by a grouping vector (unrotated, consensus alignment)
g <- rep(c("g1", "g2"), length.out = nrow(GRiPS_raw))
mg <- efa_group(GRiPS_raw, groups = g, n_factors = 1)
mg$loadings

# Per-pair difference summary and the per-item salience-flag table
mg$diffs
mg$flags


# Percentile bootstrap confidence intervals for the between-group congruences, with an
# approximate-invariance verdict read conservatively off the congruence CI lower bound
mg_ci <- efa_group(GRiPS_raw, groups = g, n_factors = 1, b_boot = 100, seed = 42,
                   invariance = TRUE)
mg_ci$congruence$matched_ci
mg_ci$invariance

# A named list of correlation matrices sharing the same items, common
# three-factor model, orthogonal rotation -> symmetric consensus target
bands <- list(age_6_8 = WJIV_ages_6_8$cormat, age_14_19 = WJIV_ages_14_19$cormat)
Ns <- c(WJIV_ages_6_8$N, WJIV_ages_14_19$N)
efa_group(bands, n_factors = 3, N = Ns, rotation = "varimax")

# An oblique rotation aligns to a reference group (reported via a message)
efa_group(bands, n_factors = 3, N = Ns, rotation = "promax")



Power analysis for exploratory factor analysis

Description

Power analysis for exploratory factor analysis, in two modes selected by mode.

mode = "rmsea" (the default) gives the analytic statistical power of the root mean square error of approximation (RMSEA) tests of close and not-close fit (MacCallum, Browne, & Sugawara, 1996): given the model degrees of freedom and a sample size it returns the power to reject the null hypothesis, and given a target power instead of a sample size it returns the sample size required to reach it.

mode = "simulation" runs a Monte-Carlo study of a known population: it draws n_datasets samples of size N (via efa_simulate()) and, over the replicates, reports how often each factor-retention criterion recovers the true number of factors (the hit-rate), how often the fitted loadings recover the population structure (structure recovery, by Tucker congruence), and the convergence and Heywood-case rate of the fit.

Usage

efa_power(
  mode = c("rmsea", "simulation"),
  type = c("close", "notclose"),
  eps0 = NULL,
  eps1 = NULL,
  N = NULL,
  p = NULL,
  k = NULL,
  df = NULL,
  alpha = 0.05,
  power = NULL,
  group = 1,
  Lambda = NULL,
  Phi = NULL,
  Psi = NULL,
  R = NULL,
  n_datasets = 500,
  criteria = c("EKC", "MAP"),
  method = "PAF",
  rotation = NULL,
  recovery_threshold = 0.95,
  model_error = c("TKL", "CB", "WB", "none"),
  target_rmsea = NULL,
  target_cfi = NULL,
  seed = NULL
)

Arguments

mode

character. The kind of power analysis: "rmsea" (the default; analytic RMSEA power) or "simulation" (Monte-Carlo hit-rate and structure recovery). The remaining arguments split by mode – type/eps0/eps1/df/alpha/power/group are RMSEA-only, and Lambda/Phi/Psi/R/n_datasets/criteria/method/rotation/recovery_threshold/model_error/target_rmsea/target_cfi/seed are simulation-only.

type

character. The RMSEA test: "close" (test of close fit) or "notclose" (test of not-close fit). See Details.

eps0

numeric. The null-hypothesis RMSEA. Default is 0.05.

eps1

numeric. The alternative-hypothesis RMSEA (the true RMSEA power is evaluated at). Default is 0.08 for type = "close" and 0.01 for type = "notclose".

N

numeric. The (per-group) sample size. Give N to compute power; leave it NULL to solve for the required N at a target power.

p

numeric. The number of observed variables. Used with k to derive df when df is not given directly.

k

numeric. The number of factors. In "rmsea" mode, used with p to derive df when df is not given directly. In "simulation" mode it is the true number of factors: it is required with an R population and must be left unset (or match ncol(Lambda)) with a factor-model population.

df

numeric. The model degrees of freedom. Either supply df directly or supply both p and k, from which df = ((p - k)^2 - (p + k)) / 2. Must be positive.

alpha

numeric. The significance level. Default is 0.05.

power

numeric. The target power. Give power (or leave both power and N NULL, defaulting to 0.80) to solve for the required N; leave it NULL while giving N to compute power. Exactly one of N and power is solved for.

group

numeric. The number of groups. Default is 1. See Details.

Lambda

matrix. Simulation mode. A p by k_true population loading matrix. Supply this (optionally with Phi/Psi) to build a factor-model population; structure recovery is available only with this form. Passed to efa_simulate().

Phi

matrix. Simulation mode. The k_true by k_true population factor intercorrelations. Only used with Lambda; defaults to orthogonal factors. When rotation is unset, an oblique Phi selects a "promax" recovery fit and an orthogonal one a "varimax" fit.

Psi

numeric or matrix. Simulation mode. The population unique variances (a length-p vector or a p by p matrix). Only used with Lambda. Passed to efa_simulate().

R

matrix. Simulation mode. A p by p population correlation matrix to draw from directly, instead of a factor model. Structure recovery is not available for this form (there are no population loadings to recover), and k is required.

n_datasets

numeric. Simulation mode. The number of samples to draw and analyse. Default is 500.

criteria

character. Simulation mode. The factor-retention criteria to evaluate the hit-rate for, any of "CD", "EKC", "HULL", "KGC", "MAP", "NEST", "PARALLEL", and "SMT" (see N_FACTORS()). Default is c("EKC", "MAP"). Criteria that simulate internally ("CD", "HULL", "NEST", "PARALLEL") make each run substantially slower.

method

character. Simulation mode. The estimation method ("PAF", "ML", or "ULS") used for the recovery fit and the retention criteria. Default is "PAF".

rotation

character. Simulation mode. The rotation for the recovery fit, passed to EFA(). Default is NULL, which matches the population: "varimax" for orthogonal factors and "promax" for oblique ones (a single factor is left unrotated). Recovery aligns the fitted loadings to the population pattern by permutation and sign only, so a rotation that does not seek that structure – for example "none" with more than one factor – understates recovery; keep the default (or another structure-seeking rotation) for a meaningful recovery rate.

recovery_threshold

numeric. Simulation mode. The matched-factor Tucker congruence a replicate must reach to count as recovered. Default is 0.95 (the Lorenzo-Seva & ten Berge, 2006, "equal" band).

model_error

character. Simulation mode. The efa_simulate() method used to perturb the population with model error: "TKL" (Tucker-Koopman-Linn, the default), "CB" (Cudeck-Browne), "WB" (Wu-Browne), or "none" for an exact population. It takes effect only when a target is supplied (target_rmsea and/or target_cfi); without one the population is exact whatever the method, and only a factor-model population can be perturbed. "TKL" adds minor common factors, so it degrades both the retention hit-rate and structure recovery realistically; "CB" and "WB" target the RMSEA only, and "CB" keeps the fitted loadings the exact minimizer so structure recovery stays near-perfect.

target_rmsea

numeric. Simulation mode. The population RMSEA the model should have relative to the perturbed population, activating model error. Default is NULL. Passed to efa_simulate().

target_cfi

numeric. Simulation mode. The population CFI target (only with model_error = "TKL"). Default is NULL. Passed to efa_simulate().

seed

numeric. Simulation mode. Optional seed making the draws and analysis reproducible and worker-count independent; the caller's random-number stream is restored afterwards. Default is NULL.

Value

An object of class efa_power. For mode = "rmsea", a list containing:

power

The power of the test at N (the achieved power, which for a solved sample size is at least the target).

N

The (per-group) sample size: the supplied N, or the solved required sample size.

crit

The critical chi-square value the fit statistic is compared against.

ncp

The noncentrality parameters under the null (H0, from eps0) and the alternative (H1, from eps1).

solve_for

"power" or "N", recording which quantity was solved for.

settings

A list of the inputs: mode, type, eps0, eps1, df, p, k, alpha, group, and the target power (the value solved to when solve_for is "N", otherwise NULL).

For mode = "simulation", a list containing:

hit_rate

A named numeric vector of the retention hit-rate per criterion (and, where a criterion has several variants, per variant). The denominator is the number of replicates on which the criterion returned a definite factor count (n_valid below), so replicates where it errored or was undecided are excluded rather than counted as misses.

hits

A data frame with, per criterion, the number of replicates it returned a definite suggestion on (n_valid), the number of those that matched k_true (hits), and the hit_rate (hits / n_valid).

recovery

For a factor-model population, a list with the structure-recovery rates (min_rate, mean_rate), the threshold, and the number of usable fits (n_valid); NULL for an R population. Rates are over every replicate whose fit returned loadings, including non-converged or Heywood solutions (their rates are reported separately in convergence).

convergence

A list with the number of datasets, the number of fits that completed (n_fit_ok), and rates: fit_rate (fits completed, over all datasets) and convergence_rate / heywood_rate (converged / Heywood, over the completed fits).

replicates

The raw per-replicate values: the suggested factor counts (n_hat), the matched congruences (rec_min, rec_mean), and the converged, heywood, and fit_ok flags.

k_true

The true number of factors.

model_error

The efa_simulate() model-error record, or NULL.

settings

A list of the simulation inputs.

RMSEA mode

The RMSEA fit statistic is referred to a noncentral chi-square distribution. For a model with df degrees of freedom and population RMSEA \varepsilon, the noncentrality parameter is

\lambda = (N - 1)\, df\, \varepsilon^2 / G,

where N is the sample size and G the number of groups (group).

Two tests are supported, selected by type (never by the ordering of eps0 and eps1):

"close"

The test of close fit (MacCallum et al., 1996): the null hypothesis is that the fit is close (RMSEA \le eps0, conventionally 0.05), and power is computed against a worse alternative (eps1, conventionally 0.08, so eps0 < eps1), in the upper tail.

"notclose"

The test of not-close fit: the null hypothesis is that the fit is not close (RMSEA \ge eps0), and power is computed against a better alternative (eps1, conventionally 0.01, so eps0 > eps1), in the lower tail.

When eps0 and eps1 are ordered the wrong way round for the chosen type a message is emitted but the requested test is still computed. Equal eps0 and eps1 leave nothing to detect and are an error.

Power increases monotonically with N, so the required sample size (the smallest N reaching power) is found by bisection. It is a per-group sample size: with group > 1 the noncentrality carries the 1 / group factor above.

Simulation mode

The population is supplied either as a factor model (Lambda, with optional Phi and Psi) or as a ready correlation matrix R, and passed to efa_simulate(), which draws n_datasets samples of size N. By default the population fits the factor model exactly, which overstates how well the criteria and the fit recover the structure; supplying a misfit target (target_rmsea and/or target_cfi) perturbs it with model error (model_error, "TKL" by default) so the model fits only approximately – a more realistic target (MacCallum, 2003). The true number of factors k_true is ncol(Lambda) for a factor-model population, or k for a bare R.

Each replicate is analysed three ways. Hit-rate: every criterion in criteria is run and its suggested number of factors compared with k_true; the hit-rate is the proportion of agreements over the replicates on which the criterion returned a definite factor count (replicates where it errored or was undecided are excluded, not counted as misses). Structure recovery (only for a factor-model population): the k_true-factor model is fitted with EFA(), its rotated loadings are matched to the population loadings, and the matched-factor Tucker congruences (Lorenzo-Seva & ten Berge, 2006) are compared with recovery_threshold; a replicate counts as a success when the smallest (min) or the average (mean) matched congruence reaches it. Convergence: the same fit supplies the proportion of replicates whose fit completed and, among those, the proportion that converged and that produced a Heywood case.

Replicates are analysed in parallel with future.apply; a plan is selected with future::plan(). Each replicate is bound to its own reproducible random-number stream, so with a fixed seed the result is identical regardless of the number of workers, and the caller's random-number state is left unchanged.

References

MacCallum, R. C., Browne, M. W., & Sugawara, H. M. (1996). Power analysis and determination of sample size for covariance structure modeling. Psychological Methods, 1(2), 130-149. doi:10.1037/1082-989X.1.2.130

MacCallum, R. C. (2003). 2001 Presidential Address: Working with imperfect models. Multivariate Behavioral Research, 38(1), 113-139. doi:10.1207/S15327906MBR3801_5

Lorenzo-Seva, U., & ten Berge, J. M. F. (2006). Tucker's congruence coefficient as a meaningful index of factor similarity. Methodology, 2(2), 57-64. doi:10.1027/1614-2241.2.2.57

See Also

Other power analysis: plot.efa_power(), print.efa_power()

Examples

# Power of the test of close fit at N = 200 for a 100-df model
efa_power(df = 100, N = 200)

# Deriving df from the model dimensions instead of giving it directly
efa_power(p = 20, k = 3, N = 200)

# Required (per-group) sample size for 80% power
efa_power(df = 100, power = 0.80)

# Test of not-close fit
efa_power(df = 100, N = 200, type = "notclose")


# Simulation mode: retention hit-rate and structure recovery for a known
# three-factor population at N = 300
efa_power("simulation", Lambda = population_models$loadings$baseline,
          Phi = population_models$phis_3$moderate, N = 300,
          n_datasets = 50, criteria = c("EKC", "MAP"), seed = 42)



Reliability and common-variance coefficients for a factor solution

Description

Computes model-based reliability coefficients (McDonald's omega total, hierarchical, and subscale; standardized Cronbach's alpha; and the H index) together with the bifactor common-variance indices (explained common variance, ECV, and percent of uncontaminated correlations, PUC) for the general factor and each group factor, and returns them as a tidy, long-format table. The coefficients can be obtained from a Schmid-Leiman solution (SL() or psych::schmid()), an oblique EFA() (correlated-factors) solution, a lavaan single-factor, second-order, or bifactor fit, a raw bifactor loading matrix, or manually supplied components.

Usage

efa_reliability(
  model = NULL,
  coefficients = NULL,
  g_name = "g",
  group_names = NULL,
  factor_map = NULL,
  variance = c("correlation", "sums_load"),
  var_names = NULL,
  fac_names = NULL,
  g_load = NULL,
  s_load = NULL,
  u2 = NULL,
  cormat = NULL,
  pattern = NULL,
  Phi = NULL
)

Arguments

model

a SL(), schmid (psych::schmid()), EFA() (oblique), or lavaan object; a raw bifactor loading matrix (general factor first); or NULL to supply the components manually via g_load, s_load, u2, and var_names.

coefficients

character. An optional subset of the coefficients to return, any of "omega_total", "omega_hierarchical", "omega_subscale", "alpha", "H", "ECV", and "PUC". Default NULL returns all of them.

g_name

character. The name of the general factor in the lavaan solution. Only needed for a lavaan second-order or bifactor fit. Default is "g".

group_names

character. An optional vector of group names for a lavaan multiple-group fit. Its length must match the number of groups.

factor_map

matrix. A logical or 0/1 matrix indicating which variable corresponds to which group factor, with the same dimensions as the group loading matrix (cross-loadings are allowed). If NULL (default), each variable is assigned to the group factor on which it loads most strongly. Not used for lavaan input.

variance

character. The total-variance denominator for the coefficients: "correlation" (default) takes it from the correlation matrix (the observed-score omega, as in psych::omega()); "sums_load" uses the model-implied composite variance from the squared loading sums and the uniquenesses (see OMEGA()), which needs no correlation matrix and so is the way to score a bare loading matrix or manual components given without one. Some inputs fix the convention: lavaan is always model-implied and an oblique EFA() is always correlation-based.

var_names

character. Subtest names in the row order of the loadings. Only needed when model is NULL.

fac_names

character. An optional vector of group-factor names in the column order of the loadings. Taken from the input if NULL.

g_load

numeric. General-factor loadings. Only needed when model is NULL.

s_load

matrix. Group-factor loadings. Only needed when model is NULL.

u2

numeric. Uniquenesses. Only needed when model is NULL (or to override the communality-based default for a raw bifactor matrix).

cormat

matrix. A correlation matrix used when variance = "correlation". If NULL, it is taken from the input object or reconstructed from pattern and Phi where possible (see OMEGA()).

pattern

matrix. Pattern coefficients from an oblique solution, used with Phi to reconstruct cormat when model is NULL and no cormat is given.

Phi

matrix. Factor intercorrelations from an oblique solution, used with pattern.

Details

Coefficients

The reliability coefficients are McDonald's omegas (McDonald, 1978, 1985, 1999), standardized Cronbach's alpha (Cronbach, 1951), and the H index (construct replicability; Hancock & Mueller, 2001). The common-variance indices are the ECV and PUC (Bonifay et al., 2015; Reise et al., 2013; Rodriguez et al., 2016a, 2016b); they describe the general factor and so are reported for the general factor only. See OMEGA() for the definition and interpretation of each coefficient.

Input

The dispatch on model mirrors OMEGA(), with two additions: an oblique EFA() object is scored as the correlated-factors model it is (having no general factor, it omits the bifactor indices – omega hierarchical, ECV, and PUC), and a bare loading matrix is read as a raw bifactor solution (general factor in the first column). For a correlated-factors EFA() solution variance is always "correlation". The indicator-to-factor correspondences come from factor_map when it is supplied; otherwise each variable is assigned to the group factor on which it loads most strongly. For lavaan input the composite variances are model-implied (variance is not used), and the coefficients are computed per group.

Value

An object of class efa_reliability: a long-format data frame with one row per computed coefficient, with columns

coefficient

the coefficient name (e.g. "omega_total").

level

"general" for the general-factor row, "group" otherwise.

factor

the factor label ("g" for the general factor).

group

the group label, or NA for a single ungrouped solution.

value

the coefficient value.

Structurally undefined cells (for example ECV and PUC on a group factor) are omitted. The object carries a settings attribute (the total-variance convention used) and a kind attribute tagging each coefficient as a reliability coefficient or a common-variance index, and has a print() method.

Source

McDonald, R. P. (1978). Generalizability in factorable domains: Domain validity and generalizability. Educational and Psychological Measurement, 38, 75-79.

McDonald, R. P. (1985). Factor analysis and related methods. Hillsdale, NJ: Erlbaum.

McDonald, R. P. (1999). Test theory: A unified treatment. Mahwah, NJ: Erlbaum.

Cronbach, L. J. (1951). Coefficient alpha and the internal structure of tests. Psychometrika, 16, 297-334.

Hancock, G. R., & Mueller, R. O. (2001). Rethinking construct reliability within latent variable systems. In R. Cudeck, S. du Toit, & D. Sörbom (Eds.), Structural equation modeling: Present and future (pp. 195-216). Lincolnwood, IL: Scientific Software International.

Bonifay, W. E., Reise, S. P., Scheines, R., & Meijer, R. R. (2015). When are multidimensional data unidimensional enough for structural equation modeling? An evaluation of the DETECT multidimensionality index. Structural Equation Modeling, 22, 504-516.

Reise, S. P., Scheines, R., Widaman, K. F., & Haviland, M. G. (2013). Multidimensionality and structural coefficient bias in structural equation modeling: A bifactor perspective. Educational and Psychological Measurement, 73, 5-26.

Rodriguez, A., Reise, S. P., & Haviland, M. G. (2016a). Applying bifactor statistical indices in the evaluation of psychological measures. Journal of Personality Assessment, 98, 223-237.

Rodriguez, A., Reise, S. P., & Haviland, M. G. (2016b). Evaluating bifactor models: Calculating and interpreting statistical indices. Psychological Methods, 21, 137-150.

See Also

OMEGA() for the same coefficients in a wide, per-factor layout.

Other reliability coefficients: print.efa_reliability()

Examples

## From an oblique EFA (correlated-factors) solution. With no factor_map, each
## item is auto-assigned to its highest-loading factor.
efa_mod <- EFA(test_models$baseline$cormat, N = 500, n_factors = 3,
               type = "EFAtools", method = "PAF", rotation = "promax")
efa_reliability(efa_mod)

## From a Schmid-Leiman solution, with an explicit indicator-to-factor map.
sl_mod <- SL(efa_mod, type = "EFAtools", method = "PAF")
fc <- sl_mod$sl[, c("F1", "F2", "F3")] >= .2
efa_reliability(sl_mod, factor_map = fc)

## Request a subset of the coefficients only.
efa_reliability(sl_mod, factor_map = fc,
                coefficients = c("omega_total", "alpha"))

## From a lavaan bifactor solution.

if (requireNamespace("lavaan", quietly = TRUE)) {
mod <- 'F1 =~ V1 + V2 + V3 + V4 + V5 + V6
        F2 =~ V7 + V8 + V9 + V10 + V11 + V12
        F3 =~ V13 + V14 + V15 + V16 + V17 + V18
        g =~ V1 + V2 + V3 + V4 + V5 + V6 + V7 + V8 + V9 + V10 + V11 + V12 +
             V13 + V14 + V15 + V16 + V17 + V18'
fit <- lavaan::cfa(mod, sample.cov = test_models$baseline$cormat,
                   sample.nobs = 500, estimator = "ml", orthogonal = TRUE)
efa_reliability(fit, g_name = "g")
}



Estimate factor scores and score-quality diagnostics for an EFA model

Description

Computes factor-score weights (and, from raw data, the factor scores themselves) natively for an EFA() solution or a directly supplied loading matrix, together with the score-quality diagnostics that describe how well the estimated scores represent the factors: the score intercorrelations, the determinacy (validity) and univocality of each score, and Guttman's indeterminacy index. Factor scores are returned only when raw data are supplied; a correlation matrix yields the weights and diagnostics alone.

Usage

efa_scores(
  x,
  f,
  Phi = NULL,
  rho = NULL,
  method = c("regression", "Bartlett", "Anderson", "tenBerge", "Harman", "components")
)

Arguments

x

data.frame or matrix. Raw data (needed to obtain factor scores) or a correlation matrix (yields weights and diagnostics only). When raw data carry column names, they are matched to the model variables by name (any extra columns are ignored, and a model variable missing from x is an error); unnamed data are matched by position.

f

object of class EFA(), a LOADINGS object, or a matrix of factor loadings.

Phi

matrix. Factor intercorrelations. Only used when a loading matrix is supplied directly in f; taken from the EFA object otherwise. Default is NULL, in which case the factors are assumed uncorrelated.

rho

matrix. Correlation matrix used to derive the scoring weights. Defaults to NULL, in which case f$orig_R is used for an EFA object and cor(x, use = "pairwise") otherwise. Pass a matrix here to score against a correlation other than the one implied by f/x.

method

character. The factor-score method: one of "regression" (default), "Bartlett", "Anderson", "tenBerge", "Harman", or "components".

Details

The p by m weight matrix W (standardized scores are scale(X) %*% W) is computed from the structure matrix S = Lambda %*% Phi, the model uniquenesses Psi = diag(1 - h2), and the scoring correlation matrix R according to method:

"regression"

Thurstone's (1935) regression scores, ⁠W = R^-1 S⁠.

"Bartlett"

Bartlett's (1937) conditionally unbiased scores.

"Anderson"

Anderson & Rubin's (1956) uncorrelated, unit-variance scores; defined for orthogonal factors only.

"tenBerge"

ten Berge, Krijnen, Wansbeek & Shapiro's (1999) scores, which preserve the factor intercorrelations.

"Harman"

Harman's (1976) idealized-variable scores.

"components"

component scores, W = Lambda.

The determinacy (validity) of a score is its correlation with the factor it estimates, computed from the returned weights; for regression scores it is the multiple correlation between the factor and the observed variables (Guttman, 1955; Grice, 2001). The off-diagonal score-factor correlations give the univocality (the correlation of a score with the other factors), and ⁠2 rho^2 - 1⁠ is Guttman's (1955) indeterminacy index, the minimum correlation between two equally valid sets of scores. For a method other than "regression" both quantities are specific to those scores: the determinacy is the method's own score-factor correlation (never larger than the regression value), and the reported guttman follows from it.

Value

An object of class efa_scores, a list containing:

weights

The p by m factor-score weight matrix.

scores

The factor scores (n by m), or NULL when a correlation matrix was supplied.

r.scores

The m by m correlations of the factor-score estimates.

score_cor

The m by m score-factor correlation matrix; its diagonal is the determinacy (validity) of each score and its off-diagonals the univocality.

determinacy

A data frame with, per factor, the determinacy rho, the squared determinacy rho2, and Guttman's indeterminacy index guttman.

settings

A list of the settings used.

Source

Thurstone, L. L. (1935). The vectors of mind. University of Chicago Press.

Bartlett, M. S. (1937). The statistical conception of mental factors. British Journal of Psychology, 28, 97-104.

Anderson, T. W., & Rubin, H. (1956). Statistical inference in factor analysis. In Proceedings of the Third Berkeley Symposium on Mathematical Statistics and Probability (Vol. 5, pp. 111-150). University of California Press.

Guttman, L. (1955). The determinacy of factor score matrices with implications for five other basic problems of common-factor theory. British Journal of Statistical Psychology, 8, 65-81.

ten Berge, J. M. F., Krijnen, W. P., Wansbeek, T., & Shapiro, A. (1999). Some new results on correlation-preserving factor scores prediction methods. Linear Algebra and its Applications, 289, 311-318.

Grice, J. W. (2001). Computing and evaluating factor scores. Psychological Methods, 6, 430-450.

See Also

Other factor scoring: FACTOR_SCORES(), print.efa_scores()

Examples

# Weights and score diagnostics from an EFA on a correlation matrix
efa <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500,
           method = "PAF", rotation = "oblimin")
fs <- efa_scores(test_models$baseline$cormat, f = efa)
fs
summary(fs)

# Factor scores from raw data (Bartlett method)

efa_raw <- EFA(GRiPS_raw, n_factors = 1, method = "PAF")
efa_scores(GRiPS_raw, f = efa_raw, method = "Bartlett")


# Loadings supplied directly, with the factor intercorrelations
efa_scores(test_models$baseline$cormat, f = efa$rot_loadings, Phi = efa$Phi)


Screen data for exploratory factor analysis

Description

Computes a set of diagnostics describing how suitable a correlation matrix (or raw data) is for exploratory factor analysis: the Kaiser-Meyer-Olkin (KMO) measure of sampling adequacy overall and per variable, Bartlett's test of sphericity, the determinant and condition number of the correlation matrix, and the squared multiple correlation (SMC) of each variable with all the others.

Usage

efa_screen(
  x,
  N = NA,
  use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
    "na.or.complete"),
  cor_method = c("pearson", "spearman", "kendall", "poly", "tetra"),
  mcd_alpha = 0.5,
  outlier_cutoff = 0.975,
  seed = NULL
)

Arguments

x

data.frame or matrix. Data frame or matrix of raw data, or a matrix of correlations.

N

numeric. The number of observations. Only needs to be specified when a correlation matrix is supplied; it is required for Bartlett's test of sphericity and is taken from the data when raw data are supplied. Default is NA.

use

character. Passed to stats::cor() if raw data are supplied. Default is "pairwise.complete.obs".

cor_method

character. Correlation computed from raw data: "pearson", "spearman", or "kendall" (passed to stats::cor()), or "poly" / "tetra" for polychoric / tetrachoric correlations of ordinal / binary data (a two-step estimator with no empty-cell continuity correction). Default is "pearson".

mcd_alpha

numeric. The proportion of observations covered by the minimum covariance determinant (MCD) subset used for the robust outlier diagnostics, in [0.5, 1]. The default, 0.5, gives the most robust (highest-breakdown) estimate; larger values trade robustness for efficiency. Only used when raw data are supplied.

outlier_cutoff

numeric. The probability defining the chi-square cutoff for flagging a multivariate outlier: an observation is flagged when its squared robust distance exceeds qchisq(outlier_cutoff, p) for p variables. Default is 0.975. Only used when raw data are supplied.

seed

integer. Optional seed for the random subsets drawn by the MCD algorithm, making the outlier diagnostics reproducible; the caller's random-number-generator state is left unchanged. Default is NULL. Only used when raw data are supplied.

Details

The diagnostics are computed from the analysis correlation matrix R:

KMO

The Kaiser-Meyer-Olkin measure of sampling adequacy (Kaiser, 1970; Kaiser & Rice, 1974), overall and for each variable. Larger values (a rough floor of .50) indicate greater suitability for factor analysis; see KMO().

Bartlett

Bartlett's (1951) test of sphericity, the likelihood-ratio test of the hypothesis that R is an identity matrix, with df = p(p - 1)/2 for p variables. It requires the sample size N; when N is unavailable (a correlation matrix supplied without N) the test is skipped with a warning, ⁠$bartlett⁠ is NULL, and the remaining diagnostics are still returned. See BARTLETT().

Determinant

The determinant of R. A value near zero signals extreme multicollinearity or a (near-)singular matrix; as a rough guide, a determinant below about 0.00001 is commonly taken as a sign of multicollinearity (Field, 2018).

Condition number

The ratio of the largest to the smallest eigenvalue of R. Large values indicate an ill-conditioned matrix with near-linear dependencies among the variables. Its square root is the condition index: an index above 30 is a conventional sign of strong multicollinearity, and 10 to 30 of moderate multicollinearity (Belsley, Kuh & Welsch, 1980).

SMC

The squared multiple correlation of each variable with all the others, 1 - 1/(R^{-1})_{ii}. A low SMC flags a variable that shares little variance with the rest of the set.

Variance and missing data

The variance of each variable (over its available values) and the percentage of missing values. These, and the category tabulation below, are computed column by column from the supplied data using every non-missing value, and so do not depend on use, which governs only the correlation matrix. Under a listwise use ("complete.obs" / "na.or.complete") the correlation matrix and N are based on the complete cases, while the missingness is reported over every supplied row so that it explains why N is smaller; the number of supplied rows is recorded in settings$n_obs. Available only from raw data.

Categories

For each variable with fewer than ten distinct values (treated as categorical), the response-category counts, flagging a sparse category (fewer than five responses) and, for integer-coded variables, an empty interior category (an unused category between the smallest and largest observed value). A variable with ten or more distinct values is treated as continuous and is not tabulated. As a rough guide, items with fewer than five response categories are better analysed with an ordinal estimator (polychoric correlations with categorical least squares) than with normal-theory maximum likelihood (Rhemtulla et al., 2012). Available only from raw data.

Multivariate normality

Two tests of multivariate normality computed from the complete cases of the raw data: Mardia's (1970) multivariate skewness and kurtosis, and the Henze-Zirkler (1990) omnibus test. A small p-value indicates a departure from multivariate normality, a reason to prefer robust or ordinal estimation over normal-theory maximum likelihood. Available only from raw data, and skipped with a note if the complete-case covariance is singular.

Outliers

Multivariate outliers flagged by their robust Mahalanobis distance. A high-breakdown robust location and scatter are estimated from the complete cases with the fast minimum covariance determinant (MCD) algorithm (Rousseeuw & Van Driessen, 1999), using a subset covering a proportion mcd_alpha of the observations; an observation whose squared robust distance exceeds qchisq(outlier_cutoff, p) is flagged. With too few complete cases (n \le 2p) or collinear variables the robust covariance is undefined, so the classical Mahalanobis distance is used instead with a warning; if even that covariance is singular the diagnostic is skipped with a note. Available only from raw data.

Value

An object of class efa_screen, a list containing:

kmo

A list with the overall KMO (KMO) and the per-variable KMO (KMO_i).

bartlett

A list with Bartlett's chi-square statistic (chisq), its p_value, and its degrees of freedom (df); chisq and p_value are NA when N is too small for the Bartlett correction. NULL when N is unavailable.

determinant

The determinant of the correlation matrix.

condition

The condition number of the correlation matrix (largest over smallest eigenvalue).

smc

The per-variable squared multiple correlations.

per_item

A data frame with one row per variable (row names are the variable names) holding the per-item diagnostics: variance (over the available values), missing (percentage of missing values), smc, kmo_i, and flags (a comma-separated list of any sparse/empty-category issues, the empty string "" for a categorical variable with none, and NA for a variable treated as continuous). NULL when a correlation matrix is supplied.

normality

Multivariate-normality diagnostics computed from the complete cases of the raw data: a list with mardia (Mardia's multivariate skewness statistic skewness, its degrees of freedom skewness_df and p-value skewness_p, a small_sample flag recording whether the small-sample skewness correction was applied, the standardised kurtosis statistic and its p-value kurtosis_p, and the underlying coefficients b1p and b2p), hz (the Henze-Zirkler statistic and its p_value), and n_complete (the number of complete cases used). When the complete-case covariance is singular the tests are skipped and a classed note (of class efa_screen_no_mvn) is returned instead, alongside a warning. NULL when a correlation matrix is supplied.

outliers

Multivariate-outlier diagnostics from the complete cases of the raw data: a list with distances (each complete case's robust Mahalanobis distance, named by its row number in the supplied data), cutoff (the flagging threshold on the distance scale, sqrt(qchisq(outlier_cutoff, p)), directly comparable to distances), flagged (the row numbers, in the supplied data, whose robust distance exceeds cutoff), center and cov (the robust location and scatter underlying the distances), method ("mcd" for the robust estimate, or "classical" when the fallback was used), and n_complete (the number of complete cases). When neither a robust nor a classical covariance can be formed a classed note (of class efa_screen_no_outliers) is returned instead. NULL when a correlation matrix is supplied.

categories

A named list with, for each variable treated as categorical, the response-category counts (in category order); NA for a variable treated as continuous. NULL when a correlation matrix is supplied.

note

A classed note explaining that the raw-data diagnostics need raw data; NULL when raw data are supplied.

settings

A list of the settings used, including n_obs, the number of rows in the supplied raw data (NA for a correlation-matrix input).

Source

Bartlett, M. S. (1951). The effect of standardization on a Chi-square approximation in factor analysis. Biometrika, 38, 337-344.

Belsley, D. A., Kuh, E. & Welsch, R. E. (1980). Regression diagnostics: Identifying influential data and sources of collinearity. Wiley.

Croux, C. & Haesbroeck, G. (1999). Influence function and efficiency of the minimum covariance determinant scatter matrix estimator. Journal of Multivariate Analysis, 71, 161-190.

Field, A. (2018). Discovering statistics using IBM SPSS statistics (5th ed.). Sage.

Henze, N. & Zirkler, B. (1990). A class of invariant consistent tests for multivariate normality. Communications in Statistics - Theory and Methods, 19, 3595-3617.

Kaiser, H. F. (1970). A second generation little jiffy. Psychometrika, 35, 401-415.

Kaiser, H. F. & Rice, J. (1974). Little jiffy, mark IV. Educational and Psychological Measurement, 34, 111-117.

Mardia, K. V. (1970). Measures of multivariate skewness and kurtosis with applications. Biometrika, 57, 519-530.

Mardia, K. V. (1974). Applications of some measures of multivariate skewness and kurtosis in testing normality and robustness studies. Sankhya B, 36, 115-128.

Pison, G., Van Aelst, S. & Willems, G. (2002). Small sample corrections for LTS and MCD. Metrika, 55, 111-123.

Rhemtulla, M., Brosseau-Liard, P. E. & Savalei, V. (2012). When can categorical variables be treated as continuous? A comparison of robust continuous and categorical SEM estimation methods under suboptimal conditions. Psychological Methods, 17, 354-373.

Rousseeuw, P. J. & Van Driessen, K. (1999). A fast algorithm for the minimum covariance determinant estimator. Technometrics, 41, 212-223.

See Also

KMO() and BARTLETT() for the individual suitability measures, and N_FACTORS() for factor retention criteria.

Other factor analysis suitability: print.efa_screen()

Examples

# From a correlation matrix (supply N for Bartlett's test of sphericity)
efa_screen(test_models$baseline$cormat, N = 500)

# From raw data (N is taken from the data)
efa_screen(GRiPS_raw)


Simulate data from a common-factor population model

Description

Draws data from a population correlation matrix, given either directly or built from a factor model. The population correlation is either supplied in R, or assembled from a loading matrix Lambda, the factor intercorrelations Phi, and the unique variances Psi as R = Lambda\, Phi\, Lambda' + Psi, standardized to a correlation matrix. By default (marginals = "normal") cases are drawn with normal marginals via a matrix square root of the population correlation (a Cholesky factor, or a symmetric eigen square root for a positive-semidefinite but singular population). With marginals = "empirical" the cases instead reproduce the population correlation while carrying the empirical marginal distributions of a supplied data set. With marginals = "VM" or "IG" the cases reproduce the population correlation while carrying non-normal marginals with a prescribed skewness and kurtosis. Setting categories additionally discretizes the drawn data into ordered categories, optionally so that the population polychoric correlation of the categorized data equals the target correlation. Setting target_rmsea or target_cfi perturbs the population with model error, so the factor model fits it only approximately (a more realistic simulation target).

Usage

efa_simulate(
  N = NULL,
  Lambda = NULL,
  Phi = NULL,
  Psi = NULL,
  R = NULL,
  model_error = c("CB", "TKL", "WB", "none"),
  target_rmsea = NULL,
  target_cfi = NULL,
  marginals = c("normal", "empirical", "VM", "IG"),
  marginal_data = NULL,
  n_factors = NULL,
  skewness = NULL,
  kurtosis = NULL,
  force_pd = FALSE,
  categories = NULL,
  match = NULL,
  missing = c("none", "MCAR", "MAR", "MNAR"),
  missing_prop = NULL,
  missing_strength = NULL,
  missing_predictor = NULL,
  n_datasets = 1L,
  seed = NULL,
  return_pop = FALSE
)

Arguments

N

numeric. Number of cases (rows) to draw per dataset. Required unless return_pop = TRUE.

Lambda

matrix. A p by m matrix of factor loadings. Supply this (optionally with Phi and Psi) instead of R to build the population from a factor model.

Phi

matrix. The m by m factor intercorrelation matrix. Only used with Lambda. Default is NULL, in which case the factors are orthogonal (an identity matrix).

Psi

numeric vector or matrix. The unique variances: either a length-p vector or a p by p matrix (added as the residual covariance). Only used with Lambda. Default is NULL, in which case the unique variances that standardize the population to a correlation matrix are used.

R

matrix. A p by p population correlation matrix to draw from directly. Supply this instead of Lambda/Phi/Psi.

model_error

character. The method used to perturb the population so the factor model fits it imperfectly ("model error"): one of "CB" (Cudeck-Browne, the default), "TKL" (Tucker-Koopman-Linn), "WB" (Wu-Browne), or "none". Model error is only applied when a target is supplied in target_rmsea or target_cfi; without one the population is exact, whatever model_error. Only used with a factor-model population (Lambda).

target_rmsea

numeric. The population RMSEA the factor model should have relative to the perturbed population, a single number strictly in ⁠(0, 1)⁠. Supplying it activates model error. Simulating from an exact population overstates recovery, so a realistic value (around 0.05) is recommended for simulation studies (MacCallum, 2003). Default is NULL (an exact population; do not pass 0). Required for "CB" and "WB"; optional for "TKL".

target_cfi

numeric. Only used with model_error = "TKL": the population CFI to target, a single number strictly in ⁠(0, 1)⁠, on its own or together with target_rmsea (TKL then trades the two off). Default is NULL (do not pass 1). "CB" and "WB" target the RMSEA only.

marginals

character. The marginal distribution of the drawn data: one of "normal" (the default), which draws normal marginals; "empirical", which reproduces the population correlation while preserving the empirical marginals supplied in marginal_data; or "VM" (Vale-Maurelli) and "IG" (independent generator), which draw non-normal marginals with the target skewness and kurtosis.

marginal_data

matrix or data frame. Only used with marginals = "empirical", where it is required: a data set with one numeric column per variable (p columns), each with at least two distinct values, whose per-column distributions are resampled as the marginals of the drawn data. Its correlations are ignored. Default is NULL.

n_factors

numeric. Only used with marginals = "empirical": the number of factors the rank-matching reproduction fits. Default is NULL, in which case it is the number of columns of Lambda when the population is built from a factor model; it must be given when the population is supplied via R.

skewness

numeric. Only used with marginals = "VM" or "IG": the target marginal skewness, as a single value applied to every variable or a length-p vector. Default is NULL (0, a symmetric marginal). At least one of skewness or kurtosis must be given for these marginals.

kurtosis

numeric. Only used with marginals = "VM" or "IG": the target marginal excess kurtosis (0 for a normal marginal), as a single value applied to every variable or a length-p vector. Default is NULL (0).

force_pd

logical. Used with marginals = "VM" and with Cudeck-Browne model error (model_error = "CB"). If the Vale-Maurelli intermediate correlation matrix (or, for CB, the perturbed population at a large target_rmsea) is not positive definite, FALSE (the default) rejects it with an error, while TRUE projects it to the nearest correlation matrix (with a warning). Has no effect for the "TKL" or "WB" methods.

categories

numeric or list. Requests ordinal output by discretizing each variable into ordered categories. Either a count of equally probable categories (a single value applied to every variable or a length-p vector), or a length-p list of numeric vectors giving the marginal category proportions per variable (each strictly positive and summing to 1). Default is NULL, which returns the continuous data.

match

character. Only used with categories: how the categorization relates to the population correlation. "thresholds" cuts the drawn data at the standard-normal-scale thresholds (for marginals "normal", "VM", or "IG"; not "empirical"), with an attenuated ordinal Pearson correlation; "polychoric" requires normal latents (marginals = "normal") and makes the population polychoric correlation of the categorized data equal the target correlation. Default is NULL ("thresholds" when categories is set).

missing

character. An optional missing-data mechanism to impose on the drawn data: one of "none" (the default, complete data), "MCAR" (missing completely at random), "MAR" (missing at random, depending on another variable), or "MNAR" (missing not at random, depending on the variable's own value). Introduced values become NA.

missing_prop

numeric. Only used when missing is not "none", where it is required: the target marginal proportion of missing values per variable, a single number strictly between 0 and 1. This is the expected rate; the realized rate of a given draw varies around it.

missing_strength

numeric. Only used with missing = "MAR" or "MNAR": the slope of the logistic missingness model, setting how strongly the missing probability depends on the predictor. Default is NULL (1, a moderate dependence); 0 removes the dependence (equivalent to MCAR at the same rate) and large magnitudes make missingness nearly deterministic.

missing_predictor

integer or character. Only used with missing = "MAR": which variable drives each variable's missingness, as one column index or variable name per variable. Each must reference another variable, not itself (so a single shared predictor is not allowed – it would predict its own missingness). Default is NULL, in which case each variable's missingness is driven by the next variable cyclically (so variable order matters; supply this explicitly when the order is arbitrary).

n_datasets

numeric. The number of datasets to draw. Default is 1. With more than one, a list of datasets is returned.

seed

numeric. Optional seed for reproducible draws. When supplied, the caller's random-number stream is saved and restored, so the call leaves the global RNG state unchanged. Default is NULL (no seeding).

return_pop

logical. If TRUE, return only the population correlation matrix and draw no data. Default is FALSE.

Details

Provide the population either as a ready correlation matrix in R, or through the model components Lambda, Phi, and Psi; the two ways are mutually exclusive. When the model components are used, Phi defaults to the identity matrix (orthogonal factors) and Psi defaults to the unique variances that make the population a correlation matrix (1 - \mathrm{diag}(Lambda\, Phi\, Lambda')); the assembled covariance is standardized with stats::cov2cor() so a non-standardized Psi still yields a correlation matrix. With the default Psi, a factor model whose implied communalities exceed 1 (a Heywood case) leaves no unique variance and is rejected; a Psi you supply is instead only required to give positive variances and a positive-semidefinite population.

With marginals = "empirical", the iterative rank-matching algorithm of Ruscio and Kaczetow (2008) reproduces the population correlation while each variable takes the empirical marginal distribution of the matching column of marginal_data (resampled with replacement). Only the marginals of marginal_data are used; its own correlations are ignored, and the drawn columns follow the population's variables, not those of marginal_data.

With marginals = "VM" (Vale-Maurelli, 1983) or "IG" (the independent-generator method; Foldnes & Olsson, 2016), the cases reproduce the population correlation while carrying non-normal marginals with the target skewness and (excess) kurtosis. The Vale-Maurelli family does not span every valid non-normal distribution (Foldnes & Grønneberg, 2015); "IG" covers distributions "VM" cannot. Both accept skewness and kurtosis as a single value (used for every variable) or one value per variable, defaulting the unset one to 0. Not every (skewness, kurtosis) pair is attainable: every distribution needs excess kurtosis of at least skewness^2 - 2, and the method covers a smaller region still, so an unreachable request is rejected. For marginals = "VM", the intermediate correlation matrix used for the draw can itself be non-positive-definite; it is rejected unless force_pd = TRUE, which projects it to the nearest correlation matrix (via psych::cor.smooth()) with a warning.

With categories, the drawn data are discretized into ordered categories (an integer code 1 to K). categories gives either the number of equally probable categories (one count for every variable, or one per variable) or, as a list of proportion vectors, the marginal category proportions per variable. Two matching modes set what the categorization preserves. With match = "thresholds" (the default) the data are cut at normal-scale thresholds (Olsson, 1979) that reproduce the requested proportions exactly for normal marginals and approximately for the "VM" and "IG" marginals; because categorization attenuates product-moment correlations, the categorized data's Pearson correlation is smaller in magnitude than the population correlation (and, under non-normal marginals, its polychoric correlation departs from the population as well). With match = "polychoric" the latent is required to be normal (marginals = "normal") and the cases are drawn multivariate-normal and thresholded, so the population polychoric correlation of the categorized data equals the target; combining it with non-normal marginals is rejected. Ordinal output is not available with marginals = "empirical". Empty categories left by a draw are reported with a warning, as they destabilize the polychoric correlation and the factor analysis.

With missing, missing values are introduced into the drawn data under a chosen mechanism (Rubin, 1976), each variable holed at a target expected rate missing_prop. "MCAR" draws an independent mask, so missingness is unrelated to the data. "MAR" and "MNAR" set each case's missing probability by a logistic model of a standardized predictor: another variable for "MAR" (chosen by missing_predictor) or the variable's own value for "MNAR", with slope missing_strength. The mechanism acts on the drawn (latent) values, so when categories also discretizes the data the missingness is keyed on the underlying value, not the category code. For "MAR" the predictor uses the complete drawn values. The returned matrix carries the NAs, which the correlation estimators handle downstream.

With model_error, the population is perturbed away from the exact factor structure so the q-factor model (q = ncol(Lambda)) fits it only approximately, at a prescribed misfit; exact factor structures are unrealistic and overstate recovery in simulation studies (MacCallum, 2003). The perturbation is applied once to the population, and the achieved fit is computed with the same fit-index formulas EFA() uses and returned in the model_error element. It is applied only when a target is supplied (target_rmsea and/or target_cfi), needs a factor-model population (Lambda) with residual degrees of freedom and an exact factor structure (a diagonal Psi), and is orthogonal to the marginal, ordinal, and missing-data options. Three methods are available. "CB" (Cudeck & Browne, 1992) matches the target RMSEA to numerical precision and keeps the q-factor model the exact minimizer (the CFI follows as a derived quantity). "TKL" (Tucker, Koopman & Linn, 1969) adds minor common factors tuned so the achieved RMSEA – and, optionally, CFI – match the target(s); with a single target the match is close, with both it is a compromise. "WB" (Wu & Browne, 2015) draws the population from an inverse-Wishart distribution around the model-implied correlation; being a single random draw, its realized RMSEA varies around the target (and tends to exceed it), so the realized value is reported rather than guaranteed. "CB" and "WB" target the RMSEA only; "TKL" can target the RMSEA and/or the CFI. The reported RMSEA/CFI is the misfit of the specified generating model.

Replicated draws (n_datasets > 1) are generated in parallel across replicates with future.apply; a parallel plan can be selected with future::plan() (the default plan runs sequentially). Each replicate is assigned its own reproducible random-number stream, so with a fixed seed the output is identical regardless of the number of workers.

Value

An object of class efa_simulated: a list with elements data (the simulated data – an N by p numeric matrix, an integer matrix of category codes when categories is set, or a length-n_datasets list of these when n_datasets > 1; NULL when return_pop = TRUE), population (the p by p population correlation matrix drawn from, model-error-perturbed when requested), model_error (NULL, or a list of the method and the target and achieved RMSEA/CFI when model error was applied), and settings. Printing the object shows a compact summary.

References

Cudeck, R., & Browne, M. W. (1992). Constructing a covariance matrix that yields a specified minimizer and a specified minimum discrepancy function value. Psychometrika, 57(3), 357-369. doi:10.1007/BF02295424

Fleishman, A. I. (1978). A method for simulating non-normal distributions. Psychometrika, 43(4), 521-532. doi:10.1007/BF02293811

Foldnes, N., & Grønneberg, S. (2015). How general is the Vale-Maurelli simulation approach? Psychometrika, 80(4), 1066-1083. doi:10.1007/s11336-014-9414-0

Foldnes, N., & Olsson, U. H. (2016). A simple simulation technique for nonnormal data with prespecified skewness, kurtosis, and covariance matrix. Multivariate Behavioral Research, 51(2-3), 207-219. doi:10.1080/00273171.2015.1133274

MacCallum, R. C. (2003). 2001 Presidential Address: Working with imperfect models. Multivariate Behavioral Research, 38(1), 113-139. doi:10.1207/S15327906MBR3801_5

Olsson, U. (1979). Maximum likelihood estimation of the polychoric correlation coefficient. Psychometrika, 44(4), 443-460. doi:10.1007/BF02296207

Olvera Astivia, O. L., & Zumbo, B. D. (2019). A note on the solution multiplicity of the Vale-Maurelli intermediate correlation equation. Journal of Educational and Behavioral Statistics, 44(2), 127-143. doi:10.3102/1076998618803381

Rubin, D. B. (1976). Inference and missing data. Biometrika, 63(3), 581-592. doi:10.1093/biomet/63.3.581

Ruscio, J., & Kaczetow, W. (2008). Simulating multivariate nonnormal data using an iterative algorithm. Multivariate Behavioral Research, 43(3), 355-381. doi:10.1080/00273170802285693

Tucker, L. R., Koopman, R. F., & Linn, R. L. (1969). Evaluation of factor analytic research procedures by means of simulated correlation matrices. Psychometrika, 34(4), 421-459. doi:10.1007/BF02290601

Vale, C. D., & Maurelli, V. A. (1983). Simulating multivariate nonnormal distributions. Psychometrika, 48(3), 465-471. doi:10.1007/BF02293687

Wu, H., & Browne, M. W. (2015). Quantifying adventitious error in a covariance structure as a random effect. Psychometrika, 80(3), 571-600. doi:10.1007/s11336-015-9451-3

See Also

Other data simulation: print.efa_simulated()

Examples

# Build a population from a shipped loading pattern and factor correlations
Lambda <- population_models$loadings$baseline
Phi <- population_models$phis_3$moderate

# Draw one normal dataset of 500 cases (the data live in $data)
sim <- efa_simulate(N = 500, Lambda = Lambda, Phi = Phi, seed = 42)
dim(sim$data)

# Return only the population correlation matrix
R_pop <- efa_simulate(Lambda = Lambda, Phi = Phi, return_pop = TRUE)$population

# Draw several datasets at once from a supplied correlation matrix
sims <- efa_simulate(N = 500, R = R_pop, n_datasets = 3, seed = 42)
length(sims$data)

# Reproduce the population correlation but with skewed, empirical marginals
# (here from a chi-squared source with one column per variable)
src <- matrix(rchisq(200 * nrow(Lambda), df = 3), ncol = nrow(Lambda))
dat_emp <- efa_simulate(N = 500, Lambda = Lambda, Phi = Phi,
                        marginals = "empirical", marginal_data = src, seed = 42)

# Draw skewed, leptokurtic data with the Vale-Maurelli method
dat_vm <- efa_simulate(N = 500, Lambda = Lambda, Phi = Phi, marginals = "VM",
                       skewness = 1.5, kurtosis = 4, seed = 42)

# Draw five-category ordinal data whose polychoric correlation matches R
dat_ord <- efa_simulate(N = 500, Lambda = Lambda, Phi = Phi,
                        categories = 5, match = "polychoric", seed = 42)

# Draw data with 15% missing at random, driven by a neighbouring item
dat_mar <- efa_simulate(N = 500, Lambda = Lambda, Phi = Phi, missing = "MAR",
                        missing_prop = 0.15, seed = 42)
colMeans(is.na(dat_mar$data))

# Add realistic model error: a population the model fits with RMSEA of about .05
# (Cudeck-Browne, the default method; the achieved fit is reported)
sim_me <- efa_simulate(N = 500, Lambda = Lambda, Phi = Phi,
                       target_rmsea = 0.05, seed = 42)
sim_me$model_error$rmsea

Format method for N_FACTORS objects

Description

Format method for N_FACTORS objects

Usage

## S3 method for class 'N_FACTORS'
format(x, ...)

Arguments

x

an object of class N_FACTORS, returned by N_FACTORS().

...

not used.

Value

A character vector with the report lines (styled to the active console theme; plain when colours are disabled).

Examples


nf <- N_FACTORS(test_models$baseline$cormat, criteria = c("EKC", "SMT"),
                N = 500)
writeLines(format(nf))


Format method for efa_retention objects

Description

Format method for efa_retention objects

Usage

## S3 method for class 'efa_retention'
format(x, ...)

Arguments

x

an object of class efa_retention, returned by a factor-retention criterion (e.g. EKC() or HULL()).

...

not used.

Value

A character vector with the report lines (styled to the active console theme; plain when colours are disabled).

Examples

writeLines(format(EKC(test_models$baseline$cormat, N = 500)))

Plot COMPARE object

Description

Plot method for the COMPARE() function showing the distribution of the absolute differences between the two compared objects as a violin plot with jittered points. Differences above the threshold are highlighted.

Usage

## S3 method for class 'COMPARE'
plot(x, ...)

Arguments

x

list. An object of class COMPARE (output from the COMPARE() function).

...

not used.

Value

A ggplot object showing the absolute differences, with differences above plot_red highlighted in red.

Examples

# A type SPSS EFA to mimick the SPSS implementation
EFA_SPSS_5 <- EFA(IDS2_R, n_factors = 5, type = "SPSS")

# A type psych EFA to mimick the psych::fa() implementation
EFA_psych_5 <- EFA(IDS2_R, n_factors = 5, type = "psych")

# compare the two and plot the differences
comp <- COMPARE(EFA_SPSS_5$unrot_loadings, EFA_psych_5$unrot_loadings,
                x_labels = c("SPSS", "psych"))
plot(comp)

Plot EFA_AVERAGE object

Description

Plot method showing a summarized output of the EFA_AVERAGE function

Usage

## S3 method for class 'EFA_AVERAGE'
plot(x, ...)

Arguments

x

list. An output from the EFA_AVERAGE function.

...

not used.

Value

A ggplot object showing, for each indicator and factor, the minimum, maximum, and average (mean or median) loading across the averaged solutions.

Examples

## Not run: 
EFA_aver <- EFA_AVERAGE(test_models$baseline$cormat, n_factors = 3, N = 500)
plot(EFA_aver)

## End(Not run)


Plot method for N_FACTORS objects

Description

Plots every factor-retention criterion in the N_FACTORS() result that has a plottable outcome (see plot.efa_retention()); criteria without a plot (e.g. MAP() or SMT()) are skipped.

Usage

## S3 method for class 'N_FACTORS'
plot(x, ...)

Arguments

x

an object of class N_FACTORS, returned by N_FACTORS().

...

not used.

Value

A named list of ggplot2::ggplot objects, one per criterion with a plottable result, or invisibly NULL if there is none.

Examples


nf <- N_FACTORS(test_models$baseline$cormat, criteria = c("EKC", "SMT"),
                N = 500)
plot(nf)


Plot a multigroup factor analysis

Description

Two views of an efa_group() result, selected by type:

Usage

## S3 method for class 'efa_group'
plot(x, type = c("congruence", "differences"), ...)

Arguments

x

An object of class efa_group (output from efa_group()).

type

character. Which plot to draw: "congruence" (per-factor congruence with confidence intervals) or "differences" (a per-item loading-difference heatmap).

...

Not used; for consistency with the generic.

Details

Value

A ggplot2::ggplot object.

References

Lorenzo-Seva, U., and ten Berge, J. M. F. (2006). Tucker's congruence coefficient as a meaningful index of factor similarity. Methodology, 2, 57-64. doi: 10.1027/1614-2241.2.2.57

See Also

Other factor analysis: efa_group(), print.efa_group()

Examples

g <- rep(c("g1", "g2"), length.out = nrow(GRiPS_raw))
mg <- efa_group(GRiPS_raw, groups = g, n_factors = 1)

# Per-factor congruence against the Lorenzo-Seva & ten Berge bands
plot(mg)

# Per-item cross-group loading-difference heatmap
plot(mg, type = "differences")

Plot the RMSEA power curve

Description

Draws the analytic RMSEA power (MacCallum, Browne, & Sugawara, 1996) of an efa_power() result as a function of the (per-group) sample size, mirroring semTools::plotRMSEApower() but returning a ggplot2::ggplot object rather than drawing to the active device. The test, its null and alternative RMSEA, the significance level, and the number of groups are taken from the object; only the sample-size axis is swept, with an optional sweep of the degrees of freedom or the alternative RMSEA to overlay several curves.

Usage

## S3 method for class 'efa_power'
plot(x, n = NULL, df = NULL, eps1 = NULL, ...)

Arguments

x

An object of class efa_power (output from efa_power()).

n

numeric. The (per-group) sample sizes to evaluate. If NULL (the default) a sequence bracketing the object's sample size is chosen automatically.

df

numeric. The model degrees of freedom (must be positive). Defaults to the object's df; a vector of length greater than one draws one curve per value.

eps1

numeric. The alternative-hypothesis RMSEA (must differ from the null eps0). Defaults to the object's eps1; a vector of length greater than one draws one curve per value. At most one of df and eps1 may be a vector.

...

Not used; for consistency with the generic.

Details

When the plotted curve is the object's own – a single curve with neither df nor eps1 overridden – it is annotated with the object's result: a dashed vertical line at its sample size x$N, a dashed horizontal line at the reference power (the target power when a sample size was solved for, otherwise the power achieved at x$N), and a point at x$N and the achieved power. Overriding df or eps1, sweeping either as a vector, or supplying an n that does not span x$N moves that point off the drawn curve, so the marks are then omitted.

Value

A ggplot2::ggplot object.

References

MacCallum, R. C., Browne, M. W., & Sugawara, H. M. (1996). Power analysis and determination of sample size for covariance structure modeling. Psychological Methods, 1(2), 130-149. doi:10.1037/1082-989X.1.2.130

See Also

Other power analysis: efa_power(), print.efa_power()

Examples

pw <- efa_power(df = 100, N = 200)

# Power curve for the test of close fit, marking the object's own N
plot(pw)

# Overlay several models by sweeping the degrees of freedom
plot(pw, df = c(50, 100, 200))

# Sweep the alternative RMSEA instead
plot(pw, eps1 = c(0.06, 0.08, 0.10))

Plot method for efa_retention objects

Description

Plots the result of a factor-retention criterion. Eigenvalue-based criteria (e.g. EKC()) are shown as an eigenvalue plot, the Hull method (HULL()) as a convex-hull plot. Criteria with more than one sub-variant are faceted.

Usage

## S3 method for class 'efa_retention'
plot(x, ...)

Arguments

x

an object of class efa_retention, returned by a factor-retention criterion (e.g. EKC() or HULL()).

...

not used.

Value

A ggplot2::ggplot object, or invisibly NULL if the criterion has no plottable result.

Examples

plot(EKC(test_models$baseline$cormat, N = 500))

population_models

Description

Population factor models, some of which (baseline to case_11e) used for the simulation analyses reported in Grieder and Steiner (2022). All combinations of the pattern matrices and the factor intercorrelations were used in the simulations. Many models are based on cases used in de Winter and Dodou (2012).

Usage

population_models

Format

A list of 3 lists "loadings", "phis_3", and "phis_6".

loadings contains the following matrices of pattern coefficients:

baseline

(matrix) - The pattern coefficients of the baseline model. Three factors with six indicators each, all with pattern coefficients of .6. Same baseline model as used in de Winter and Dodou (2012).

case_1a

(matrix) - Three factors with 2 indicators per factor.

case_1b

(matrix) - Three factors with 3 indicators per factor. Case 5 in de Winter and Dodou (2012).

case_1c

(matrix) - Three factors with 4 indicators per factor.

case_1d

(matrix) - Three factors with 5 indicators per factor.

case_2

(matrix) - Same as baseline model but with low pattern coefficients of .3.

case_3

(matrix) - Same as baseline model but with high pattern coefficients of .9.

case_4

(matrix) - Three factors with different pattern coefficients between factors (one factor with .9, one with .6, and one with .3, respectively). Case 7 in de Winter and Dodou (2012).

case_5

(matrix) - Three factors with different pattern coefficients within factors (each factor has two pattern coefficients of each .9, .6, and .3). Similar to cases 8/ 9 in de Winter and Dodou (2012).

case_6a

(matrix) - Same as baseline model but with one cross loading of .4. Similar to case 10 in de Winter and Dodou (2012).

case_6b

(matrix) - Same as baseline model but with three cross loading of .4 (One factor with 2 and one with 1 crossloading). Similar to case 10 in de Winter and Dodou (2012).

case_7

(matrix) - Three factors with different number of indicators per factor (2, 4, and 6 respectively). Similar to cases 11/ 12 in de Winter and Dodou (2012).

case_8

(matrix) - Three factors with random variation in pattern coefficients added, drawn from a uniform distribution between [-.2, .2]. Case 13 in de Winter and Dodou (2012).

case_9a

(matrix) - Three factors with 2 indicators per factor, with different pattern coefficients within one of the factors.

case_9b

(matrix) - Three factors with 3 indicators per factor, with different pattern coefficients.

case_9c

(matrix) - Three factors with 4 indicators per factor, with different pattern coefficients.

case_9d

(matrix) - Three factors with 5 indicators per factor, with different pattern coefficients.

case_10a

(matrix) - Six factors with 2 indicators per factor, all with pattern coefficients of .6.

case_10b

(matrix) - Six factors with 3 indicators per factor, all with pattern coefficients of .6.

case_10c

(matrix) - Six factors with 4 indicators per factor, all with pattern coefficients of .6.

case_10d

(matrix) - Six factors with 5 indicators per factor, all with pattern coefficients of .6.

case_10e

(matrix) - Six factors with 6 indicators per factor, all with pattern coefficients of .6.

case_11a

(matrix) - Six factors with 2 indicators per factor, with different pattern coefficients within and between factors (.3, .6, and .9).

case_11b

(matrix) - Six factors with 3 indicators per factor, with different pattern coefficients within and between factors (.3, .6, and .9).

case_11c

(matrix) - Six factors with 4 indicators per factor, with different pattern coefficients within and between factors (.3, .6, and .9).

case_11d

(matrix) - Six factors with 5 indicators per factor, with different pattern coefficients within and between factors (.3, .6, and .9).

case_11e

(matrix) - Six factors with 6 indicators per factor, with different pattern coefficients within and between factors (.3, .6, and .9).

case_12a

(matrix) - One factor, with 2 equal pattern coefficients (.6).

case_12b

(matrix) - One factor, with 3 equal pattern coefficients (.6).

case_12c

(matrix) - One factor, with 6 equal pattern coefficients (.6).

case_12d

(matrix) - One factor, with 10 equal pattern coefficients (.6).

case_12e

(matrix) - One factor, with 15 equal pattern coefficients (.6).

case_13a

(matrix) - One factor, with 2 different pattern coefficients (.3, and .6).

case_13b

(matrix) - One factor, with 3 different pattern coefficients (.3, .6, and .9).

case_13c

(matrix) - One factor, with 6 different pattern coefficients (.3, .6, and .9).

case_13d

(matrix) - One factor, with 10 different pattern coefficients (.3, .6, and .9).

case_13e

(matrix) - One factor, with 15 different pattern coefficients (.3, .6, and .9).

case_14a

(matrix) - No factor, 2 variables (0).

case_14b

(matrix) - No factor, 3 variables (0).

case_14c

(matrix) - No factor, 6 variables (0).

case_14d

(matrix) - No factor, 10 variables (0).

case_14e

(matrix) - No factor, 15 variables (0).

phis_3 contains the following 3x3 matrices:

zero

(matrix) - Matrix of factor intercorrelations of 0. Same intercorrelations as used in de Winter and Dodou (2012).

moderate

(matrix) - Matrix of moderate factor intercorrelations of .3.

mixed

(matrix) - Matrix of mixed (.3, .5, and .7) factor intercorrelations.

strong

(matrix) - Matrix of strong factor intercorrelations of .7. Same intercorrelations as used in de Winter and Dodou (2012).

phis_6 contains the following 6x6 matrices:

zero

(matrix) - Matrix of factor intercorrelations of 0. Same intercorrelations as used in de Winter and Dodou (2012).

moderate

(matrix) - Matrix of moderate factor intercorrelations of .3.

mixed

(matrix) - Matrix of mixed (around .3, .5, and .7; smoothing was necessary for the matrix to be positive definite) factor intercorrelations.

strong

(matrix) - Matrix of strong factor intercorrelations of .7. Same intercorrelations as used in de Winter and Dodou (2012).

Source

Grieder, S., & Steiner, M. D. (2022). Algorithmic jingle jungle: A comparison of implementations of principal axis factoring and promax rotation in R and SPSS. Behavior Research Methods, 54, 54–74. doi: 10.3758/s13428-021-01581-x

de Winter, J.C.F., & Dodou, D. (2012). Factor recovery by principal axis factoring and maximum likelihood factor analysis as a function of factor pattern and sample size. Journal of Applied Statistics. 39.


Print and format a BARTLETT object

Description

print() reports the outcome of BARTLETT()'s test of sphericity: a verdict on whether the test was significant (and what that implies for the suitability of the data for factor analysis), followed by the chi-square statistic, its degrees of freedom, and the p-value. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'BARTLETT'
print(x, ...)

## S3 method for class 'BARTLETT'
format(x, ...)

Arguments

x

An object of class BARTLETT (output from BARTLETT()).

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

Examples

bart <- BARTLETT(test_models$baseline$cormat, N = 500)
bart

# format() returns the same lines as plain text:
writeLines(format(bart))


Print and format a COMPARE object

Description

print() shows a summarised output of the COMPARE() function: the mean (with its range), median, the number of decimals to which all numbers agree, and the minimum number of decimals provided, followed (optionally) by the table of elementwise differences. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'COMPARE'
print(x, ...)

## S3 method for class 'COMPARE'
format(x, ...)

Arguments

x

An object of class COMPARE (output from COMPARE()).

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

Examples

# A type SPSS EFA to mimick the SPSS implementation
EFA_SPSS_5 <- EFA(IDS2_R, n_factors = 5, type = "SPSS")

# A type psych EFA to mimick the psych::fa() implementation
EFA_psych_5 <- EFA(IDS2_R, n_factors = 5, type = "psych")

# compare the two
comp <- COMPARE(EFA_SPSS_5$unrot_loadings, EFA_psych_5$unrot_loadings,
                x_labels = c("SPSS", "psych"))
comp

# format() returns the same lines as plain text:
writeLines(format(comp))


Print and summarise an EFA object

Description

print() shows a concise overview of an EFA() or EFA_POOLED() solution: a model header, the loading matrix (with the factor intercorrelations for oblique solutions), the variances accounted for, and the model fit. summary() returns a summary.EFA object whose print method adds the full diagnostics: model and simple-structure diagnostics, confidence-interval tables, the structure matrix, multiple-imputation uncertainty (for pooled objects), and residual diagnostics. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'EFA'
print(x, ...)

## S3 method for class 'EFA_POOLED'
print(x, ...)

## S3 method for class 'EFA'
format(
  x,
  cutoff = 0.3,
  digits = 3,
  max_name_length = 10,
  sort_loadings = c("none", "primary", "clustered"),
  show_loading_legend = TRUE,
  max_factors_per_block = NULL,
  ...
)

## S3 method for class 'EFA_POOLED'
format(x, ...)

## S3 method for class 'EFA'
summary(
  object,
  cutoff = 0.3,
  digits = 3,
  max_name_length = 10,
  ci = c("auto", "none", "separate"),
  ci_filter = c("salient", "all", "nonzero"),
  diagnostics_top_n = 10,
  residual_cutoff = 0.1,
  residual_top_n = 10,
  show_structure = TRUE,
  sort_loadings = c("none", "primary", "clustered"),
  show_loading_legend = TRUE,
  cross_loading_cutoff = cutoff,
  min_primary_gap = 0.2,
  min_salient_per_factor = 3,
  max_factors_per_block = NULL,
  show_mi_diagnostics = NULL,
  ...
)

## S3 method for class 'EFA_POOLED'
summary(object, ...)

## S3 method for class 'summary.EFA'
print(x, ...)

## S3 method for class 'summary.EFA'
format(x, ...)

Arguments

x, object

An object of class EFA or EFA_POOLED; for the summary.EFA methods, the object returned by summary().

...

Further arguments passed to print.LOADINGS().

cutoff

numeric. The absolute value at or above which loadings are emphasised in the loading table. Default is .3.

digits

numeric. Number of decimal places for the printed tables. Default is 3.

max_name_length

numeric. Maximum length of the variable names to display; longer names are cut from the right.

sort_loadings

character. Optional row sorting for the loading table. See print.LOADINGS().

show_loading_legend

logical. Whether to print a short legend for the loading-table styling. Default is TRUE.

max_factors_per_block

numeric or NULL. Maximum number of factor columns per loading-table block. If NULL, chosen from the console width.

ci

character. Which confidence intervals summary() shows, if available. "auto" and "separate" print CI sections when CIs were computed; "none" suppresses them. Default is "auto".

ci_filter

character. Which loading CIs summary() prints: "salient" (default), "all", or "nonzero"; see Details.

diagnostics_top_n

numeric. Maximum number of item-level entries summary() prints per simple-structure diagnostic.

residual_cutoff

numeric. Absolute residual cutoff for the residual diagnostics in summary(). Default is .1.

residual_top_n

numeric. Maximum number of residuals summary() prints. Use Inf to print all residuals above residual_cutoff.

show_structure

logical. Whether summary() prints the structure matrix for oblique solutions when available. Default is TRUE.

cross_loading_cutoff

numeric. Cutoff for counting cross-loadings in the summary() diagnostics. Defaults to cutoff.

min_primary_gap

numeric. Minimum desired absolute difference between the largest and second-largest absolute loading of an item, used in the summary() diagnostics.

min_salient_per_factor

numeric. Minimum number of salient indicators per factor used in the summary() diagnostics. Default is 3.

show_mi_diagnostics

logical or NULL. Whether summary() prints a multiple-imputation uncertainty summary for pooled EFAs. NULL shows it for pooled objects.

Details

The methods are shared by single-imputation EFA objects and pooled EFA_POOLED objects. For EFA_POOLED objects the header reports the number of imputations and the alignment/pooling settings; confidence intervals and a multiple-imputation uncertainty summary are shown by summary() when the pooled object carries bootstrap/MI quantities.

In summary(), ci_filter controls which loading intervals are shown: "salient" reports intervals for loadings whose absolute point estimate is at least cutoff, "nonzero" reports intervals excluding zero, and "all" reports every finite interval.

Value

print() and the print method for summary.EFA objects return their argument invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled). summary() returns an object of class summary.EFA.

Examples

mod <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500,
           method = "PAF", rotation = "promax")
mod

# The full diagnostics, CI tables, and residual diagnostics:
summary(mod)

# format() returns plain text, e.g. for embedding in a report:
writeLines(format(mod))


Print and format an EFA_AVERAGE object

Description

print() shows a summarised output of the EFA_AVERAGE function: the averaging settings, the error/convergence/Heywood/admissibility rates, the indicator-to-factor correspondences, the averaged loadings (and, for oblique solutions, the factor intercorrelations), the variances accounted for, and the model fit. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'EFA_AVERAGE'
print(x, stat = c("average", "range"), plot = FALSE, ...)

## S3 method for class 'EFA_AVERAGE'
format(x, stat = c("average", "range"), ...)

Arguments

x

An object of class EFA_AVERAGE (output from EFA_AVERAGE()).

stat

character. A vector with the statistics to print. Possible inputs are "average", "sd", "range", "min", and "max". Default is "average" and "range".

plot

logical. Whether a plot of the average and min- max loadings should be created. Default is FALSE. If more than 10 factors are extracted, no plot is created. Only used by print().

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

Examples

## Not run: 
EFA_aver <- EFA_AVERAGE(test_models$baseline$cormat, n_factors = 3, N = 500)
EFA_aver

# format() returns the same lines as plain text:
writeLines(format(EFA_aver))

## End(Not run)

Print and format a KMO object

Description

print() shows the Kaiser-Meyer-Olkin (KMO) criterion computed by KMO(): a titled section with a verdict on the overall KMO value (and what it implies for the suitability of the data for factor analysis), the overall value, and the per-variable KMO values. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'KMO'
print(x, ...)

## S3 method for class 'KMO'
format(x, ...)

Arguments

x

An object of class KMO (output from KMO()).

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

Examples

KMO_base <- KMO(test_models$baseline$cormat)
KMO_base

# format() returns the same lines as plain text:
writeLines(format(KMO_base))


Print LOADINGS object

Description

Print LOADINGS object

Usage

## S3 method for class 'LOADINGS'
print(
  x,
  cutoff = 0.3,
  digits = 3,
  max_name_length = 10,
  h2 = NULL,
  color = TRUE,
  name_style = c("truncate", "abbreviate", "full"),
  max_factor_name_length = NULL,
  max_factors_per_block = NULL,
  sort_loadings = c("none", "primary", "clustered"),
  legend = FALSE,
  ...
)

## S3 method for class 'LOADINGS'
format(x, ...)

Arguments

x

class LOADINGS matrix.

cutoff

numeric. The number above which to print loadings in bold default is .3.

digits

numeric. Passed to round. Number of digits to round the loadings to (default is 3).

max_name_length

numeric. The maximum length of the variable names to display. Everything beyond this will be cut from the right unless name_style = "abbreviate" or name_style = "full" is used.

h2

numeric. Vector of communalities to print. If named and x has row names, names are used to align communalities to rows.

color

logical. Whether to apply console styling using cli. Default is TRUE.

name_style

character. How to shorten variable names longer than max_name_length. "truncate" cuts names from the right, "abbreviate" uses base::abbreviate(), and "full" prints full names.

max_factor_name_length

numeric or NULL. Optional maximum length of factor names. If NULL, factor names are not shortened.

max_factors_per_block

numeric or NULL. Maximum number of factor columns to print per block. If NULL, the number is chosen from the console width.

sort_loadings

character. Optional row sorting. "none" preserves the input order, "primary" groups rows by the factor with the largest absolute loading, and "clustered" additionally sorts within each factor by the size of the primary loading.

legend

logical. Whether to append a short explanation of the styling. Default is FALSE for standalone loading matrices.

...

additional arguments passed to print or format

Details

The method prints a loading matrix in a compact, console-oriented table. Loadings with absolute value greater than or equal to cutoff are emphasized, smaller loadings are de-emphasized, and Heywood-relevant communality/ uniqueness values are marked when h2 is supplied. Long variable names can be truncated, abbreviated, or printed in full. If the matrix has many factor columns, the table is split into column blocks so that the output remains readable in narrower consoles.

If h2 is named and x has row names, h2 is matched to the row names of x before any optional row sorting is applied. If x has no row names, a named h2 vector is used in the supplied order.

Examples

EFAtools_PAF <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500,
                    type = "EFAtools", method = "PAF", rotation = "promax")
EFAtools_PAF


Print method for N_FACTORS objects

Description

Print method for N_FACTORS objects

Usage

## S3 method for class 'N_FACTORS'
print(x, ...)

Arguments

x

an object of class N_FACTORS, returned by N_FACTORS().

...

not used.

Value

print() returns its argument x invisibly; it is cat(format(x), sep = "\n").

Examples


N_FACTORS(test_models$baseline$cormat, criteria = c("EKC", "SMT"), N = 500)


Print and format an OMEGA object

Description

print() shows the omega coefficients computed by OMEGA(): omega total (and, for multi-factor solutions, omega hierarchical, omega subscale, the H index, the explained common variance, and the percent of uncontaminated correlations) for the general factor and the group factors, for a single group or for each group. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'OMEGA'
print(x, digits = 3, ...)

## S3 method for class 'OMEGA'
format(x, digits = 3, ...)

Arguments

x

An object of class OMEGA (output from OMEGA()).

digits

Integer. The number of decimal places the coefficients are rounded to (passed to round()). Default is 3.

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

Examples

efa_mod <- EFA(test_models$baseline$cormat, N = 500, n_factors = 3,
               type = "EFAtools", method = "PAF", rotation = "promax")
sl_mod <- SL(efa_mod, type = "EFAtools", method = "PAF")

om <- OMEGA(sl_mod, type = "EFAtools",
            factor_corres = sl_mod$sl[, c("F1", "F2", "F3")] >= .2)
om

# format() returns the same lines as plain text:
writeLines(format(om))


Print and format an SL object

Description

print() shows a summarised output of the SL function: a model header (when the settings are available), the Schmid-Leiman loading matrix, and the variances accounted for. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'SL'
print(x, ...)

## S3 method for class 'SL'
format(x, ...)

Arguments

x

An object of class SL (output from SL()).

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

Examples

EFA_mod <- EFA(test_models$baseline$cormat, N = 500, n_factors = 3,
               type = "EFAtools", method = "PAF", rotation = "promax")
sl_mod <- SL(EFA_mod, type = "EFAtools", method = "PAF")
sl_mod

# format() returns the same lines as plain text:
writeLines(format(sl_mod))


Print SLLOADINGS object

Description

Print SLLOADINGS object

Usage

## S3 method for class 'SLLOADINGS'
print(x, cutoff = 0.2, digits = 3, color = TRUE, ...)

## S3 method for class 'SLLOADINGS'
format(x, ...)

Arguments

x

class SLLOADINGS matrix.

cutoff

numeric. The number above which to print loadings in bold (default is .2).

digits

numeric. Passed to round. Number of digits to round the loadings to (default is 3).

color

logical. Whether to apply console styling using cli. Default is TRUE.

...

additional arguments passed to print or format.

Details

Prints a Schmid-Leiman loading matrix (general factor, group factors, and the communality/uniqueness columns) as a styled, decimal-aligned table. Loadings with absolute value greater than or equal to cutoff are emphasised, smaller loadings are de-emphasised, and Heywood-relevant cells (a loading or communality above 1, or a negative uniqueness) are highlighted. If the matrix has many columns or the console is narrow, the table is split into stacked column blocks so the output stays readable.

Examples

EFA_mod <- EFA(test_models$baseline$cormat, N = 500, n_factors = 3,
               type = "EFAtools", method = "PAF", rotation = "promax")
SL(EFA_mod, type = "EFAtools", method = "PAF")


Print and format a multigroup factor analysis

Description

print() turns an efa_group() result into a sectioned report: a header recapping the groups, the common number of factors, the estimator, the rotation, and the alignment; a group-pair table of the matched Tucker congruences between the aligned loadings; a per-pair summary of the cross-group loading differences (with the salient and, when a bootstrap was run, the confidence-interval flags); and, when invariance = TRUE, a group-pair by factor grid of the approximate-invariance verdicts. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()). print() does not draw a plot; use plot.efa_group().

Usage

## S3 method for class 'efa_group'
print(x, digits = 3, ...)

## S3 method for class 'efa_group'
format(x, digits = 3, ...)

Arguments

x

An object of class efa_group (output from efa_group()).

digits

Integer. The number of decimal places the reported values are rounded to. Default is 3.

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

See Also

Other factor analysis: efa_group(), plot.efa_group()

Examples

g <- rep(c("g1", "g2"), length.out = nrow(GRiPS_raw))
mg <- efa_group(GRiPS_raw, groups = g, n_factors = 1)
mg

# format() returns the same lines as plain text:
writeLines(format(mg))


Print and format an efa_power object

Description

print() turns an efa_power() result into a short report. For an RMSEA-mode object this is a header naming the test, the null and alternative hypotheses with the significance level and degrees of freedom, the headline result (the power at the sample size, or the required sample size for the target power), and the critical value and noncentrality parameters. For a simulation-mode object it is instead the population and design, the retention hit-rate per criterion, the structure-recovery rate, and the convergence and Heywood-case rate. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'efa_power'
print(x, digits = 3, ...)

## S3 method for class 'efa_power'
format(x, digits = 3, ...)

Arguments

x

An object of class efa_power (output from efa_power()).

digits

Integer. The number of decimal places the reported values are rounded to. Default is 3.

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

See Also

Other power analysis: efa_power(), plot.efa_power()

Examples

pw <- efa_power(df = 100, N = 200)
pw

# format() returns the same lines as plain text:
writeLines(format(pw))


Print and format a reliability object

Description

print() shows the reliability coefficients for the general factor and the group factors, for a single group or for each group: the reliability coefficients (omega total, omega hierarchical, and omega subscale, standardized Cronbach's alpha, and the H index) and the common-variance indices (the explained common variance, ECV, and the percent of uncontaminated correlations, PUC). format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'efa_reliability'
print(x, digits = 3, ...)

## S3 method for class 'efa_reliability'
format(x, digits = 3, ...)

Arguments

x

An object of class efa_reliability.

digits

Integer. The number of decimal places the coefficients are rounded to. Default is 3.

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

See Also

Other reliability coefficients: efa_reliability()

Examples

efa_mod <- EFA(test_models$baseline$cormat, N = 500, n_factors = 3,
               type = "EFAtools", method = "PAF", rotation = "promax")
rel <- efa_reliability(efa_mod)
rel

# format() returns the same lines as plain text:
writeLines(format(rel))


Print method for efa_retention objects

Description

Print method for efa_retention objects

Usage

## S3 method for class 'efa_retention'
print(x, ...)

Arguments

x

an object of class efa_retention, returned by a factor-retention criterion (e.g. EKC() or HULL()).

...

not used.

Value

print() returns its argument x invisibly; it is cat(format(x), sep = "\n").

Examples

EKC(test_models$baseline$cormat, N = 500)

Print and format an efa_scores object

Description

print() shows a concise overview of an efa_scores() result: a header naming the method and whether factor scores were computed, and the per-factor determinacy table (determinacy, squared determinacy, and Guttman index). summary() returns a summary.efa_scores object whose print method adds the full factor-weight matrix, the score validity/univocality matrix, and the score intercorrelations. format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()).

Usage

## S3 method for class 'efa_scores'
print(x, digits = 3, ...)

## S3 method for class 'efa_scores'
format(x, digits = 3, ...)

## S3 method for class 'efa_scores'
summary(object, digits = 3, ...)

## S3 method for class 'summary.efa_scores'
print(x, ...)

## S3 method for class 'summary.efa_scores'
format(x, digits = x$opts$digits, ...)

Arguments

x, object

An object of class efa_scores; for the summary.efa_scores methods, the object returned by summary().

digits

numeric. Number of decimal places for the printed tables. Default is 3.

...

Not used; for consistency with the generics.

Value

print() and the print method for summary.efa_scores objects return their argument invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled). summary() returns an object of class summary.efa_scores.

See Also

Other factor scoring: FACTOR_SCORES(), efa_scores()

Examples

efa <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500,
           method = "PAF", rotation = "oblimin")
fs <- efa_scores(test_models$baseline$cormat, f = efa)
fs
summary(fs)

# format() returns the same lines as plain text:
writeLines(format(fs))


Print and format an efa_screen object

Description

print() turns the factor-analysis screening diagnostics computed by efa_screen() into a sectioned report with banded, colour-coded verdicts: sampling adequacy and sphericity (the Kaiser-Meyer-Olkin measure and Bartlett's test of sphericity), multicollinearity (the determinant and condition number of the correlation matrix), the per-variable diagnostics, and, when raw data were supplied, multivariate normality and multivariate outliers. It closes with a consolidated list of actionable recommendations (for example, which items to consider dropping, whether to prefer an ordinal or a robust estimator, and a caveat that keeps an over-powered Bartlett's test from being over-trusted). format() assembles the same report and returns it as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled (for example when captured into a file or stripped with cli::ansi_strip()). print() does not draw a plot.

Usage

## S3 method for class 'efa_screen'
print(x, digits = 3, ...)

## S3 method for class 'efa_screen'
format(x, digits = 3, ...)

Arguments

x

An object of class efa_screen (output from efa_screen()).

digits

Integer. The number of decimal places the reported values are rounded to. Default is 3.

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the report lines (styled to the active console theme; plain when colours are disabled).

See Also

Other factor analysis suitability: efa_screen()

Examples

# From raw data
efa_screen(iris[, 1:4])

# From a correlation matrix (supply N for Bartlett's test of sphericity)
efa_screen(test_models$baseline$cormat, N = 500)

# format() returns the same lines as plain text:
writeLines(format(efa_screen(test_models$baseline$cormat, N = 500)))


Print and format an efa_simulated object

Description

print() shows a compact summary of the data simulated by efa_simulate(): how many datasets were drawn and their dimensions, the marginal distribution, whether the data were discretized into ordered categories or given missing values, and – when model error was injected – the method with the target and achieved RMSEA and CFI. The simulated data themselves live in the data element and the population correlation matrix in population. format() returns the same summary as a character vector; print() is cat(format(x), sep = "\n"). The lines follow the active console theme, so they are plain when colours are disabled.

Usage

## S3 method for class 'efa_simulated'
print(x, digits = 3, ...)

## S3 method for class 'efa_simulated'
format(x, digits = 3, ...)

Arguments

x

An object of class efa_simulated (output from efa_simulate()).

digits

Integer. The number of decimal places the reported fit values are rounded to. Default is 3.

...

Not used; for consistency with the generic.

Value

print() returns its argument x invisibly. format() returns a character vector with the summary lines (styled to the active console theme; plain when colours are disabled).

See Also

Other data simulation: efa_simulate()

Examples

Lambda <- population_models$loadings$baseline
Phi <- population_models$phis_3$moderate
efa_simulate(N = 500, Lambda = Lambda, Phi = Phi, target_rmsea = 0.05, seed = 42)


Extract residuals from an EFA object

Description

Returns the residual correlation matrix of an EFA() or EFA_POOLED() solution. Residuals are a pure extractor here; their diagnostics and a formatted display are part of summary() of the EFA object.

Usage

## S3 method for class 'EFA'
residuals(object, type = c("raw", "standardized"), ...)

Arguments

object

a list of class EFA. Output from EFA() or EFA_POOLED().

type

character. Which residuals to return. "raw" (default) returns orig_R - model_implied_R; "standardized" returns the standardized residuals (residuals divided by their standard errors), available only when the object was fitted with bootstrap standard errors.

...

Further arguments (currently unused).

Value

A numeric matrix of residual correlations.

Examples

efa <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500)
residuals(efa)

Four test models used in Grieder and Steiner (2022)

Description

Correlation matrices created from simulated data from four of the population_models cases, each with strong factor intercorrelations. These are used in Grieder & Steiner (2022) to compare the psych and SPSS implementations in this package with the actual implementations of the programs. For details on the cases, see population_models.

Usage

test_models

Format

A list of 4 lists "baseline", "case_1a", "case_6b", and "case_11b", each with the following elements.

cormat

(matrix) - The correlation matrix of the simulated data.

n_factors

(numeric) - The true number of factors.

N

(numeric) - The sample size of the generated data.

Source

Grieder, S., & Steiner, M. D. (2022). Algorithmic jingle jungle: A comparison of implementations of principal axis factoring and promax rotation in R and SPSS. Behavior Research Methods, 54, 54–74. doi: 10.3758/s13428-021-01581-x