Learn R Programming

robustfa (version 1.0-4)

factorScorePfa: Factor Analysis by Principal Factor Analysis (PFA)

Description

Perform principal factor factor analysis on a covariance matrix or data matrix.

Usage

factorScorePfa(x, factors = 2, covmat = NULL, cor = FALSE, 
rotation = c("varimax", "none"), 
scoresMethod = c("none", "regression", "Bartlett"))

Arguments

x
A numeric matrix or an object that can be coerced to a numeric matrix.
factors
The number of factors to be fitted.
covmat
A covariance matrix, or a covariance list as returned by cov.wt. Of course, correlation matrices are covariance matrices.
cor
A logical value indicating whether the calculation should use the covariance matrix (cor = FALSE) or the correlation matrix (cor = TRUE).
rotation
character. "none" or "varimax": it will be called with first argument the loadings matrix, and should return a list with component loadings giving the rotated loadings, or just the rotated loadings.
scoresMethod
Type of scores to produce, if any. The default is "none", "regression" gives Thompson's scores, "Bartlett" gives Bartlett's weighted least-squares scores.

Value

  • An object of class "factorScorePfa" with components:
  • callThe matched call.
  • loadingsA matrix of loadings, one column for each factor. This is of class "loadings" if rotation = "varimax": see loadings for its print method; It is a plain matrix if rotation = "none".
  • communalityThe common variance.
  • uniquenessesThe uniquenesses/specific variance computed.
  • covarianceThe last reduced correlation matrix S.
  • correlationThe correlation matrix of the last reduced correlation matrix S.
  • usedMatrixThe used matrix (running matrix).
  • factorsThe argument factors.
  • methodThe method: always "pfa".
  • scoresIf requested, a matrix of scores. NULL if x is missing.
  • scoringCoefThe scoring coefficients. NULL if x is missing.
  • meanFThe sample mean of the scores. NULL if x is missing.
  • corFThe sample correlation matrix of the scores. NULL if x is missing.
  • scoresMethodThe argument scoresMethod.
  • n.obsThe number of observations if available. NULL if x is missing.
  • centerThe center of the data.
  • eigenvaluesThe eigenvalues of the last reduced correlation matrix S.

Details

Other feasible usages are: factorScorePfa(factors, covmat) factorScorePfa(x, factors, rotation, scoresMethod) If x is missing, then the following components of the result will be NULL: scores, ScoringCoef, meanF, corF, and n.obs.

References

Zhang, Y. Y. (2013), An Object Oriented Solution for Robust Factor Analysis.

See Also

factorScorePca, factanal

Examples

Run this code
data(stock611)
R611 = cor(stock611[,3:12]); R611

## covmat is a matrix
fsPfa1 = factorScorePfa(factors = 3, covmat = R611); fsPfa1

## covmat is a list
covx = Cov(stock611[,3:12])
covmat = list(cov = getCov(covx), center = getCenter(covx), n.obs = covx@n.obs)
fsPfa2 = factorScorePfa(factors = 3, cor = TRUE, covmat = covmat); fsPfa2

## fsPfa3 contains scores etc.
fsPfa3 = factorScorePfa(x = stock611[,3:12], factors = 2, 
cor = TRUE, rotation = "varimax", scoresMethod = "regression"); fsPfa3

Run the code above in your browser using DataLab