This package estimates exploratory, confirmatory, and semi-exploratory factor
analysis models via a genetic algorithm, namely
This use of a genetic algorithm is tantamount to restricted optimization with
virtually unlimited possibilities for restrictions. In particular, semi-exploratory
factor analysis, which is new to the literature, minimizes a discrepancy function
subject to a restriction on the number of exact zeros in each column of the
primary pattern matrix but does not require that the locations of the zeros
be specified in advance (as in confirmatory factor analysis). FAiR encourages
the use of inequality restrictions on functions of multiple parameters to
characterize testable hypotheses.
|License:||AGPL (>= 3.0) but see the LICENSE file for details|
Let the factor analysis model in the population be
Sigma = Omega(beta Phi beta' + Theta)Omega
where Sigma is the covariance matrix among outcome variables, Omega is a diagonal matrix of standard deviations of the manifest variables, beta is the primary pattern matrix (calibrated to standardized variables) with one column per factor, Phi is the correlation matrix among the primary factors, and Theta is the diagonal matrix of uniquenesses, which is fully determined by beta, Phi, and the requirement that the matrix within parentheses has ones down its diagonal. Hence, beta Phi beta' + Theta is the model's purported correlation matrix among outcome variables as a function of the factors.
Each of the matrices on the right-hand side is a parameter to be estimated, and unlike many structural
equation modeling programs, there is no mechanism for “translating” the model from a path
diagram or otherwise avoiding the matrix algebra representation of the model. On a technical
programming note, each of these matrices is represented by a
parameter-class in FAiR,
which includes a slot for the (proposed) estimate but also includes slots for ancillary information.
The usual steps to estimate and interpret a factor analysis model are as follows:
0. Get your data into R somehow. It is best to load the raw data in one of the usual
read.spss, etc.) and the
read.cefa function can also be used if your data are saved in the format
used by CEFA 2.0. If you only have a covariance matrix, then
can be used to load it into R.
make_manifest to construct the left-hand side of
the factor analysis model, namely an S4 object to house the sample estimate of Sigma
and some other information (e.g. number of observations).
make_restrictions to establish the additional restrictions to
be imposed on the right-hand side of factor analysis model, inclusive of whether the model
is exploratory, semi-exploratory, or confirmatory and what discrepancy function
to use. There is an extensive GUI that pops up when
called to guide you through this step. FAiR differs fundamentally from other factor
analysis software in that it permits you to impose inequality restrictions on functions of
beta and Phi. Hence, the
restrictions-class is critical
to the way FAiR is programmed internally and houses S4 objects representing each of the
matrices to be estimated.
Factanal to estimate the model and thereby produce estimates of
Omega, beta, Phi, and Theta.
4. (exploratory factor analysis only) Call
Rotate to choose
a transformation matrix (T) for the factors. There is an extensive GUI that pops up when
Rotate is called to guide you through this step. Again,
differs fundamentally from other approaches to factor rotation in that it permits you to
impose inequality restrictions on functions of parameters when searching for T.
5. Call the usual post-estimation methods to interpret the estimates, like
pairs,FA-method, etc., and call
model_comparison to see the test statistics and fit indices.
The vignette has additional information regarding the pop-up menus produced in step 2 by
make_restrictions and in step 4 by
vignette("FAiR") to read it. The primary examples are in
## See the examples for Factanal() and Rotate()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.