Factanal and assumes you have already called
make_manifest. However, it is not necessary to understand the function arguments in great detail because
most of the functionality is implemented via pop-up menus. The vignette provides the
vignette("FAiR") to view it. It is possible (though not recommended
in normal usage) to avoid the pop-up menus entirely, in which case it is necessary to
thoroughly understand the documentation here and in the vignette as well as the
restrictions-class definition.
In technical terms, this S4 generic function is a constructor for objects of
restrictions-class. The arguments in the signature of the S4 generic function are:
manifest, Omega, beta, Phi, Delta, and Xi
The first S4 method defined immediately below is the one indended for the vast majority
of usage. It requires manifest to be specified, forbids these Greek letters
from being specified, and has a few optional arguments that can be specified to modify the
default behavior.
## S3 method for class 'manifest.basic,missing,missing,missing,missing,missing':
make_restrictions(
manifest, factors = NULL, model = c("SEFA", "EFA", "CFA"),
discrepancy = "default", nl_1 = NULL, nl_2 = NULL)# USE THE ABOVE METHOD IN MOST CASES!!!
# USE ONE OF THE FOLLOWING METHODS IN SIMULATIONS, ETC.
## S3 method for class 'manifest.basic,parameter.scale,missing,missing,missing,missing':
make_restrictions(
manifest, Omega, discrepancy = "default")
# Above method implies zero common factors
## S3 method for class 'manifest.basic,missing,parameter.coef,missing,missing,missing':
make_restrictions(
manifest, beta, discrepancy = "default")
# Above method implies EFA with orthogonal factors
## S3 method for class 'manifest.basic,missing,parameter.coef,parameter.cormat,missing,missing':
make_restrictions(
manifest, beta, Phi, discrepancy = "default",
criteria = list(), methodArgs = list())
# Adjacent methods imply correlated factors
## S3 method for class 'manifest.basic,parameter.scale,parameter.coef,parameter.cormat,missing,missing':
make_restrictions(
manifest, Omega, beta, Phi, discrepancy = "default",
criteria = list(), methodArgs = list())
## S3 method for class 'manifest.basic,missing,parameter.coef,missing,parameter.coef,missing':
make_restrictions(
manifest, beta, Delta, discrepancy = "default",
criteria = list(), methodArgs = list())
# Adjacent methods imply one second-order factor
## S3 method for class 'manifest.basic,parameter.scale,parameter.coef,missing,parameter.coef,missing':
make_restrictions(
manifest, Omega, beta, Delta, discrepancy = "default",
criteria = list(), methodArgs = list())
## S3 method for class 'manifest.basic,missing,parameter.coef,missing,parameter.coef,parameter.cormat':
make_restrictions(
manifest, beta, Delta, Xi, discrepancy = "default",
criteria = list(), methodArgs = list())
# Adjacent methods imply multiple second-order factors
## S3 method for class 'manifest.basic,parameter.scale,parameter.coef,missing,parameter.coef,parameter.cormat':
make_restrictions(
manifest, Omega, beta, Delta, Xi, discrepancy = "default",
criteria = list(), methodArgs = list())
manifest.basic-classparameter.scale-classparameter.coef-classparameter.cormat-classparameter.coef-classparameter.cormat-classNULL or a vector of length one or two indicating the number of
factors at level one and level two"SEFA" (default), "CFA", and "EFA"
indicating whether to estimate a semi-exploratory, confirmatory, or exploratory model"default", "MLE", "ADF",
"ELLIPTICAL", "HK", "SHK", and "YWLS" indicating which
discrepancy function to use. The default behNULL or a function with an argument called x that imposes
nonlinear exact restrictions on some cells of the primary pattern matrix at level one. See the
Details section.NULL or a function with an argument called x that imposes
nonlinear exact restrictions on some cells of the primary pattern matrix at level two. See the
Details section.NULL or a list (possibly of length zero) of functions or
character strings naming functions to be used as criteria in the lexical optimization process.
See the Note section.criteria argument. See the Note section.restrictions-class. This object would
then be passed to the restrictions argument of Factanal.The make_restrictions methods set up the right-hand side of the factor analysis model,
including the restrictions that are placed on the parameters. restrictions-class typically have slots that are Greek letters, which are
objects that inherit from parameter-class. But the restrictions-class
has additional slots that contain other information about the model.
Exploratory factor analysis (EFA) requires a minimal set of restrictions and permits no additional
restrictions in the factor extraction stage. EFA preliminarily assumes the factors are orthogonal,
i.e. $\Phi = I$, and either assumes that
$\beta^\prime\Theta^{-1}\beta$ is diagonal or that $\beta$
has all zeros in its upper triangle. However, after a transformation of the factors has been
chosen (see Rotate), EFA takes no strong position on how many or which cells of
$\beta$ are (near) zero, unless target rotation or the simplimax criterion is used.
Confirmatory factor analysis (CFA) allows the user to choose which cells of $\beta$ are exactly zero according to substantive theory and also permits other kinds of restrictions. Semi-exploratory factor analysis (SEFA) allows the user to choose how many cells in each column of $\beta$ are zero but does not require the user to specify which cells are zero. SEFA also permits other kinds of restrictions, including constraining specific cells in $\beta$ to be zero, as in a CFA.
For CFA and SEFA, it is optionally possible to estimate a
If you are at all unsure about what to do, use the first method listed in the Usage section, where
"manifest" is the only required argument. This method covers all the functionality of the other
methods and will walk you through all the necessary steps using pop-up menus. However, if you would like to
impose any nonlinear exact restrictions on the cells of $\beta$ or $\Delta$, then you
need to define such functions (whose first argument should be called "x") in the global environment
and specify them as the nl_1 and / or nl_2. See also parameter.coef.nl-class for
details.
The other methods will ask fewer questions via pop-up menus, and perhaps none at all (see the Note section below). Hence, they place more faith in the user to specify the additional arguments correctly. See the files in the FAiR/tests directory for many examples of setting up models the hard way without resorting to the pop-up menu system. You can stop reading this help page now if you are content with the pop-up menus.
If only "Omega" is specified, an object of restrictions.independent-class will emerge and
has no common factors. $\Omega$ is the only free parameter to estimate, which is only useful in
constructing a null model to calculate some fit indices for another model (and all of this would normally
be handled automatically by model_comparison anyway). If "Omega" is specified along with
other arguments, then this object of parameter.scale-class is merely passed along and
will become a slot of the resulting object that inherits from restrictions-class.
If "beta" is specified, but not "Phi" or "Delta", an object of
restrictions.orthonormal-class will emerge, which is appropriate for EFA where the upper
triangle of $\beta$ contains all zeros. If one prefers the maximum-likelihood discrepancy
function, there is a faster EFA algorithm that makes the assumption that
$\beta^\prime\Theta^{-1}\beta$ is diagonal, which can be brought about by
specifying model = "EFA" and discrepancy = "MLE" in the call to make_restrictions
using the first method in the Usage section above. Doing so will produce an object of
restrictions.factanal-class, whose other methods will reproduce the behavior of
factanal.
If both "beta" and "Phi" are specified, but not "Delta", an object of
restrictions.1storder-class will emerge, which is appropriate for CFA or SEFA
when there are no second-order factors, implying that $\Phi$ has no structure, other than
that required of a correlation matrix. Whether the model is a SEFA depends on whether
"beta" inherits from parameter.coef.SEFA-class.
If both "beta" and "Delta" are specified, but not "Xi", an object of
restrictions.general-class will emerge, which is appropriate for CFA or SEFA
with exactly one second-order factor. The off-diagonals of $\Phi$ are
$\Delta\Delta^\prime$. Whether the model is SEFA
(at level one) depends on whether "beta" inherits from
parameter.coef.SEFA-class and "Delta" cannot inherit from
parameter.coef.SEFA-class.
If "beta", "Delta", and "Xi" are specified, an object of
restrictions.2ndorder-class will emerge, which is appropriate for CFA or SEFA
with multiple second-order factors. Whether this two-level model is SEFA depends on whether "beta"
and / or "Delta" inherit from parameter.coef.SEFA-class.
Cudeck, R. (1989), Analysis of correlation matrices using covariance structure models, Psychological Bulletin, 105 317--327.
Krane, W. R., and McDonald, R. P. (1978). Scale invariance and the factor analysis of covariance matrices. British Journal of Mathematical and Statistical Psychology, 31, 218–-228.
Yates, A. (1987) Multivariate Exploratory Data Analysis: A Perspective on Exploratory Factor Analysis. State University of New York Press.
Factanal and restrictions-classman <- make_manifest(covmat = Harman74.cor)
## Here is the easy way to set up a two-level SEFA model using pop-up menus
res <- make_restrictions(manifest = man, factors = c(5,2), model = "SEFA")
## Here is the hard way to set up a two-level SEFA model,
## which eschews the pop-up menus; do NOT do this without good reason.
## There is an EFA example in ?Rotate
## There is a CFA example in ?restrictions2RAM
## There is an example with equality restrictions in ?equality_restriction-class
factors <- c(5,2)
beta <- matrix(NA_real_, nrow = nrow(cormat(man)), ncol = factors[1])
rownames(beta) <- rownames(cormat(man))
free <- is.na(beta)
beta <- new("parameter.coef.SEFA", x = beta, free = free, num_free = sum(free))
Delta <- matrix(NA_real_, nrow = factors[1], ncol = factors[2])
rownames(Delta) <- paste("F", 1:factors[1], sep = "")
free <- is.na(Delta)
Delta <- new("parameter.coef.SEFA", x = Delta, free = free, num_free = sum(free))
Xi <- diag(2)
free <- lower.tri(Xi)
## For fun, require the second-order factors to be positively correlated
uppers <- lowers <- Xi
lowers[2,1] <- 0
uppers[2,1] <- 1
Domains <- array(cbind(lowers, uppers), c(dim(Xi), 2))
Xi <- new("parameter.cormat", x = Xi, free = free, num_free = sum(free),
Domains = Domains)
res <- make_restrictions(manifest = man, beta = beta, Delta = Delta, Xi = Xi)
show(res)Run the code above in your browser using DataLab