Loadings.variation {HDMD}R Documentation

Proportional and Cumulative Variation of Loading Components

Description

Principal Component Analysis (PCA) methods prcomp and princomp do not accurately reflect the proportion of total variation of each principal component. Instead princomp calculates these values on the eigenvalue adjusted data, which misleadingly indicates that each component contributes equally to the variability in the loadings output. prcomp does not report the proportion of variablity. To rectify this, Loadings.variation displays the relative and cumulative contribution of variation for each component by accounting for all variability in data. Component variation is reported by the lambda value (which corresponds to the eigenvalue in princomp), while the proportion and cumulative variation relate these values to the total variability in data.

Usage

Loadings.variation(sdev, digits = 5)

Arguments

sdev vector of standard deviations for each component
digits number of decimal places to retain. Default is 5.

Details

For each component:

Lambda = sdev^2 Component Variance PTV = Lambda / sum(Lambda) Proportion of Total Variation CTV = cumsum(PTV) Cumulative Total Variation

All variability is accounted for in Principal Components, where each component is orthogonal and in decreasing order of variation explained. This allows PTV to be calculated as a proportion of the sum of individual variances and CTV=1 when accounting for all components.

Value

labeled matrix of variation for loading components. Lambda represents the variation for each component, PTV is the Proportion of Total Variation and CTV is the Cumulative Proportion of Total Variation. Values are rounded according to the number of digits specified.

Author(s)

Lisa McFerrin

See Also

prcomp, princomp

Examples


PCA_SVD = prcomp(USArrests, scale = TRUE)
PCA_SVD$rotation
Loadings.variation(PCA_SVD$sdev)

PCA_EIG = princomp(USArrests, cor = TRUE)
PCA_EIG$loadings
Loadings.variation(PCA_EIG$sdev)


[Package HDMD version 1.0 Index]