search for: mypca

Displaying 6 results from an estimated 6 matches for "mypca".

Did you mean: mypc
2011 Jun 30
2
sdev value returned by princomp function (used for PCA)
...hen I calculate the principal components for the USArrests data set, I don't find this to be the case: Here is how I calculated the principal components and got the 'sdev' values: > scaledUSArrests <- scale(USArrests) # standardise the variables to have variance 1 and mean 0 > myPCA <- princomp(scaledUSArrests) # do the PCA > myPCA$sdev Comp.1 Comp.2 Comp.3 Comp.4 1.5590500 0.9848705 0.5911277 0.4122639 As far as I understand, the principal components themselves are stored in the 'scores' value returned by princomp, so I calculated the standard de...
2011 Aug 09
2
S4 classes, some help with the basics
...say I use the "pcaMethods" library to create a "pcaRes" object. How can I call parts of that object without using the specific names of the object in the call? example code: library(pcaMethods) myMatrix <- matrix(runif(1e4), ncol=100) ## silly, but sufficient for example myPCA <- pca(myMatrix) ## creates a "pcaRes" S4 class for (i in slotNames(myPCA) ) { summary(myPCA@i) ### I know this doesn't work, but this is the question... what grammar could I use? } ################ I would like to be able to print out the summary for each of the componen...
2010 Apr 16
1
PCA scores
Hi all, I have a difficulty to calculate the PCA scores. The PCA scores I calculated doesn't match with the scores generated by R, mypca<-princomp(mymatrix, cor=T) myscore<-as.matrix(mymatrix)%*%as.matrix(mypca$loadings) Does anybody know how the mypca$scores were calculated? Is my formula not correct? Thanks a lot! Phoebe [[alternative HTML version deleted]]
2012 Feb 22
1
xtable prcomp
Hi, I need to export to LaTex the summary of a PCA. So: myPCA <- prcomp(myDF) mySummary <- summary(myPCA) # print(xtable(mySummary)) How can I export to LaTeX not all the summary but only the first nPCs?? Best Riccardo
2013 Jul 10
3
PCA and gglot2
Hi, I was trying as well as looking for an answer without success (a bit strange since it should be an easy problem) and therefore I will appreciate you help: My simple script is: # Loadings data of 5 columns and 100 rows of data data1<-read.csv("C:/?/MyPCA.csv") pairs(data1[,1:4]) pca1 <- princomp(data1[,1:4], score=TRUE, cor=TRUE) biplot(pca1) The biplot present the data points as numbers. How can I present the data point in color (depends on their group-column 5). I was thinking about doing it using ggplot2 but I can not succeed. Any idea...
2009 Oct 28
2
Labelling individual points on 3D PCA scatterplot
...al components: >scatterplot3d(PCA$scores [,1:3],xlab="Component 1 (26.9%)",main="My 3D PCA",ylab="Component 2 + (17.9%)", zlab="Component 3 (12.4%)",type="h",box=FALSE,pch=21,bg=color) And i get this: http://www.nabble.com/file/p26096592/myPCA.jpeg 'text' and 'textxy' only accept 2D coordinates so they do not label my points in a way that makes sense. I'm open to other 3D plotting functions in R, i just think this one is easy to visually understand. In addition, If there is any way to move the grid up to z=0 please...