factor_analysis: Factor Analysis with Varimax Rotation

Description Usage Arguments Value References See Also Examples

View source: R/factor_analysis.R

Description

factor_analysis reduces the structure of the data by relating the correlation between variables to a set of factors, using the eigen-decomposition of the correlation matrix.

Usage

1
factor_analysis(data, hc_points)

Arguments

data

numeric data

hc_points

vector of eigenvalues [designed to use output from horns_curve]

Value

A list containing:

  1. fa_loadings: numerical matrix with the original factor loadings

  2. fa_scores: numerical matrix with the row scores for each factor

  3. fa_loadings_rotated: numerical matrix with the varimax rotated factor loadings

  4. fa_scores_rotated: numerical matrix with the row scores for each varimax rotated factor

  5. num_factors: numeric vector identifying the number of factors

References

H. F. Kaiser, "The Application of Electronic Computers to Factor Analysis," Educational and Psychological Measurement, 1960.

See Also

horns_curve for computing the average eigenvalues used for hc_points argument

Examples

1
2
3
4
5
6
# Perform Factor Analysis with matrix \code{x}
x <- matrix(rnorm(200*3), ncol = 10)

x %>%
  horns_curve() %>%
  factor_analysis(x, hc_points = .)

anomalyDetection documentation built on March 18, 2018, 1:21 p.m.