Statistics Toolbox | ![]() ![]() |
The Principal Components (First Output)
The first output of the princomp
function, pcs
, contains the nine principal components. These are the linear combinations of the original variables that generate the new variables.
Let's look at the first three principal component vectors.
p3 = pcs(:,1:3) p3 = 0.2064 0.2178 -0.6900 0.3565 0.2506 -0.2082 0.4602 -0.2995 -0.0073 0.2813 0.3553 0.1851 0.3512 -0.1796 0.1464 0.2753 -0.4834 0.2297 0.4631 -0.1948 -0.0265 0.3279 0.3845 -0.0509 0.1354 0.4713 0.6073
The largest weights in the first column (first principal component) are the third and seventh elements, corresponding to the variables health
and arts
. All the elements of the first principal component are the same sign, making it a weighted average of all the variables.
To show the orthogonality of the principal components, note that premultiplying them by their transpose yields the identity matrix.
![]() | Example: Principal Components Analysis | The Component Scores (Second Output) | ![]() |