Practicing Statistics Interview Questions in R
Zuzanna Chmielewska
Actuary











prcomp()

pca <- prcomp(~ v1 + v2 + v3, data = df) predict(pca)

pca <- prcomp(~ v1 + v2 + v3, data = df)
predict(pca)
summary(pca)

pca <- prcomp(~ v1 + v2 + v3, data = df, rank = 2)
predict(pca)
summary(pca)

pca <- prcomp(~ v1 + v2 + v3, data = df, tol = 0.25)
predict(pca)
summary(pca)
Omitted if $ \sigma_{PCi} \leq tol \cdot \sigma_{PC1} $
prcomp()Practicing Statistics Interview Questions in R