Escolar Documentos
Profissional Documentos
Cultura Documentos
Data
download.file("http://www.openintro.org/stat/data/mlb11.RData", destfile = "mlb11.RData")
load("mlb11.RData")
data<-mlb11
x<-as.data.frame(data[,-c(1,2)])
standardize<-function(x){ #standardize
for (i in 1:dim(x)[2]){x[,i] = (x[,i] - mean(x[,i]))/sd(x[,i])}
return(x)
}
X<-as.data.frame(standardize(x)) # x variables
7 Methods
#method 1: princomp
fit <- princomp(X)
#plot(fit,type="lines") # scree plot
PC1<-fit$scores # the principal components
#biplot(fit)
#method 2: by hand
Sx= var(X)
EP= eigen(Sx)
V= EP$vectors
PC2= as.matrix(X) %*% as.matrix(V)
#method 3: prcomp
pca <- prcomp(X,center = TRUE,scale. = TRUE)
PC3<-predict(pca)
#biplot(pca)
#method 4: preProcess
require(caret)
trans = preProcess(X, method=c("BoxCox", "center", "scale", "pca"))
PC4 = predict(trans,X)
#method 5: PCA
library(FactoMineR)
PC5 = PCA(X, graph = FALSE)
#method 6: dudi.pca
library(ade4)
PC6= dudi.pca(X,nf=5,scannf = FALSE)# nf = 5, choosing 5 axises
#method 7:
library(amap)
PC7 = acp(X)
Importance of components:
Comp.1
Comp.2
Comp.3
Comp.4
Standard deviation
2.4533123 1.1667611 0.98263663 0.83746021
Proportion of Variance 0.6226284 0.1408274 0.09988704 0.07255237
Cumulative Proportion 0.6226284 0.7634558 0.86334283 0.93589520
Comp.5
Comp.6
Comp.7
Comp.8
Standard deviation
0.57061512 0.44862616 0.280293676 0.117883321
Proportion of Variance 0.03368293 0.02082056 0.008127367 0.001437567
Cumulative Proportion 0.96957812 0.99039869 0.998526053 0.999963620
Comp.9
Comp.10
Standard deviation
1.632448e-02 9.229527e-03
Proportion of Variance 2.756778e-05 8.812155e-06
Cumulative Proportion 9.999912e-01 1.000000e+00
cumsum(EP$values)/sum(EP$values) #PC2
##
##
summary(pca) #PC3
##
##
##
##
##
##
##
##
##
Importance of components:
PC1
PC2
PC3
PC4
PC5
PC6
Standard deviation
2.4953 1.1867 0.99944 0.85178 0.58037 0.45630
Proportion of Variance 0.6226 0.1408 0.09989 0.07255 0.03368 0.02082
Cumulative Proportion 0.6226 0.7635 0.86334 0.93590 0.96958 0.99040
PC7
PC8
PC9
PC10
Standard deviation
0.28509 0.11990 0.01660 0.009387
Proportion of Variance 0.00813 0.00144 0.00003 0.000010
Cumulative Proportion 0.99853 0.99996 0.99999 1.000000
trans$thresh;trans$numComp #PC5
## [1] 0.95
## [1] 5
PC5$eig #PC5
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
comp
cumsum(PC6$eig)/sum(PC6$eig) #PC6
##
##
cumsum((PC7$sdev)^2)/sum((PC7$sdev)^2) #PC7
##
Comp 1
Comp 2
Comp 3
Comp 4
Comp 5
Comp 6
Comp 7
## 0.6226284 0.7634558 0.8633428 0.9358952 0.9695781 0.9903987 0.9985261
##
Comp 8
Comp 9
Comp 10
## 0.9999636 0.9999912 1.0000000
Loadings:
at_bats
hits
homeruns
bat_avg
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
strikeouts
stolen_bases
wins
new_onbase
new_slug
new_obs
0.236 -0.339
at_bats
hits
homeruns
bat_avg
-0.610 0.118
strikeouts
stolen_bases
wins
new_onbase
-0.253
new_slug
-0.118 -0.551
new_obs
0.137 0.774
V #PC2
##
[,1]
[,2]
[,3]
## [1,] -0.29499739 0.40205854 0.01037913
## [2,] -0.37149120 0.29060945 0.01958451
## [3,] -0.29406713 -0.46318186 -0.08100407
## [4,] -0.37311087 0.24360510 0.02256086
## [5,] 0.23608518 -0.33905212 0.01157092
## [6,] 0.04967206 -0.06417825 0.98765792
## [7,] -0.23029559 -0.55355308 -0.05513527
## [8,] -0.37274655 -0.03095347 0.10024947
## [9,] -0.38309949 -0.18247888 0.02922631
## [10,] -0.39030608 -0.14234234 0.05377717
##
[,6]
[,7]
[,8]
## [1,] -0.57671564 -0.22788291 -0.09375066
## [2,] -0.07673645 0.32068706 0.24561821
## [3,] 0.31599811 -0.08489788 0.51643165
## [4,] 0.07305511 0.43648966 0.35882832
## [5,] -0.26593904 0.13410065 0.06783546
## [6,] -0.02062634 0.05425371 0.05793649
## [7,] -0.64102649 0.14253901 0.02975243
## [8,] 0.04296281 -0.72927196 0.12082245
## [9,] 0.20864279 0.26830924 -0.59854731
## [10,] 0.16993274 -0.04926512 -0.39207482
[,4]
[,5]
-0.34703828 0.45400372
-0.07314901 -0.14343023
-0.22908257 0.51579804
0.01948053 -0.30003776
-0.76395677 -0.39009478
0.02854284 0.10199311
0.45033777 -0.05062566
0.01541813 -0.48593128
-0.15186608 0.06941918
-0.10394989 -0.10559536
[,9]
[,10]
-0.1735275891 0.0350747659
0.7508552672 -0.1356217682
0.0111105212 -0.0033827976
-0.6099044391 0.1180348869
-0.0073750529 0.0026613582
0.0015816794 -0.0005780246
0.0005908096 0.0042514217
-0.0357775051 -0.2532262039
-0.1181856049 -0.5508641929
0.1367207586 0.7738426571
pca$rotation #PC3
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
PC1
PC2
-0.29499739 0.40205854
-0.37149120 0.29060945
-0.29406713 -0.46318186
-0.37311087 0.24360510
0.23608518 -0.33905212
0.04967206 -0.06417825
-0.23029559 -0.55355308
-0.37274655 -0.03095347
-0.38309949 -0.18247888
-0.39030608 -0.14234234
PC6
PC7
at_bats
0.57671564 0.22788291
hits
0.07673645 -0.32068706
homeruns
-0.31599811 0.08489788
bat_avg
-0.07305511 -0.43648966
strikeouts
0.26593904 -0.13410065
stolen_bases 0.02062634 -0.05425371
wins
0.64102649 -0.14253901
new_onbase
-0.04296281 0.72927196
new_slug
-0.20864279 -0.26830924
new_obs
-0.16993274 0.04926512
PC10
at_bats
-0.0350747659
hits
0.1356217682
homeruns
0.0033827976
bat_avg
-0.1180348869
strikeouts
-0.0026613582
stolen_bases 0.0005780246
wins
-0.0042514217
new_onbase
0.2532262039
new_slug
0.5508641929
new_obs
-0.7738426571
at_bats
hits
homeruns
bat_avg
strikeouts
stolen_bases
wins
new_onbase
new_slug
new_obs
PC3
-0.01037913
-0.01958451
0.08100407
-0.02256086
-0.01157092
-0.98765792
0.05513527
-0.10024947
-0.02922631
-0.05377717
PC8
0.09375066
-0.24561821
-0.51643165
-0.35882832
-0.06783546
-0.05793649
-0.02975243
-0.12082245
0.59854731
0.39207482
PC4
PC5
-0.34703828 -0.45400372
-0.07314901 0.14343023
-0.22908257 -0.51579804
0.01948053 0.30003776
-0.76395677 0.39009478
0.02854284 -0.10199311
0.45033777 0.05062566
0.01541813 0.48593128
-0.15186608 -0.06941918
-0.10394989 0.10559536
PC9
-0.1735275891
0.7508552672
0.0111105212
-0.6099044391
-0.0073750529
0.0015816794
0.0005908096
-0.0357775051
-0.1181856049
0.1367207586
PC3
-0.01037913
-0.01958451
0.08100407
-0.02256086
-0.01157092
-0.98765792
0.05513527
-0.10024947
-0.02922631
-0.05377717
PC4
-0.34703828
-0.07314901
-0.22908257
0.01948053
-0.76395677
0.02854284
0.45033777
0.01541813
-0.15186608
-0.10394989
trans$rotation #PC4
##
##
##
##
##
##
##
##
##
##
##
at_bats
hits
homeruns
bat_avg
strikeouts
stolen_bases
wins
new_onbase
new_slug
new_obs
PC1
-0.29499739
-0.37149120
-0.29406713
-0.37311087
0.23608518
0.04967206
-0.23029559
-0.37274655
-0.38309949
-0.39030608
PC2
0.40205854
0.29060945
-0.46318186
0.24360510
-0.33905212
-0.06417825
-0.55355308
-0.03095347
-0.18247888
-0.14234234
PC5
-0.45400372
0.14343023
-0.51579804
0.30003776
0.39009478
-0.10199311
0.05062566
0.48593128
-0.06941918
0.10559536
sweep(PC5$var$coord,2,sqrt(PC5$eig[1:ncol(PC5$var$coord),1]),FUN="/") #PC5
##
##
##
##
##
##
##
##
##
##
##
Dim.1
Dim.2
Dim.3
Dim.4
Dim.5
at_bats
0.29499739 -0.40205854 0.01037913 0.34703828 -0.45400372
hits
0.37149120 -0.29060945 0.01958451 0.07314901 0.14343023
homeruns
0.29406713 0.46318186 -0.08100407 0.22908257 -0.51579804
bat_avg
0.37311087 -0.24360510 0.02256086 -0.01948053 0.30003776
strikeouts
-0.23608518 0.33905212 0.01157092 0.76395677 0.39009478
stolen_bases -0.04967206 0.06417825 0.98765792 -0.02854284 -0.10199311
wins
0.23029559 0.55355308 -0.05513527 -0.45033777 0.05062566
new_onbase
0.37274655 0.03095347 0.10024947 -0.01541813 0.48593128
new_slug
0.38309949 0.18247888 0.02922631 0.15186608 -0.06941918
new_obs
0.39030608 0.14234234 0.05377717 0.10394989 0.10559536
PC6$c1 #PC6
##
##
##
##
##
##
##
##
##
##
##
at_bats
hits
homeruns
bat_avg
strikeouts
stolen_bases
wins
new_onbase
new_slug
new_obs
CS1
-0.29499739
-0.37149120
-0.29406713
-0.37311087
0.23608518
0.04967206
-0.23029559
-0.37274655
-0.38309949
-0.39030608
CS2
CS3
CS4
CS5
0.40205854 0.01037913 0.34703828 0.45400372
0.29060945 0.01958451 0.07314901 -0.14343023
-0.46318186 -0.08100407 0.22908257 0.51579804
0.24360510 0.02256086 -0.01948053 -0.30003776
-0.33905212 0.01157092 0.76395677 -0.39009478
-0.06417825 0.98765792 -0.02854284 0.10199311
-0.55355308 -0.05513527 -0.45033777 -0.05062566
-0.03095347 0.10024947 -0.01541813 -0.48593128
-0.18247888 0.02922631 0.15186608 0.06941918
-0.14234234 0.05377717 0.10394989 -0.10559536
PC7$loadings #PC7
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
Comp 1
Comp 2
at_bats
0.29499739 -0.40205854
hits
0.37149120 -0.29060945
homeruns
0.29406713 0.46318186
bat_avg
0.37311087 -0.24360510
strikeouts
-0.23608518 0.33905212
stolen_bases -0.04967206 0.06417825
wins
0.23029559 0.55355308
new_onbase
0.37274655 0.03095347
new_slug
0.38309949 0.18247888
new_obs
0.39030608 0.14234234
Comp 6
Comp 7
at_bats
-0.57671564 0.22788291
hits
-0.07673645 -0.32068706
homeruns
0.31599811 0.08489788
bat_avg
0.07305511 -0.43648966
strikeouts
-0.26593904 -0.13410065
stolen_bases -0.02062634 -0.05425371
wins
-0.64102649 -0.14253901
new_onbase
0.04296281 0.72927196
new_slug
0.20864279 -0.26830924
new_obs
0.16993274 0.04926512
Comp 10
at_bats
0.0350747659
hits
-0.1356217682
Comp 3
-0.01037913
-0.01958451
0.08100407
-0.02256086
-0.01157092
-0.98765792
0.05513527
-0.10024947
-0.02922631
-0.05377717
Comp 8
0.09375066
-0.24561821
-0.51643165
-0.35882832
-0.06783546
-0.05793649
-0.02975243
-0.12082245
0.59854731
0.39207482
Comp 4
Comp 5
0.34703828 -0.45400372
0.07314901 0.14343023
0.22908257 -0.51579804
-0.01948053 0.30003776
0.76395677 0.39009478
-0.02854284 -0.10199311
-0.45033777 0.05062566
-0.01541813 0.48593128
0.15186608 -0.06941918
0.10394989 0.10559536
Comp 9
-0.1735275891
0.7508552672
0.0111105212
-0.6099044391
-0.0073750529
0.0015816794
0.0005908096
-0.0357775051
-0.1181856049
0.1367207586
##
##
##
##
##
##
##
##
homeruns
bat_avg
strikeouts
stolen_bases
wins
new_onbase
new_slug
new_obs
-0.0033827976
0.1180348869
0.0026613582
-0.0005780246
0.0042514217
-0.2532262039
-0.5508641929
0.7738426571
at_bats
hits
homeruns
bat_avg
strikeouts
stolen_bases
wins
new_onbase
new_slug
new_obs
Comp.1
-0.7360929
-0.9269643
-0.7337717
-0.9310057
0.5890921
0.1239443
-0.5746456
-0.9300967
-0.9559299
-0.9739121
Comp.2
0.47712574
0.34486831
-0.54966122
0.28908791
-0.40235558
-0.07616078
-0.65690540
-0.03673270
-0.21654899
-0.16891867
Comp.3
-0.01037326
-0.01957345
0.08095831
-0.02254811
-0.01156439
-0.98709994
0.05510413
-0.10019283
-0.02920979
-0.05374679
Comp.4
0.29559916
0.06230663
0.19512722
-0.01659306
0.65072066
-0.02431213
-0.38358727
-0.01313281
0.12935601
0.08854211
Comp.5
0.26349011
-0.08324259
0.29935368
-0.17413290
-0.22639928
0.05919374
-0.02938161
-0.28201991
0.04028881
-0.06128437
cor(X,PC2[,1:5]) #PC2
##
##
##
##
##
##
##
##
##
##
##
at_bats
hits
homeruns
bat_avg
strikeouts
stolen_bases
wins
new_onbase
new_slug
new_obs
[,1]
-0.7360929
-0.9269643
-0.7337717
-0.9310057
0.5890921
0.1239443
-0.5746456
-0.9300967
-0.9559299
-0.9739121
[,2]
[,3]
[,4]
[,5]
0.47712574 0.01037326 -0.29559916 0.26349011
0.34486831 0.01957345 -0.06230663 -0.08324259
-0.54966122 -0.08095831 -0.19512722 0.29935368
0.28908791 0.02254811 0.01659306 -0.17413290
-0.40235558 0.01156439 -0.65072066 -0.22639928
-0.07616078 0.98709994 0.02431213 0.05919374
-0.65690540 -0.05510413 0.38358727 -0.02938161
-0.03673270 0.10019283 0.01313281 -0.28201991
-0.21654899 0.02920979 -0.12935601 0.04028881
-0.16891867 0.05374679 -0.08854211 -0.06128437
cor(X,PC3[,1:5]) #PC3
##
##
##
##
##
##
##
##
at_bats
hits
homeruns
bat_avg
strikeouts
stolen_bases
wins
PC1
-0.7360929
-0.9269643
-0.7337717
-0.9310057
0.5890921
0.1239443
-0.5746456
PC2
0.47712574
0.34486831
-0.54966122
0.28908791
-0.40235558
-0.07616078
-0.65690540
PC3
-0.01037326
-0.01957345
0.08095831
-0.02254811
-0.01156439
-0.98709994
0.05510413
PC4
PC5
-0.29559916 -0.26349011
-0.06230663 0.08324259
-0.19512722 -0.29935368
0.01659306 0.17413290
-0.65072066 0.22639928
0.02431213 -0.05919374
0.38358727 0.02938161
## new_onbase
## new_slug
## new_obs
cor(X,PC4[,1:5]) #PC4
##
##
##
##
##
##
##
##
##
##
##
at_bats
hits
homeruns
bat_avg
strikeouts
stolen_bases
wins
new_onbase
new_slug
new_obs
PC1
-0.7360929
-0.9269643
-0.7337717
-0.9310057
0.5890921
0.1239443
-0.5746456
-0.9300967
-0.9559299
-0.9739121
PC2
0.47712574
0.34486831
-0.54966122
0.28908791
-0.40235558
-0.07616078
-0.65690540
-0.03673270
-0.21654899
-0.16891867
PC3
-0.01037326
-0.01957345
0.08095831
-0.02254811
-0.01156439
-0.98709994
0.05510413
-0.10019283
-0.02920979
-0.05374679
PC4
-0.29559916
-0.06230663
-0.19512722
0.01659306
-0.65072066
0.02431213
0.38358727
0.01313281
-0.12935601
-0.08854211
PC5
-0.26349011
0.08324259
-0.29935368
0.17413290
0.22639928
-0.05919374
0.02938161
0.28201991
-0.04028881
0.06128437
cor(X,PC5$ind$coord) #PC5
##
##
##
##
##
##
##
##
##
##
##
Dim.1
Dim.2
Dim.3
Dim.4
Dim.5
at_bats
0.7360929 -0.47712574 0.01037326 0.29559916 -0.26349011
hits
0.9269643 -0.34486831 0.01957345 0.06230663 0.08324259
homeruns
0.7337717 0.54966122 -0.08095831 0.19512722 -0.29935368
bat_avg
0.9310057 -0.28908791 0.02254811 -0.01659306 0.17413290
strikeouts
-0.5890921 0.40235558 0.01156439 0.65072066 0.22639928
stolen_bases -0.1239443 0.07616078 0.98709994 -0.02431213 -0.05919374
wins
0.5746456 0.65690540 -0.05510413 -0.38358727 0.02938161
new_onbase
0.9300967 0.03673270 0.10019283 -0.01313281 0.28201991
new_slug
0.9559299 0.21654899 0.02920979 0.12935601 -0.04028881
new_obs
0.9739121 0.16891867 0.05374679 0.08854211 0.06128437
PC6$co #PC6
##
##
##
##
##
##
##
##
##
##
##
at_bats
hits
homeruns
bat_avg
strikeouts
stolen_bases
wins
new_onbase
new_slug
new_obs
Comp1
-0.7360929
-0.9269643
-0.7337717
-0.9310057
0.5890921
0.1239443
-0.5746456
-0.9300967
-0.9559299
-0.9739121
Comp2
Comp3
Comp4
Comp5
0.47712574 0.01037326 0.29559916 0.26349011
0.34486831 0.01957345 0.06230663 -0.08324259
-0.54966122 -0.08095831 0.19512722 0.29935368
0.28908791 0.02254811 -0.01659306 -0.17413290
-0.40235558 0.01156439 0.65072066 -0.22639928
-0.07616078 0.98709994 -0.02431213 0.05919374
-0.65690540 -0.05510413 -0.38358727 -0.02938161
-0.03673270 0.10019283 -0.01313281 -0.28201991
-0.21654899 0.02920979 0.12935601 0.04028881
-0.16891867 0.05374679 0.08854211 -0.06128437
cor(X,PC7$scores[,1:5]) #PC7
##
## at_bats
## hits
Comp 1
Comp 2
Comp 3
0.7360929 -0.47712574 -0.01037326
0.9269643 -0.34486831 -0.01957345
8
Comp 4
Comp 5
0.29559916 -0.26349011
0.06230663 0.08324259
##
##
##
##
##
##
##
##
homeruns
0.7337717 0.54966122 0.08095831 0.19512722 -0.29935368
bat_avg
0.9310057 -0.28908791 -0.02254811 -0.01659306 0.17413290
strikeouts
-0.5890921 0.40235558 -0.01156439 0.65072066 0.22639928
stolen_bases -0.1239443 0.07616078 -0.98709994 -0.02431213 -0.05919374
wins
0.5746456 0.65690540 0.05510413 -0.38358727 0.02938161
new_onbase
0.9300967 0.03673270 -0.10019283 -0.01313281 0.28201991
new_slug
0.9559299 0.21654899 -0.02920979 0.12935601 -0.04028881
new_obs
0.9739121 0.16891867 -0.05374679 0.08854211 0.06128437
Principal Components
head(PC1[,1:5]) #PC1
##
##
##
##
##
##
##
[1,]
[2,]
[3,]
[4,]
[5,]
[6,]
Comp.1
Comp.2
Comp.3
Comp.4
Comp.5
-5.4476748 0.2770170 -1.30739222 -0.59849117 0.7160239
-5.4095075 0.3300863 -0.09825248 1.13778384 -0.1309888
-3.4021701 -0.1467298 1.77728943 0.11227186 -1.2643369
-2.3158625 2.5650104 -1.73040482 0.06803066 0.1718947
-3.0875053 0.4428484 1.51815690 -1.12663221 -0.7979689
-0.8592596 1.7008277 -0.94574015 -0.26857952 -0.7622205
head(PC2[,1:5]) #PC2
##
##
##
##
##
##
##
[1,]
[2,]
[3,]
[4,]
[5,]
[6,]
[,1]
[,2]
[,3]
[,4]
[,5]
-5.4476748 0.2770170 1.30739222 0.59849117 0.7160239
-5.4095075 0.3300863 0.09825248 -1.13778384 -0.1309888
-3.4021701 -0.1467298 -1.77728943 -0.11227186 -1.2643369
-2.3158625 2.5650104 1.73040482 -0.06803066 0.1718947
-3.0875053 0.4428484 -1.51815690 1.12663221 -0.7979689
-0.8592596 1.7008277 0.94574015 0.26857952 -0.7622205
head(PC3[,1:5]) #PC3
##
##
##
##
##
##
##
[1,]
[2,]
[3,]
[4,]
[5,]
[6,]
PC1
PC2
PC3
PC4
PC5
-5.4476748 0.2770170 -1.30739222 0.59849117 -0.7160239
-5.4095075 0.3300863 -0.09825248 -1.13778384 0.1309888
-3.4021701 -0.1467298 1.77728943 -0.11227186 1.2643369
-2.3158625 2.5650104 -1.73040482 -0.06803066 -0.1718947
-3.0875053 0.4428484 1.51815690 1.12663221 0.7979689
-0.8592596 1.7008277 -0.94574015 0.26857952 0.7622205
head(PC4) #PC4
##
##
##
##
##
##
##
1
2
3
4
5
6
PC1
PC2
PC3
PC4
PC5
-5.4476748 0.2770170 -1.30739222 0.59849117 -0.7160239
-5.4095075 0.3300863 -0.09825248 -1.13778384 0.1309888
-3.4021701 -0.1467298 1.77728943 -0.11227186 1.2643369
-2.3158625 2.5650104 -1.73040482 -0.06803066 -0.1718947
-3.0875053 0.4428484 1.51815690 1.12663221 0.7979689
-0.8592596 1.7008277 -0.94574015 0.26857952 0.7622205
9
head(PC5$ind$coord) #PC5
##
##
##
##
##
##
##
1
2
3
4
5
6
Dim.1
5.5408041
5.5019844
3.4603310
2.3554528
3.1402870
0.8739488
Dim.2
Dim.3
Dim.4
Dim.5
-0.2817527 1.32974242 -0.60872253 -0.7282645
-0.3357292 0.09993213 1.15723454 0.1332280
0.1492381 -1.80767265 0.11419118 1.2859510
-2.6088599 1.75998654 0.06919366 -0.1748333
-0.4504190 -1.54411018 -1.14589228 0.8116103
-1.7299037 0.96190782 -0.27317096 0.7752509
head(PC6$li) #PC6
##
##
##
##
##
##
##
1
2
3
4
5
6
Axis1
Axis2
Axis3
Axis4
-5.5408041 0.2817527 1.32974242 -0.60872253
-5.5019844 0.3357292 0.09993213 1.15723454
-3.4603310 -0.1492381 -1.80767265 0.11419118
-2.3554528 2.6088599 1.75998654 0.06919366
-3.1402870 0.4504190 -1.54411018 -1.14589228
-0.8739488 1.7299037 0.96190782 -0.27317096
Axis5
0.7282645
-0.1332280
-1.2859510
0.1748333
-0.8116103
-0.7752509
head(PC7$scores[,1:5]) #PC7
##
##
##
##
##
##
##
[1,]
[2,]
[3,]
[4,]
[5,]
[6,]
Comp 1
5.4476748
5.4095075
3.4021701
2.3158625
3.0875053
0.8592596
Comp 2
-0.2770170
-0.3300863
0.1467298
-2.5650104
-0.4428484
-1.7008277
Comp 3
Comp 4
Comp 5
-1.30739222 -0.59849117 -0.7160239
-0.09825248 1.13778384 0.1309888
1.77728943 0.11227186 1.2643369
-1.73040482 0.06803066 -0.1718947
1.51815690 -1.12663221 0.7979689
-0.94574015 -0.26857952 0.7622205
Conclusion
Since the correlation and loadings between principal components and original variables can be very different
by using above 7 methods, principal components and their movements should be carefully explained in terms
of original variables.
10