I'm trying to perform the following analysis in MATLAB:
Direct Oblimin Rotation with a Delta value of 0 and "Kaiser Normalization"
I know that MATLAB has a function called rotatefactors, however oblimin rotation is not mentioned (neither "Kaiser Normalization"). How can I perform this analysis in MATLAB?
To be more specific, I'm trying to match the exact output of SPSS when performing this analysis.
Here you can find all the algorithms used in SPSS: link (check the page 338 for the oblimin rotation). Unfortunately, I can't understand the equations and thus reproduce them in MATLAB.
As an example, I'm using the following data:
A = magic(10);
writetable(array2table(A),'test.xlsx') % This data can be imported to SPSS
I perform a PCA (on the correlation matrix) and extract only 2 factors. Here is how it is done in MATLAB in order to obtain the exact same Loading Matrix as in SPSS (which they call "Component Matrix"):
[eigvector,eigmatrix] = eig(corr(A));
[~,ind] = sort(diag(eigmatrix),'descend');
eigmatrix = eigmatrix(ind,ind);
eigvector = eigvector(:,ind);
eigvalues = diag(eigmatrix); % Eigeinvalues
loadings = eigvector*sqrt(eigmatrix);
loadings = loadings(:,1:2) % Extract only 2 factors
Next, I should perform the rotation on the loadings
matrix using the function rotatefactors
, and this is where I'm stuck.
Here is the syntax in SPSS:
FACTOR
/VARIABLES A1 A2 A3 A4 A5 A6 A7 A8 A9 A10
/MISSING LISTWISE
/ANALYSIS A1 A2 A3 A4 A5 A6 A7 A8 A9 A10
/PRINT INITIAL EXTRACTION ROTATION
/CRITERIA FACTORS(2) ITERATE(25)
/EXTRACTION PC
/CRITERIA ITERATE(25) DELTA(0)
/ROTATION OBLIMIN
/METHOD=CORRELATION.
This is the output from SPSS which I'm trying to reproduce in MATLAB:
Direct Oblimin Method . A method for oblique (nonorthogonal) rotation. When delta equals 0 (the default), solutions are most oblique. As delta becomes more negative, the factors become less oblique. To override the default delta of 0, enter a number less than or equal to 0.8.
Factor rotation methods preserve the subspace and give you a different basis for it. Varimax returns factors that are orthogonal; Oblimin allows the factors to not be orthogonal.
The default delta for direct oblimin is 0 and the default Kappa = 4 for promax.
MATLAB doesn't have the OBLIMIN rotation method implemented yet, because the promax method does the same thing, only it is much much faster.
You'll not get the exact same output with this method compared to the SPSS OBLIMIN output, but they should be pretty close, as they're doing the same thing. (Actually, promax is also an oblique rotation, except it's first approximated by an orthogonal rotation before orthogonality is relaxed)
It might be possible to custom the orthogonal rotation inside the promax one, but I don't think you'll ever get the same output.
In order to do a promax rotation :
[B,T]=rotatefactors(loadings,'method','promax');
% Your pattern matrix is in B, to get the structure matrix, you can do :
S=B*inv(T'*T);
Note that rotations are defined modulo an angle pi, so you'll have an output matrix equal to +- what you want.
Running this on your example, one gets the pattern :
B =
-0.0178 0.9765
-0.9528 0.0563
-0.0305 -1.0124
0.9442 -0.0602
0.9897 -0.0155
-0.7625 0.1992
-0.8823 0.0333
-0.9776 -0.1919
-0.7797 0.0719
0.9950 0.0767
Along with the structure matrix :
S =
-0.5740 0.9867
-0.9849 0.5990
0.5461 -0.9950
0.9785 -0.5980
0.9985 -0.5791
-0.8760 0.6335
-0.9013 0.5358
-0.8683 0.3649
-0.8206 0.5160
0.9513 -0.4899
So, this is pretty close, but still different from the SPSS output.
We can see though, that the big differences are for pretty small values. As one is always taking the biggest values for the correlation analysis, it should not be that much of a problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With