Some webpage has described prcomp and princomp, but I am still not quite sure what the major difference between them is. Can they be used interchangeably? In help, it says 'princomp' only handles so-called R-mode PCA, that is feature extraction of variables. If a data matrix is supplied (possibly via a formula) it is required that there are at least as many units as variables. For Q-mode PCA use 'prcomp'. What are R-mode and Q-mode? Are they just too different numerical methods to compute PCA?
On Sun, Oct 18, 2009 at 10:42 PM, Peng Yu <pengyu.ut at gmail.com> wrote:> Some webpage has described prcomp and princomp, but I am still not > quite sure what the major difference between them is. Can they be used > interchangeably? > > In help, it says > > ? ? 'princomp' only handles so-called R-mode PCA, that is feature > ? ? extraction of variables. ?If a data matrix is supplied (possibly > ? ? via a formula) it is required that there are at least as many > ? ? units as variables. ?For Q-mode PCA use 'prcomp'. > > > What are R-mode and Q-mode? Are they just too different numerical > methods to compute PCA?Also, it seems that 'loadings' of princomp is the same as 'rotation' of prcomp. I'm wondering whey they have different names in the two functions.
Mark Difford
2009-Oct-19 10:02 UTC
[R] What is the difference between prcomp and princomp?
Peng Yu wrote:>> Some webpage has described prcomp and princomp, but I am still not >> quite sure what the major difference between them is.The main difference, which could be extracted from the information given in the help files, is that prcomp uses the singular value decomposition [i.e. does not rely eigenanalysis], which "is generally the preferred method for numerical accuracy." There is plenty of information on the web about the differences between R- and Q-mode PCA. Regards, Mark. Peng Yu wrote:> > Some webpage has described prcomp and princomp, but I am still not > quite sure what the major difference between them is. Can they be used > interchangeably? > > In help, it says > > 'princomp' only handles so-called R-mode PCA, that is feature > extraction of variables. If a data matrix is supplied (possibly > via a formula) it is required that there are at least as many > units as variables. For Q-mode PCA use 'prcomp'. > > > What are R-mode and Q-mode? Are they just too different numerical > methods to compute PCA? > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >-- View this message in context: http://www.nabble.com/What-is-the-difference-between-prcomp-and-princomp--tp25952965p25955831.html Sent from the R help mailing list archive at Nabble.com.