[R] prcomp & eigenvectors ... ??

peter dalgaard pdalgd at gmail.com
Mon May 30 09:03:02 CEST 2011


On May 28, 2011, at 20:08 , Natalie Stephenson wrote:

> Hi ...
> 
> Please could you help with probably a very simple problem I have.  I'm completely new to R and am trying to follow a tutorial using R for Force Distribution Analysis that I got from ... http://projects.eml.org/mbm/website/fda_gromacs.htm.  Basically, the MDS I preform outputs a force matrix (.fm) from the force simulation I perform.
> 
> Then, this matrix is read into R and prcomp is performed.
> 
> Basically, the tutorial says 'Having run PCA, now is a good time to check the eigenvalue structure.' although it doesn't mention how I actually go about doing that with R.  Could anyone tell me how I would be able to check the eigenvalues/eigenvectors??
> 
> Thanks so much for your help and I'm sorry if this is a stupid question!!

Not particularly, given that you may be missing some basic theory of PCA. Basically, the loadings of a PCA _are_ the eigenvectors, so e.g. plotting the loadings matrix against the variable number or whatever structure you have on them -- if they are spatial ore temporal measurements, plot against space/time. Something like

matplot(loadings(pca), type="l")
matplot(times, loadings(pca), type="l")

could prove useful (the latter case if your data are really short time series). 

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list