Skip to contents

Extract n principal components from the matrix mx using irlba, then rotate the solution using varimax

Usage

varimax_irlba(
  mx,
  n,
  prcomp_fn = irlba::prcomp_irlba,
  prcomp_opts = NULL,
  varimax_fn = stats::varimax,
  varimax_opts = NULL,
  retx = FALSE
)

Arguments

mx

Matrix of interest

n

Number of principal components / varimax factors to return; can take a vector of values

prcomp_fn

Function to use to extract principal components

prcomp_opts

List of options to pass to prcomp_fn

varimax_fn

Function to use for varimax rotation

varimax_opts

List of options to pass to varimax_fn

Value

A list of class varimaxes, with elements

  • totalvar: Total variance, from PCA

  • sdev: Standard deviations of the extracted principal components

  • rotation: Rotation matrix (variable loadings) from PCA

  • varimaxes: A list of class varimaxes, containing one fitted varimax model for each value of n, with further elements

    • loadings: Varimax-rotated standardized loadings

    • rotmat: Varimax rotation matrix

    • scores: Varimax-rotated observation scores