[R] What is the difference between prcomp and princomp?

Mark Difford mark_difford at yahoo.co.uk
Mon Oct 19 12:02:55 CEST 2009


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.




More information about the R-help mailing list