efa | R Documentation |
Fit one or more Exploratory Factor Analysis (EFA) model(s).
efa(data = NULL, nfactors = 1L, sample.cov = NULL, sample.nobs = NULL,
rotation = "geomin", rotation.args = list(), ov.names = names(data),
bounds = "pos.var", ..., output = "efa")
data |
A data frame containing the observed variables we need for the
EFA. If only a subset of the observed variables is needed, use the
|
nfactors |
Integer or Integer vector. The desired number of factors
to extract. Can be a single number, or a vector of numbers
(e.g., |
sample.cov |
Numeric matrix. A sample variance-covariance matrix. The rownames and/or colnames must contain the observed variable names. Unlike sem and CFA, the matrix may be a correlation matrix. |
sample.nobs |
Number of observations if the full data frame is missing and only the sample variance-covariance matrix is given. |
rotation |
Character. The rotation method to be used. Possible options are varimax, quartimax, orthomax, oblimin, quartimin, geomin, promax, entropy, mccammon, infomax, tandem1, tandem2, oblimax, bentler, simplimax, target, pst (=partially specified target), cf, crawford-ferguson, cf-quartimax, cf-varimax, cf-equamax, cf-parsimax, cf-facparsim, biquartimin, bigeomin. The latter two are for bifactor rotation only. The rotation algorithms (except promax) are similar to those from the GPArotation package, but have been reimplemented for better control. The promax method is taken from the stats package. |
rotation.args |
List. Options related to the rotation algorithm. The
default options (and their alternatives) are |
ov.names |
Character vector. The variables names that are needed for the EFA. Should be a subset of the variables names in the data.frame. By default, all the variables in the data are used. |
bounds |
Per default, |
... |
Aditional options to be passed to lavaan, using 'name = value'.
See |
output |
Character. If |
The efa
function is essentially a wrapper around the
lavaan
function. It generates the model syntax (for a given number
of factors) and then calls lavaan()
treating the factors as
a single block that should be rotated. The function only supports
a single group. Categorical data is handled as usual by first computing
an appropriate (e.g., tetrachoric or polychoric) correlation matrix,
which is then used as input for the EFA.
There is also (limited) support for
twolevel data. The same number of factors is then extracted at the
within and the between level.
The promax rotation method (taken from the stats package) is only
provided for convenience. Because promax is a two-step algorithm (first
varimax, then oblique rotation to get simple structure), it does not
use the gpa or pairwise rotation algorithms, and as a result, no
standard errors are provided.
If output = "lavaan"
, an object of class
lavaan
. If output = "efa"
,
a list of class efaList
for which a print()
,
summary()
and fitMeasures()
method are available. Because
we added the (standardized) loadings as an extra element, the loadings
function (which is not a generic function) from the stats package will
also work on efaList
objects.
summary.efaList
for a summary method if the output is
of class efaList
.
## The famous Holzinger and Swineford (1939) example
fit <- efa(data = HolzingerSwineford1939,
ov.names = paste("x", 1:9, sep = ""),
nfactors = 1:3,
rotation = "geomin",
rotation.args = list(geomin.epsilon = 0.01, rstarts = 1))
summary(fit, nd = 3L, cutoff = 0.2, dot.cutoff = 0.05)
fitMeasures(fit, fit.measures = "all")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.