Rotate PCA Loadings
rotate.pca.RdApply a specified rotation to the component loadings of a PCA model. This function leverages the GPArotation package to apply orthogonal or oblique rotations.
Arguments
- x
A PCA model object, typically created using the
pca()function.- ncomp
The number of components to rotate. Must be <= ncomp(x).
- type
The type of rotation to apply. Supported rotation types:
- "varimax"
Orthogonal Varimax rotation
- "quartimax"
Orthogonal Quartimax rotation
- "promax"
Oblique Promax rotation
- loadings_type
For oblique rotations, which loadings to use:
- "pattern"
Use pattern loadings as
v- "structure"
Use structure loadings (
pattern_loadings %*% Phi) asv
Ignored for orthogonal rotations.
- score_method
How to recompute scores after rotation:
- "auto"
For orthogonal rotations, use
scores_new = scores_original %*% t(R)
For oblique rotations, recompute from the pseudoinverse.
- "recompute"
Always recompute scores from
X_procand the pseudoinverse of rotated loadings.- "original"
For orth rotations, same as
auto, but may not work for oblique rotations.
- ...
Additional arguments passed to GPArotation functions.
Value
A modified PCA object with class rotated_pca and additional fields:
- v
Rotated loadings
- s
Rotated scores
- sdev
Updated standard deviations of rotated components
- explained_variance
Proportion of explained variance for each rotated component
- rotation
A list with rotation details:
type,R(orth) orPhi(oblique), andloadings_type