Library: | stats |
See also: | draftman factor |
Quantlet: | pca | |
Description: | PCA performs a Principal Component Analysis for x. It is possible to choose interactively between different criteria for the PCA's and confidence intervals. |
Usage: | pc = pca (x) | |
Input: | ||
x | n x p matrix | |
Output: | ||
pc.y | n x p matrix principal components | |
pc.gamma | p x p matrix of eigenvectors | |
pc.lambda | p x 1 matrix of eigenvalues |
; loads the library stats library("stats") ; loads the library graphic library("graphic") ; reads the swiss banknote data x = read("bank2") ; shows the principal components of x pc = pca(x)
The graphic is divided into two displays. One shows a a scatterplot matrix of X. The second shows at the top a parallel coordinate plot of gamma (matrix of the eigenvectors) and at the bottom the scree plot. Interactively you can choose between different criteria for the number important principal components and confidence intervals for the eigenvalues (assumed that they are really all different).