October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps to perform principal component analysis on the swiss dataset:
> data(swiss)
> swiss = swiss[,-1]
> swiss.pca = prcomp(swiss,
+ center = TRUE,
+ scale = TRUE)
>swiss.pca
Output
Standard deviations:
[1] 1.6228065 1.0354873 0.9033447 0.5592765 0.4067472
Rotation:
PC1 PC2 PC3 PC4 PC5
Agriculture 0.52396452 -0.25834215 0.003003672 -0.8090741 0.06411415
Examination -0.57185792 -0.01145981 -0.039840522 -0.4224580 -0.70198942
Education -0.49150243 0.19028476 0.539337412 -0.3321615 0.56656945
Catholic 0.38530580 0.36956307 0.725888143 0.1007965 -0.42176895 ...Read now
Unlock full access