| efa_retain | R Documentation |
Choosing the number of factors to retain is one of the most important decisions in an exploratory factor analysis (EFA). Many criteria exist to help with this choice. This function runs several of them together, and can also check whether the data are suitable for factor analysis.
efa_retain(
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,
estimator = 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 = lifecycle::deprecated(),
n_datasets_nest = 1000,
alpha_nest = 0.05,
show_progress = FALSE,
estimate_control = NULL
)
By default, the entered data are checked for suitability for factor analysis using the following methods (see the respective documentation for details):
Bartlett's test of sphericity (see efa_bartlett())
Kaiser-Meyer-Olkin criterion (see efa_kmo())
The available factor retention criteria are the following (see the respective documentation for details):
Comparison data (see efa_cd())
Empirical Kaiser criterion (see efa_ekc())
Hull method (see efa_hull())
Kaiser-Guttman criterion (see efa_kgc())
Velicer's minimum average partial, MAP (see efa_map())
Next Eigenvalue Sufficiency Test, NEST (see efa_nest())
Parallel analysis (see efa_parallel())
Scree plot (see efa_scree())
Sequential chi-square model tests, RMSEA lower bound, and AIC
(see efa_smt())
The default criteria are comparison data, the empirical Kaiser criterion, the
Hull method, MAP, NEST, and parallel analysis. No single criterion is the most
accurate in all conditions. efa_retain() therefore runs several criteria
together, and the printed summary gives the range of their suggestions and the
most common one. Auerswald and Moshagen (2019) compare the criteria and give
guidance on the selection.
The comparison data, parallel analysis, and NEST criteria compare the data
against simulated reference data, so their suggested numbers of factors vary
slightly from run to run. The Hull method also varies, because it calls
efa_parallel() to set its upper bound. Call base::set.seed() before
efa_retain() to make the results reproducible.
A list of class c("efa_retain", "N_FACTORS"), the trailing class
keeping inherits(x, "N_FACTORS") working for code written against the
superseded name. It contains
suitability |
A list with the results from |
outputs |
A named list with one |
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. |
not_run |
A named character vector with the criteria that were skipped
or failed and the reason, or |
settings |
A list of the settings used. Its |
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
efa_screen() for data screening before retention, and efa_fit() to extract
the chosen number of factors.
Other factor retention criteria:
efa_cd(),
efa_ekc(),
efa_hull(),
efa_kgc(),
efa_map(),
efa_nest(),
efa_parallel(),
efa_scree(),
efa_smt()
# Default criteria, with correlation matrix and estimator "ML" (where needed)
# This will throw a warning for CD, as no raw data were specified
# The simulation-based criteria are seeded to make the run reproducible
set.seed(42)
nfac_all <- efa_retain(test_models$baseline$cormat, N = 500, estimator = "ML",
n_datasets = 100, n_datasets_nest = 100)
# The same as above, but without "CD"
nfac_wo_CD <- efa_retain(test_models$baseline$cormat, criteria = c("EKC",
"HULL", "PARALLEL", "NEST"), N = 500,
estimator = "ML", n_datasets = 100,
n_datasets_nest = 100)
# Use PAF instead of ML (this will take longer). PAF only supports "CAF" as
# gof for the Hull method, so set it explicitly to avoid the automatic message.
nfac_PAF <- efa_retain(test_models$baseline$cormat, criteria = c("EKC",
"HULL", "PARALLEL", "NEST"), N = 500,
estimator = "PAF", gof = "CAF", n_datasets = 100,
n_datasets_nest = 100)
# Back to the default ML estimator (unlike above), with only "PCA" type eigenvalues
nfac_PCA <- efa_retain(test_models$baseline$cormat, criteria = c("EKC",
"HULL", "PARALLEL", "NEST"), N = 500,
estimator = "ML", eigen_type_other = "PCA",
n_datasets = 100, n_datasets_nest = 100)
# Use raw data, such that CD can also be performed
nfac_raw <- efa_retain(GRiPS_raw, estimator = "ML", N_pop = 500,
N_samples = 20, n_datasets = 100,
n_datasets_nest = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.