After doing a PCA using princomp, how do you view how much each component contributes to variance in the dataset. I'm still quite new to the theory of PCA - I have a little idea about eigenvectors and eigenvalues (these determine the variance explained?). Are the eigenvalues related to loadings in R? Thanks, Paul -- View this message in context: http://www.nabble.com/PCA-and---variance-explained-tp19388970p19388970.html Sent from the R help mailing list archive at Nabble.com.
Hi Paul,>> how do you view how much each component contributes to variance in the >> dataset ...It helps to read the help: ?princomp ?prcomp Contributions to inertia or variance are reported as standard deviations (princomp.obj$sdev). So square these values to get the variance accounted for by each component. For the rest, see loadings sub Value in the help file. Regards, Mark. pgseye wrote:> > After doing a PCA using princomp, how do you view how much each component > contributes to variance in the dataset. I'm still quite new to the theory > of PCA - I have a little idea about eigenvectors and eigenvalues (these > determine the variance explained?). Are the eigenvalues related to > loadings in R? > > Thanks, > > Paul >-- View this message in context: http://www.nabble.com/PCA-and---variance-explained-tp19388970p19391466.html Sent from the R help mailing list archive at Nabble.com.
I did PCA stuff years there is a thing that is called a scree score Which will give an indication of the number of PCA's and the variance explained. Might want to web search on scree score and PCA. -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of pgseye Sent: Tuesday, September 09, 2008 5:39 AM To: r-help at r-project.org Subject: [R] PCA and % variance explained After doing a PCA using princomp, how do you view how much each component contributes to variance in the dataset. I'm still quite new to the theory of PCA - I have a little idea about eigenvectors and eigenvalues (these determine the variance explained?). Are the eigenvalues related to loadings in R? Thanks, Paul -- View this message in context: http://www.nabble.com/PCA-and---variance-explained-tp19388970p19388970.h tml Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help at 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 information is being sent at the recipient's reques...{{dropped:16}}
pgseye wrote:> After doing a PCA using princomp, how do you view how much each component > contributes to variance in the dataset. I'm still quite new to the theory of > PCA - I have a little idea about eigenvectors and eigenvalues (these > determine the variance explained?). Are the eigenvalues related to loadings > in R?You can plot the princomp object using screeplot() and you can get the percentage of explained variance from the princomp object p using p$sdev^2 / sum(p$sdev^2) -- Gad Abraham Dept. CSSE and NICTA The University of Melbourne Parkville 3010, Victoria, Australia email: gabraham at csse.unimelb.edu.au web: http://www.csse.unimelb.edu.au/~gabraham