FAiR (version 0.4-15)

create_FAobject: Class "FA" and Its Constructors

Description

It is not necessary to understand this help page if one merely wants to estimate a factor analysis model. This help page is intended for those who want to modify or extend FAiR or otherwise want some idea of how FAiR works “behind the scenes”.

The classes that inherit from "FA" encapsulate estimates from factor analysis models. First, the constructor(s) will be discussed.

Usage

"create_FAobject"(restrictions, manifest, opt, call, scores, lower, analytic)

Arguments

restrictions
manifest
object of manifest-class
opt
The list produced by genoud
call
the call to Factanal
scores
A character string indicating what kind of factor scores to calculate; see the same argument to Factanal
lower
A small numeric scalar indicating the lower bound for positive definiteness or minimum uniqueness; see the corresponding argument to Factanal.
analytic
A logical indicating whether analytic gradients were used.

Value

The methods for create_FAobject produce an object of class "FA" or that inherits from class "FA" as appropriate.

Objects from the Class

Objects can be created by calls of the form new("FA", ...). However, this use of new("FA", ...) is not recommended because both Factanal and Rotate provide constructors for users with the help of the formal methods defined for create_FAobject.

Slots

The "FA" class is not virtual but does serve as the basis for some inherited classes. Its slots are:
loadings
A numeric array with as many rows as their are outcome variables, as many columns as there are (first-order) factors, and and five shelves. Each shelf is thus a matrix and contains the estimated primary pattern (PP), primary structure (PS), reference pattern (RP), reference structure (RS), and factor contribution (FC) matrices respectively with the dimname indicated in parentheses.
correlations
A numeric array with as many rows and columns as there are there are (first-order) factors and three shelves. Each shelf is a correlation matrix and contains the estimated correlations among the primary factors (PF), among reference factors (RF), and between each primary factor and its corresponding reference factor (PR) respectively with the dimname indicated in parentheses.
uniquenesses
A numeric vector with as many elements as there are outcome variables and contains the estimated unique variances from the factor analysis model.
scale
A numeric vector with as many elements as there are outcome variables and contains the estimated standard deviations of the outcome variables in the factor analysis model.
restrictions
Object that inherits from restrictions-class
Jacobian
A numeric matrix that contains the derivatives of the lower triangle of the reproduced covariance matrix with respect to each free parameter (by column) at their estimates.
vcov
A square, numeric matrix that is the estimated variance-covariance matrix among the estimated parameters
scores
A numeric matrix, possibly with zero rows. If, in the call to Factanal the user specifies that factor scores should be calculated, this matrix contains the factor scores and will have as many rows as there are observations and as many columns as there are (first-order) factors.
manifest
Object that inherits from manifest-class
optimization
A list that contains what is returned by the underlying optimization algorithm when called internally by Factanal and Rotate.
call
This slot contains the call to Factanal.
seeds
A numeric matrix with two columns and either one or two rows. The first row contains the unif.seed used by genoud and the int.seed in the call to Factanal. If Rotate is used to transform the factors after preliminary factors have been extracted as part of exploratory factor analysis, this matrix has a second row containing unif.seed and int.seed used in the call to Rotate.
An object of "FA.EFA" inherits from the "FA" class and has the following additional slots:
rotated
Logical indicating whether the loadings have been rotated
Lambda
A numeric matrix with the preliminary factor loadings
trans\_mats
A numeric array with as many rows and columns as there are factors and three shelves. Its first shelf is called "primary" and contains the transformation matrix that postmultiplies Lambda to yield the rotated primary pattern matrix. Its second shelf is called "reference" and contains the transformation matrix that postmultiplies Lambda to yield the rotated reference structure matrix. Its third shelf is called "T" and contains the matrix whose crossprod is the correlation matrix among primary factors. If rotated = FALSE, then all of these transformation matrices are identity matrices.
An object of "FA.general" inherits from the "FA" class and its restrictions slot has an object of restrictions.general-class It also has the following additional slots:
loadings\_2nd
A numeric array that has the same form as that in the loadings slot. However, since there is only one second-order factor, there is no distinction among the various pattern and structure matrices. The factor contribution matrix in the fifth shelf is simply the square of these loadings
uniqunesses\_2nd
A numeric vector giving the uniquenesses at level two
An object of "FA.2ndorder" inherits from the "FA.general" class and its restrictions slot has an object of restrictions.2ndorder-class. It also has an additional slot,
correlations_2nd:
a numeric array whose form is similar to that in the correlations slot but obviously pertains to the correlations among second-order factors rather than first-order factors.

Methods

The create_FAobject methods construct an object that inherits from class "FA" but their signatures hinge on restrictions-class and (in the future) manifest-class. The following methods are defined for the various classes that inherit from "FA":
BIC
signature(object = "FA")
coef
signature(object = "FA")
confint
signature(object = "FA")
logLik
signature(object = "FA")
plot
signature(x = "FA", y = "ANY")
profile
signature(fitted = "FA")
show
signature(object = "FA")
summary
signature(object = "FA")
vcov
signature(object = "FA")
In addition, the following methods are defined for classes that inherit from class "FA" that are documented in loadings or S3methodsFAiR but are also listed here:
loadings
extracts various “loadings” matrices, use insted of coef
cormat
extracts various correlation matrices
uniquenesses
extracts uniquenesses
pairs
Thurstone-style pairs plot among reference structure correlations taken two reference factors at a time
fitted
the covariance or correlation matrix as reproduced by the model
residuals
covariance or correlation residuals
rstandard
covariance residuals normalized by manifest standard deviations
weights
(approximate) weight matrices for each correlation
influence
a weighted residuals matrix
df.residual
extract the degrees of freedom
deviance
the value of the discrepancy function (scaled by one less the number of observations)
model.matrix
extract that sample covariance or correlation matrix
simulate
simulated draws from the sampling distribution of the covariance or correlation matrix as reproduced by the model
In addition, the following functions are not S4 generics but nevertheless expect an object that inherits from "FA" class and will throw an error otherwise:
model\_comparison
the model_comparison function produces test statistics and fit indices
paired\_comparison
the paired_comparison function tests one model against another model in which it is nested
FA2draws
the FA2draws function is essentially a wrapper around the restrictions2draws generic function but is more convenient
FA2RAM
the FA2RAM function is essentially a wrapper around the restrictions2RAM generic function but is more convenient
Rotate
the Rotate function finds an optimal transformation of preliminary factors in exploratory factor analysis
GPA2FA
the GPA2FA function requires an object of "FA.EFA" class

Details

The methods for create_FAobject are called internally right at the end of Factanal. They take the result of the optimization and produce an object that inherits from class "FA", which is conceptually simple, although the implementation is somewhat complicated and relies on a bunch of helper functions that are not exported.

See Also

Factanal

Examples

Run this code
showClass("FA")
showClass("FA.EFA")
showClass("FA.general")
showClass("FA.2ndorder")

Run the code above in your browser using DataLab