mlFA | R Documentation |
mlFA
is a function that performs a maximum likelihood factor analysis.
mlFA(R, m)
R |
(Regularized) correlation |
m |
A |
This function is basically a wrapper around the
factanal function from the stats package.
Its purpose is to produce a factor solution of the chosen dimension (argument m
) by a maximum likelihood estimation procedure (Joreskog, 1967).
The wrapper ensures that the model is fitted under the same circumstances under which latent dimensionality is assessed with functions such as dimLRT
and dimIC
.
The function produces a Varimax rotated (Kaiser, 1958) factor solution.
The output can be used to produce factor scores by the facScore
function.
The function returns an object of class list
:
$Loadings |
A matrix of class |
$Uniqueness |
A |
$rotmatrix |
A |
The $rotmatrix
slot is only present when m
is larger than 1.
Note that the order of the features in the $Loadings
and $Uniqueness
slots of the output is determined by the order of the features for the input argument R
. As the $Loadings
slot gives an object of class "loadings" it can be subjected to the print
function, which sorts the output to emphasize the loadings structure when calling sort = TRUE
.
Note that the maximum likelihood procedure is stable when a regularized correlation matrix is used as the input for argument R
.
In high-dimensional situations usage of dimGB
on the regularized correlation matrix is recommended to determine the value for argument m
.
Carel F.W. Peeters <carel.peeters@wur.nl>
Joreskog, K.G (1967). Some contributions to maximum likelihood factor analysis. Psychometrika, 32:443–482.
Kaiser, H.F. (1958). The varimax criterion for analytic rotation in factor analysis. Psychometrika, 23:187–200.
Peeters, C.F.W. et al. (2019). Stable prediction with radiomics data. arXiv:1903.11696 [stat.ML].
dimGB
, facScore
## Simulate some data according to a factor model with 5 latent factors
## Simulate high-dimensional situation in the sense that p > n
## $cormatrix gives the correlation matrix on the generated data
simDAT <- FAsim(p = 50, m = 5, n = 40, loadingvalue = .9)
simDAT$cormatrix
## Regularize the correlation matrix
RegR <- regcor(simDAT$data)
## Evaluate the Guttman bounds
## First Guttman bound indicates to retain 5 latent factors
GB <- dimGB(RegR$optCor)
print(GB)
## Produce ML factor solution under 5 factors
## Print loadings structure of this solution
fit <- mlFA(RegR$optCor, 5)
print(fit$Loadings, digits = 2, cutoff = .3, sort = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.