mlFA: Maximum likelihood factor analysis

View source: R/FMradio.R

mlFAR Documentation

Maximum likelihood factor analysis

Description

mlFA is a function that performs a maximum likelihood factor analysis.

Usage

mlFA(R, m)

Arguments

R

(Regularized) correlation matrix.

m

A numeric integer or integer indicating the latent dimension of the factor solution (i.e., the number of factors).

Details

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.

Value

The function returns an object of class list:

$Loadings

A matrix of class loadings representing the loadings matrix in which in which each element \lambda_{jk} is the loading of the jth feature on the kth latent factor.

$Uniqueness

A matrix representing the diagonal matrix carrying the unique variances.

$rotmatrix

A matrix representing the Varimax rotation matrix.

The $rotmatrix slot is only present when m is larger than 1.

Note

  • 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.

Author(s)

Carel F.W. Peeters <carel.peeters@wur.nl>

References

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].

See Also

dimGB, facScore

Examples

## 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)

FMradio documentation built on Aug. 29, 2025, 5:34 p.m.