October 2017
Beginner to intermediate
572 pages
26h 1m
English
Another principal component analysis function is princomp. In this function, the calculation is performed by using eigen on a correlation or covariance matrix instead of a single value decomposition used in the prcomp function. In general practice, using prcomp is preferable; however, we cover how to use princomp here:
> swiss.princomp = princomp(swiss,
+ center = TRUE,
+ scale = TRUE)
>swiss.princomp
Output
Call:
princomp(x = swiss, center = TRUE, scale = TRUE)
Standard deviations:
Comp.1 Comp.2 Comp.3 Comp.4 Comp.5
42.896335 21.201887 7.587978 3.687888 2.721105
5 variables and 47 observations.
> summary(swiss.princomp) Output Importance ...
Read now
Unlock full access