Re: [R] Principal component analysis PCA

2008-02-14 Thread Thomas Lumley
On Thu, 14 Feb 2008, SNN wrote: > > Thanks for the advice. > > I tried to find the cov of my matrix using R and it ran out of memory. How did you do this? The covariance matrix is only 115x115, so it shouldn't run out of memory cov(t(code)) should work If that doesn't work then tcrossprod

Re: [R] Principal component analysis PCA

2008-02-14 Thread SNN
Thanks for the advice. I tried to find the cov of my matrix using R and it ran out of memory. I am not sure how to do double loop to create the covariace matrix? Also is doing prcomp( covariace matrix) the same as finding prcomp( original data ,matrix of snps)? Thanks for your help, Thomas

Re: [R] Principal component analysis PCA

2008-02-14 Thread Thomas Lumley
On Wed, 13 Feb 2008, Wang, Zhaoming (NIH/NCI) [C] wrote: > > Try EIGENSTRAT http://www.nature.com/ng/journal/v38/n8/abs/ng1847.html The same approach as EIGENSTRAT is pretty straightforward in R. You need to create the covariance matrix of people (rather than of SNPs) for the 0/1/2 genotype at

Re: [R] Principal component analysis PCA

2008-02-13 Thread Wang, Zhaoming (NIH/NCI) [C]
Try EIGENSTRAT http://www.nature.com/ng/journal/v38/n8/abs/ng1847.html or use a subset of SNPs. Zhaoming -Original Message- From: SNN [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 13, 2008 9:14 PM To: r-help@r-project.org Subject: [R] Principal component analysis PCA Hi, I