title: How to perform a Direct Oblimin Rotation in MATLAB
body: <p>I'm trying to perform the following analysis in MATLAB:</p>
  <blockquote>
  <p>Direct Oblimin Rotation with a Delta value of 0 and &quot;Kaiser
  Normalization&quot;</p>
  </blockquote>
  <p>I know that MATLAB has a function called <a href="http://www.mathworks.com/help/stats/rotatefactors.html" rel="nofollow noreferrer">rotatefactors</a>, however oblimin rotation is not mentioned (neither &quot;Kaiser Normalization&quot;). How can I perform this analysis in MATLAB?</p>
  <p>To be more specific, I'm trying to match the exact output of SPSS when performing this analysis.</p>
  <p>Here you can find all the algorithms used in SPSS: <a href="http://library.uvm.edu/services/statistics/SPSS22Manuals/IBM%20SPSS%20Statistics%20Algorithms.pdf" rel="nofollow noreferrer">link</a> (check the page 338 for the oblimin rotation). Unfortunately, I can't understand the equations and thus reproduce them in MATLAB.</p>
  <hr />
  <p>As an example, I'm using the following data:</p>
  <pre><code>A = magic(10);
  writetable(array2table(A),'test.xlsx') % This data can be imported to SPSS
  </code></pre>
  <p>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 &quot;Component Matrix&quot;):</p>
  <pre><code>[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
  </code></pre>
  <p>Next, I should perform the rotation on the <code>loadings</code> matrix using the function <code>rotatefactors</code>, and this is where I'm stuck.</p>
  <p>Here is the syntax in SPSS:</p>
  <pre><code>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.
  </code></pre>
  <p>This is the output from SPSS which I'm trying to reproduce in MATLAB:</p>
  <p><a href="https://i.stack.imgur.com/fmyp2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fmyp2.png" alt="rotated ouput (SPSS)" /></a></p>