Statistics Toolbox | ![]() ![]() |
Principal Components Analysis (PCA)
Syntax
Description
takes a data matrix [PC,SCORE,latent,tsquare] = princomp(X)
X
and returns the principal components in PC
, the so-called Z-scores in SCORE
, the eigenvalues of the covariance matrix of X
in latent
, and Hotelling's T2 statistic for each data point in tsquare
.
The Z-scores are the data formed by transforming the original data into the space of the principal components. The values of the vector, latent
, are the variance of the columns of SCORE
. Hotelling's T2 is a measure of the multivariate distance of each observation from the center of the data set.
Example
Compute principal components for the ingredients
data in the Hald dataset, and the variance accounted for by each component.
load hald; [pc,score,latent,tsquare] = princomp(ingredients); pc,latent pc = 0.0678 -0.6460 0.5673 -0.5062 0.6785 -0.0200 -0.5440 -0.4933 -0.0290 0.7553 0.4036 -0.5156 -0.7309 -0.1085 -0.4684 -0.4844 latent = 517.7969 67.4964 12.4054 0.2372
Reference
[1] Jackson, J. E., A User's Guide to Principal Components, John Wiley and Sons, Inc. 1991. pp. 1-25.
See Also
barttest
, canoncorr
, factoran
, pcacov
, pcares
![]() | prctile | procrustes | ![]() |