# NOT RUN {
# load whitening library
library("whitening")
# load pitprops14 data set
data(pitprops14)
colnames(pitprops14)
# correlation matrix for the first 13 variables
pitprops13 = pitprops14[1:13, 1:13]
# correlation loadings for PCA whitening
Psi = whiteningLoadings(pitprops13, "PCA")$Psi
# corresponding explained variation
Psi.explained = explainedVariation(Psi)
# the first six whitened variables account for 87% of the variation
cumsum(Psi.explained)/13*100
# }
Run the code above in your browser using DataLab