N_FACTORS {EFAtools} | R Documentation |
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", "KGC", "PARALLEL", "SCREE", "SMT"),
suitability = TRUE,
N = NA,
use = c("pairwise.complete.obs", "all.obs", "complete.obs", "everything",
"na.or.complete"),
cor_method = c("pearson", "spearman", "kendall"),
n_factors_max = NA,
N_pop = 10000,
N_samples = 500,
alpha = 0.3,
max_iter_CD = 50,
n_fac_theor = NA,
method = c("PAF", "ULS", "ML"),
gof = c("CAF", "CFI", "RMSEA"),
eigen_type_HULL = c("SMC", "PCA", "EFA"),
eigen_type_other = c("PCA", "SMC", "EFA"),
n_factors = 1,
n_datasets = 1000,
percent = 95,
decision_rule = c("means", "percentile", "crawford"),
show_progress = TRUE,
...
)
Arguments
x |
data.frame or matrix. Dataframe or matrix of raw data or matrix with
correlations. If |
criteria |
character. A vector with the factor retention methods to
perform. Possible inputs are: |
suitability |
logical. Whether the data should be checked for suitability
for factor analysis using the Bartlett's test of sphericity and the
Kaiser-Guttmann criterion (see details). Default is |
N |
numeric. The number of observations. Only needed if x is a correlation matrix. |
use |
character. Passed to |
cor_method |
character. Passed to |
n_factors_max |
numeric. Passed to |
N_pop |
numeric. Passed to |
N_samples |
numeric. Passed to |
alpha |
numeric. Passed to |
max_iter_CD |
numeric. Passed to |
n_fac_theor |
numeric. Passed to |
method |
character. Passed to |
gof |
character. Passed to |
eigen_type_HULL |
character. Passed to |
eigen_type_other |
character. Passed to |
n_factors |
numeric. Passed to |
n_datasets |
numeric. Passed to |
percent |
numeric. Passed to |
decision_rule |
character. Passed to |
show_progress |
logical. Whether a progress bar should be shown in the console. Default is TRUE. |
... |
Further arguments passed to |
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):
Comparison data (see
CD
)Empirical Kaiser criterion (see
EKC
)Hull method (see
HULL
)Kaiser-Guttman criterion (see
KGC
)Parallel analysis (see
PARALLEL
)Scree plot (see
SCREE
)Sequential chi-square model tests, RMSEA lower bound, and AIC (see
SMT
)
Value
A list of class N_FACTORS containing
outputs |
A list with the outputs from |
n_factors |
A named vector containing the suggested number of factors from each factor retention criterion. |
settings |
A list of the settings used. |
Examples
# All 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", "KGC", "PARALLEL", "SCREE", "SMT"), N = 500,
method = "ML")
# Use PAF instead of ML (this will take a lot 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", "KGC", "PARALLEL", "SCREE", "SMT"), N = 500,
gof = "CAF")
# Do KGC and PARALLEL with only "PCA" type of eigenvalues
nfac_PCA <- N_FACTORS(test_models$baseline$cormat, criteria = c("EKC",
"HULL", "KGC", "PARALLEL", "SCREE", "SMT"), 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")