If you run a factor analysis in SPSS and then run the same factor analysis in Stata using the same data, you might get very different results. Even after making sure that you are using the same method of extraction (for example, principal factor), and specifying that you want to retain factors based on their eigenvalues (a common rule of thumb to retain factors), SPSS might end up retaining more factors than Stata.
If you collaborate with colleagues that use SPSS, this can be a source of confusion.
The reason why this happens is that SPSS first calculates the eigenvalues using PCA (as explained here) to decide how many factors to retain, and then goes on to use whatever extraction method you indicate to perform the factor analysis. Stata, on the other hand, calculates the eigenvalues using your specified extraction method first and bases the decision of how many factors to retain on those calculated eigenvalues.
To replicate what SPSS does when we use the 'Principal Axis Factoring' method (i.e., a simple principal factors method) in Stata we need to do three things:
Run a PCA to calculate the initial eigenvalues as SPSS does
Retrieve and store the number of factors that Stata would extract using PCA
Run a factor analysis with the 'iterated principal factor' method (which is what SPSS does when running a 'Principal Axis Factoring')
Here is the Stata code to do that: In this example, we are running a factor analysis on 5 variables named var1, var2, var3, var4, and var5
* 1) Run a PCA to calculate the initial eigenvalues as SPSS does
* Use the 'pcf' option to tell stata to use 'principal-component factor' (i.e, PCA)
* Use the 'mineigen' option to tell stata to retain factors with eigenvalues above 1
factor var1 var2 var3 var4 var5, pcf mineigen(1)
* 2) Retrieve and store the number of factors that Stata would extract using PCA
* 'e(f)' is the scalar where Stata stores the number of factors it retained after a factor analysis
* We store the value of e(f) in a global macro named 'number_factors' (or whatever you want to call it)
global number_factors = e(f)
* 3) Run a factor analysis
* We use the 'ipf' option to tell Stata to use the 'iterated principal factor method'
* We use the 'citerate' option to tell Stata how many iterations (maximum) to use
* We use the 'factors' option to tell Stata to use the number of factors that we have stored in our $number_factors macro
factor var1 var2 var3 var4 var5, ipf citerate(25) factors($number_factors)
* We can then rotate using whatever rotation method we want
rotate, oblique oblimin blank(.25)
* We can also get the factor correlation matrix using the post-estimation command 'estat'
estat common