Learn R Programming

Rnest (version 1.2)

nest: Next Eigenvalue Sufficiency Test (NEST)

Description

nest is used to identify the number of factors to retain in exploratory factor analysis.

Usage

nest(
  .data,
  ...,
  n = NULL,
  nreps = 1000,
  alpha = 0.05,
  max.fact = NULL,
  method = "ml",
  missing = "fiml",
  cluster = NULL,
  ordered = NULL
)

Value

nest() returns an object of class nest. The functions summary and plot are used to obtain and show a summary of the results.

An object of class nest is a list containing the following components:

  • nfactors - The number of factors to retains (one by alpha).

  • cor - The supplied correlation matrix.

  • n - The number of cases (subjects, participants, or units).

  • values - The eigenvalues of the supplied correlation matrix.

  • alpha - The type I error rate.

  • method - The method used to compute loadings and uniquenesses.

  • nreps - The number of replications used.

  • prob - Probabilities of each factor.

  • Eig - A list of simulated eigenvalues.

Arguments

.data

a data frame, a numeric matrix, covariance matrix or correlation matrix from which to determine the number of factors.

...

arguments for method that can be supplied. See details.

n

the number of cases (subjects, participants, or units) if a covariance matrix is supplied in .data.

nreps

the number of replications to derive the empirical probability distribution of each eigenvalue. Default is 1000.

alpha

a vector of type I error rates or (1-alpha)*100% confidence intervals. Default is .05.

max.fact

an optional maximum number of factor to extract. Default is NULL, so the maximum number possible.

method

a method used to compute loadings and uniquenesses. Four methods are implemented in Rnest : maximum likelihood method = "ml" (default), regularized common factor analysis method = "rcfa", minimum rank factor analysis method = "mrfa", and principal axis factoring method = "paf". See details for custom methods.

missing

how should missing data be removed. "fiml" uses full information maximum likelihood to compute the correlation matrix. Other options are "ml", "pairwise", "listwise". Default is "fiml".

cluster

a (single) variable name in the data frame defining the clusters in a two-level dataset.

ordered

a character vector to treat the variables as ordered (ordinal) variables. If TRUE, all observed endogenous variables are treated as ordered (ordinal).

Generic function

plot.nest Scree plot of the eigenvalues and the simulated confidence intervals for alpha.

loadings Extract loadings. It does not overwrite stat::loadings.

summary.nest Summary statistics for the number of factors.

Author

P.-O. Caron

Details

The Next Eigenvalues Sufficiency Test (NEST) is an extension of parallel analysis by adding a sequential hypothesis testing procedure for every \(k = 0, ..., \code{max.fact}\) factor until the hypothesis is not rejected.

At \(k = 0\), NEST and parallel analysis are identical. Both use an identity matrix as the correlation matrix. Once the first hypothesis is rejected, NEST uses a correlation matrix based on the loadings and uniquenesses of the \(k^{th}\) factorial structure. NEST then resamples nreps times the \(k^{th}\) eigenvalue of this new correlation matrix. NEST stops when the \(k^{th}\) eigenvalues is below the \(1-\alpha\)*100

There is four method already implemented in nest to estimate loadings and uniquenesses: maximum likelihood ("ml"; default), principal axis factoring ("paf"), regularized common factor analysis method = "rcfa", and minimum rank factor analysis ("mrfa"). These functions use as arguments: covmat, n, factors, and ... (supplementary arguments passed by nest). They return loadings and uniquenesses. Any other user-defined functions can be used as long as it is programmed likewise.

The method = "paf" is the same as Achim's (2017) NESTip.

References

Achim, A. (2017). Testing the number of required dimensions in exploratory factor analysis. The Quantitative Methods for Psychology, 13(1), 64-74. tools:::Rd_expr_doi("10.20982/tqmp.13.1.p064")

Examples

Run this code
nest(ex_2factors, n = 100)
nest(mtcars)

Run the code above in your browser using DataLab