[BioC] Percentage of Variance to be included at 3D graph of Principal Component Analysis (PCA)- made4 package
Gerhard Thallinger
Gerhard.Thallinger at tugraz.at
Mon Oct 18 11:53:40 CEST 2010
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$sdev^2)*100,2)
pc2 <- round(pca$sdev[2]^2/sum(pca$sdev^2)*100,2)
etc ...
Hth
Gerhard
------------------------------------------------------------------------
Dr. Gerhard Thallinger E-mail: Gerhard.Thallinger at 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
More information about the Bioconductor
mailing list