I am trying to determine dimensionality based on eigenvalues (along with other criteria), but the eigenvalues I get from the pca function seem completely off. They are either very small (all below 1) or very big, and do not average to ~1. When I run the PCA on the same data in SPSS, my eigenvalues do seem normal.
Am I running the analysis incorrectly, or should I interpret the eigenvalues that Matlab gives differently?
My data is a matrix of 16 variables (columns) and 61 observations (rows). I have rescaled the data so that each column has a range of 0-1, since the variables in the raw data have wildely different ranges. When I run the rescaled matrix, I get all eigenvalues below 1. With my raw data matrix, eigenvalues have a really big range from ~500 to below 1.
Attached is a csv of my raw data matrix.
I ran the pca as follows:
[COEFF, SCORE, LATENT, TSQUARED, EXPLAINED] = pca(matrix);
I looked at LATENT for the eigenvalues.
I also tried different variations and specifications of the function, which made no difference for the eigenvalues, such as:
[COEFF, SCORE, LATENT, TSQUARED, EXPLAINED] = pca(matrix,'algorithm', 'eig')%or
[COEFF, SCORE, LATENT, TSQUARED, EXPLAINED] = pca(matrix,'algorithm', 'eig','Centered',false)%or
[COEFF, SCORE, LATENT, TSQUARED, EXPLAINED] = pca(matrix,'algorithm', 'eig','Centered',false,'Rows','all')
Though I'm pretty sure my rescaling is correct, since it did not give me any problems in SPSS, here is the code:
norm_matrix = raw_matrix;minx = zeros(1,16);maxx = zeros(1,16);for i = 1:16 minx(i) = min(raw_matrix(:,i)); maxx(i) = max(raw_matrix(:,i)); norm_matrix(:,i) = (raw_matrix(:,i)-minx(i))/(maxx(i)-minx(i));end
Here is an example of my LATENT output:
raw_LATENT = 1.0e+05 * 3.2033 1.4096 0.3762 0.1009 0.0466 0.0223 0.0064 0.0009 0.0002 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 %or norm_LATENT = 0.4348 0.2526 0.1842 0.0833 0.0702 0.0575 0.0439 0.0380 0.0281 0.0235 0.0154 0.0121 0.0098 0.0074 0.0050 0.0044 0.0034 0.0022 0.0018 0.0013 0.0011 0.0002 0.0000 0
Best Answer