Determining the number of principal components using the Kaiser method
In addition to the scree test, you can use the Kaiser method to determine the number of principal components. In this method, the selection criteria retains eigenvalues greater than 1
. In this recipe, we will demonstrate how to determine the number of principal components using the Kaiser method.
Getting ready
Ensure that you have completed the previous recipe by generating a principal component object and save it in the variable, swiss.pca
.
How to do it...
Perform the following steps to determine the number of principal components with the Kaiser method:
- First, you can obtain the standard deviation from
swiss.pca
:
> swiss.pca$sdev Output [1] 1.6228065 1.0354873 0.9033447 0.5592765 0.4067472
- Next, you can obtain the variance from
swiss.pca
:
> swiss.pca$sdev ^ 2 output [1] 2.6335008 1.0722340 0.8160316 0.3127902 0.1654433
- Select components with a variance above
1
:
...