anderwyang
anderwyang

Reputation: 2411

How to understand 'prcomp' result? '$ sdev'/'$ rotation'/'$ center'/'$ scale $ x'

How to understand 'prcomp' result? After running below code, we get prcomp result 'res.pca'. It include '$ sdev'/'$ rotation'/'$ center'/'$ scale $ x',how to understand all of them. Thanks.

library(factoextra)
data("decathlon2")
decathlon.active <- decathlon2[1:23, 1:10]
res.pca <- prcomp(decathlon.active,scales=TRUE)
str(res.pca)

Upvotes: 1

Views: 2232

Answers (1)

Kra.P
Kra.P

Reputation: 15123

sdev is the s.d of the principal components and also the squre roots of the eigenvalues of the covariance matrix.

rotation is a matrix whose columns contain the eigenvectors, the principal components in the original coordinate system.

In PCA, as you set option scales = TRUE, it scale data decathlon.active, and those center and scale are the centering and scaling used to scale the data.

Finally, x is the matrix of rotated data, also means the principal components of your data.

Upvotes: 2

Related Questions