princomp uses the raw data and calculates the correlation or covariance matrix 
on the way to the PC's, so that doesn't use a correlation matrix itself. You 
do, however, get the choice.

However, PC's are the eigenvectors of the correlation (or covariance) matrix, 
so in principle calling eigen() on either would be sufficient for the PC's. The 
signs may differ, though, as they are arbitrary; compare 
prcomp(USArrests)$rotation with eigen(cov(USArrests)).

S




>>> Bjørn-Helge Mevik <b.h.me...@usit.uio.no> 16/02/2009 09:05 >>>
"glenn" <g1enn.robe...@btinternet.com> writes:

> Is there a function (before I try and write it !) that allows the input of a
> covariance or correlation matrix to calculate PCA, rather than the actual
> data as in princomp()

Yes, there is: princomp(). :-)


-- 
Bjørn-Helge Mevik

______________________________________________
R-help@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.

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
R-help@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.

Reply via email to