12

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:

rotated ouput (SPSS)

12
  • and your question would be?
    – Benoit_11
    Commented Sep 29, 2015 at 18:17
  • What is... oblimin rotation?
    – rayryeng
    Commented Sep 29, 2015 at 18:26
  • @Benoit_11how to perform a direct oblimin rotation in MATLAB
    – mat
    Commented Sep 30, 2015 at 7:30
  • @rayryeng I updated the post, have a look please!
    – mat
    Commented Sep 30, 2015 at 8:05
  • Apparently you should implement it yourself :)) Commented Oct 1, 2015 at 20:22

1 Answer 1

3

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.

5
  • It is really close to what I was looking for but it's not yet exactly the same. I'll wait a few more days to see if there is a new response, otherwise I'll accept yours. Thank you!
    – mat
    Commented Oct 6, 2015 at 10:46
  • @Adriaan : Sorry, english is not my native language, is 'cheers' too informal? What about the initials?
    – BillBokeey
    Commented Oct 7, 2015 at 8:46
  • They are what we call "fluff". It is not related to the question itself and thus is not necessary information here. The way to say "thank you" on SO is by using upvotes or accepting answers. This is to keep the text in the answer minimised to the information required to solve the problem. Sorry about not commenting this, I assumed you knew these SO-conventions, having 200 rep!
    – Adriaan
    Commented Oct 7, 2015 at 12:37
  • Thanks Adriaan, now i know!
    – BillBokeey
    Commented Oct 7, 2015 at 14:07
  • 3
    Part of the reason stuff like "I need help with...", "I don't know MATLAB, and I want ..." or "Thanks / Cheers" etc. is edited out is because it often shows up in search results. If you search for "How can I add two numbers?", you don't want to read: "Hi guys, I have a problem, and I have tried for hours. I really hope you can help me...", you want only the question and the answer... :) That aside; It's fine to add a little "cheers", or "hope that helped" in the end of an answer, but expect that it might be edited out by someone =) Commented Oct 8, 2015 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.