Percentage of Variance to be included at 3D graph, of Principal Component Analysis (PCA)- made4 package
0
0
Entering edit mode
Aedin Culhane ▴ 510
@aedin-culhane-1526
Last seen 4.6 years ago
United States
Hi John In made4, For correspondence analysis (COA, the default option in made4) the total $eig will be equivalent to the total chi-sq of the table. data.coa <- ord(eSetdata, type = "coa") To get the % of variance explained by each axis. > data.coa$ord$eig * 100/sum(data.coa$ord$eig) [1] 33.69 23.13 12.65 9.84 6.44 5.83 4.66 3.76 The cumulative variance is given by > cumsum(data.coa$ord$eig * 100/sum(data.coa$ord$eig)) [1] 33.7 56.8 69.5 79.3 85.7 91.6 96.2 100.0 Therefore almost 57% of the variance is captured by the first 2 components. For PCA data.pca <- ord(eSetdata, type = "pca") To get the % of variance explained by each axis. data.pca$ord$eig * 100 The cumulative variance is given by cumsum(data.coa$ord$eig * 100) Examples of these and more complete explanation are given on the website http://compbio.dfci.harvard.edu/courses/bioconductor/ with the vignette url http://compbio.dfci.harvard.edu/courses/bioconductor/MGED_Oct09.pdf best regards Aedin Message: 7 Date: Mon, 18 Oct 2010 11:53:40 +0200 From: "Gerhard Thallinger" <gerhard.thallinger@tugraz.at> To: "'John Antony Gaspar'" <gasparj@uni-koeln.de> Cc: bioconductor@stat.math.ethz.ch Subject: Re: [BioC] Percentage of Variance to be included at 3D graph of Principal Component Analysis (PCA)- made4 package Message-ID: <a1317a5fae314443af5958a387e95419@agilix> Content-Type: text/plain; charset="us-ascii" Dear John, > > Please help me out with this regard. 'prcomp' provides Standard > > deviation, Proportion of variance and Cumulative Proportion. How to > > use them in calculating the percentage of variance at all three > > PC level. > The percentage of variance explained can be calculated as follows: pca <- prcomp(USArrests, scale = TRUE) pc1 <- round(pca$sdev[1]2/sum(pca$sdev2)*100,2) pc2 <- round(pca$sdev[2]2/sum(pca$sdev2)*100,2) etc ... Hth Gerhard ---------------------------------------------------------------------- -- Dr. Gerhard Thallinger E-mail: Gerhard.Thallinger@tugraz.at Institute for Genomics and Bioinformatics Web: http://genome.tugraz.at Graz University of Technology Tel: +43 316 873 5343 Petersgasse 14/V Fax: +43 316 873 105343 8010 Graz, Austria Map: http://genome.tugraz.at/Loc.html -- Aedín Culhane, Computational Biology and Functional Genomics Harvard School of Public Health, Dana-Farber Cancer Institute 44 Binney Street, SM822C Department of Biostatistics and Computational Biology, Dana-Farber Cancer Institute Boston, MA 02115 USA Phone: +1 (617) 632 2468 Fax: +1 (617) 582 7760 Email: aedin@jimmy.harvard.edu Web URL: http://www.hsph.harvard.edu/research/aedin-culhane/ [[alternative HTML version deleted]]
Cancer graph made4 Cancer graph made4 • 1.8k views
ADD COMMENT

Login before adding your answer.

Traffic: 948 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6