I wanted to know if anyone has ever come across research that was done comparing the output of a Principal Component Analysis (PCA) for PROC FACTOR in SAS versus the PCA output using the prcomp() function in R. I am re-coding a PCA analysis, originally done in SAS, to R. Based on what I've read online, it appears as through the prcomp() function in R provides the most comparable results to PROC FACTOR in SAS. Is my initial determination correct? Also, and more importantly, has anyone found legitimate research that has compared the PCA output of the two functions I've referenced? I should note that I'm defining 'legitimate research' as something from a reputable journal/website or book. Thanks in advance for your help. Your feedback is much appreciated.

  • 1
    $\begingroup$ Exactly what kinds of comparisons are you looking for? There are many reasons why different programs--including the different princomp and pca functions in R--should be expected to produce different output, because the output of PCA is not uniquely defined. Should the comparisons look at these inconsequential differences (such as the signs of eigenvectors) or should they focus on other issues, such as numerical accuracy? $\endgroup$ – whuber Apr 20 '17 at 19:34
  • $\begingroup$ @whuber I'm thinking the comparisons should look at the inconsequential differences, like the signs of the eigenvectors, as you proposed. $\endgroup$ – YimYames Apr 20 '17 at 19:50

This is an interesting topic. Long story short, if you are doing a components analysis, the unrotated results from fa(), taking care to specify only one iteration and setting SMC to FALSE and principal() match. The results from Proc Factor match these to 15 decimal places (on a Windows machine with 64 bit arch.) As the previous poster notes, these are not unique solutions, but the unrotated solutions are within a reflection. Principal factors (uniterated) is another problem, though. The results of proc factor (method=prin, which means no iterations) match those of Proc IML's Call Eigen() function, provided you take care to multiply the eigenvectors by the square root of their corresponding eigenvalue. The same results in R can be obtained by using eigen() as well and the results match. For reasons I do not understand, but which I suspect are numerical analytic problems, the results of fa() with no iterations and SMC=TRUE do not match those of Proc Factor and are, on average 3% higher than reported by Proc Factor for a data set I tried it out on. The results of iterated principal factors were somewhat closer, but matched to only about four decimal places. Some lack of consensus across iterated techniques depends on the convergence tolerance and, again, possibly due to a failure of one platform or another to select the best pivot for the decomposition. For what it's worth.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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