Skip to contents

Given a (rank n) PCA fit, return a rank k < n varimax fit

Usage

fit_varimax(
  k,
  pca,
  feature_names,
  obs_names,
  varimax_fn = stats::varimax,
  varimax_opts = NULL,
  positive_skew = TRUE,
  x = NULL
)

Arguments

k

Desired rank of the fitted varimax model

pca

Fitted PCA model

feature_names

Names of the features (eg, data columns)

obs_names

Names of the observations (eg, data rows)

varimax_fn

Function to use for varimax rotation

varimax_opts

Options passed to varimax_fn

positive_skew

Should negative-skewed factors be flipped to have positive skew?

x

Original data matrix; passed here if not included in pca (eg, via retx = TRUE)

Value

List with components - loadings: Rotated feature loadings - rotmat: Rotation matrix - scores: Rotated observation scores

Details

After the initial rotation, factors with negative skew (left tails) are flipped