similar to: Help with PCA

Displaying 20 results from an estimated 6000 matches similar to: "Help with PCA"

2009 Oct 19
2
What is the difference between prcomp and princomp?
Some webpage has described prcomp and princomp, but I am still not quite sure what the major difference between them is. Can they be used interchangeably? In help, it says 'princomp' only handles so-called R-mode PCA, that is feature extraction of variables. If a data matrix is supplied (possibly via a formula) it is required that there are at least as many units as
2011 Dec 06
1
Problem with clusplot
Dear all I'm trying to run a cluster analysis with R Here are the commands: mydata <- na.omit(matrix) # listwise deletion of missing mydata <- scale(matrix) # standardize variables fit <- kmeans(mydata, 8) # 8 cluster solution # get cluster means aggregate(mydata,by=list(fit$cluster),FUN=mean) # append cluster assignment mydata <- data.frame(mydata, fit$cluster)
2009 Feb 13
4
PCA functions
Hi All, would appreciate an answer on this if you have a moment; Is there a function (before I try and write it !) that allows the input of a covariance or correlation matrix to calculate PCA, rather than the actual data as in princomp() Regards Glenn [[alternative HTML version deleted]]
2008 Sep 09
4
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:
2005 Jul 08
2
extract prop. of. var in pca
Dear R-helpers, Using the package Lattice, I performed a PCA. For example pca.summary <- summary(pc.cr <- princomp(USArrests, cor = TRUE)) The Output of "pca.summary" looks as follows: Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Standard deviation 1.5748783 0.9948694 0.5971291 0.41644938 Proportion of Variance 0.6200604
2008 Jul 03
2
PCA on image data
Dear R users, i would like to apply a PCA on image data for data reduction. The image data is available as three matrices for the RGB values. At the moment i use x <- data.frame(R,G,B)#convert image data to data frame pca<-princomp(x,retx = TRUE) This is working so far. >From this results then i want to create a new matrix from the first (second..) principal component. Here i stuck.
2010 Apr 02
2
Biplot for PCA using labdsv package
Hi everyone, I am doing PCA with labdsv package. I was trying to create a biplot graphs in order to observe arrows related to my variables. However when I run the script for this graph, the console just keep saying: *Error in nrow(y) : element 1 is empty; the part of the args list of 'dim' being evaluated was: (x)* could please someone tell me what this means? what i am doing
2010 Jun 30
3
Factor Loadings in Vegan's PCA
Hi all, I am using the vegan package to run a prcincipal components analysis on forest structural variables (tree density, basal area, average height, regeneration density) in R. However, I could not find out how to extract factor loadings (correlations of each variable with each pca axis), as is straightforwar in princomp. Do anyone know how to do that? Moreover, do anyone knows
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]]
2011 Jun 30
2
sdev value returned by princomp function (used for PCA)
Dear all, I have a question about the 'sdev' value returned by the princomp function (which does principal components analysis). On the help page for princomp it says 'sdev' is 'the standard deviations of the principal components'. However, when I calculate the principal components for the USArrests data set, I don't find this to be the case: Here is how I
2003 Apr 26
3
PCA
Hi, I have a dataset of dimensions 50 x 15000, and tried to use princomp or prcomp on this dataset with 15000 columns as variables, but it seems that the 2 functions can;t handle this large number of columns, anyone has nay suggestions to get around this? Thanks --------------------------------- [[alternate HTML version deleted]]
2004 Jul 14
2
PCA in R
Hello, I'm attempting to run a PCA on an example data set. I ran it just fine, but I don't know how to few the output? I listed what the variable got stored in it, but I don't know how I can get anything else out of it. Are there other ways to view the results? Also, I'm confused about the last line "6 variables and 8 observations" Aren't the rows the
2009 Jan 13
1
PCA loadings differ vastly!
hi, I have two questions: #first (SPSS vs. R): I just compared the output of different PCA routines in R (pca, prcomp, princomp) with results from SPSS. the loadings of the variables differ vastly! in SPSS the variables load constantly higher than in R. I made sure that both progr. use the correlation matrix as basis. I found the same problem with rotated values (varimax rotation and rtex=T
2008 Jul 01
2
PCA : Error in eigen(cv,
Hi all, I am doing bootstrap on a distance matrix, in which samples have been drawn with replacement. After that I do PCA on a resulted matrix, and these 2 steps are repeated 1000 times. pca(x) is a vector where I wanted to store all 1000 PCAs; and x is from 1 to 1000 SampleD is a new matrix after resampling; I am getting the following error message, which I don't understand: ....
2011 Jun 06
2
adding an ellipse to a PCA plot
Hi, I created a principal component plot using the first two principal components. I used the function princomp() to calculate the scores. now, I would like to superimpose an ellipse representing the center and the 95% confidence interval of a series of points in my plot (as to illustrate the grouping of my samples). I looked at the ellipse() function in the ellipse package but can't get it
2005 Apr 21
4
basic question
I know this question is very simple, but I am not figure it out I have the data frame:   test<- data.frame(year=c(2000,2000,2001,2001),x=c(54,41,90,15), y=c(29,2,92,22), z=c(26,68,46,51)) test   year    x   y   z 1 2000 54 29 26 2 2000 41  2  68 3 2001 90 92 46 4 2001 15 22 51   I want to sum the vectors x, y and z within each year (2000
2010 Nov 30
3
pca analysis: extract rotated scores?
Dear all I'm unable to find an example of extracting the rotated scores of a principal components analysis. I can do this easily for the un-rotated version. data(mtcars) .PC <- princomp(~am+carb+cyl+disp+drat+gear+hp+mpg, cor=TRUE, data=mtcars) unclass(loadings(.PC)) # component loadings summary(.PC) # proportions of variance mtcars$PC1 <- .PC$scores[,1] # extract un-rotated scores of
2012 Apr 25
1
pca biplot.princomp has a bug?
x=rmvnorm(2000, rep(0, 6), diag(c(5, rep(1,5)))) x=scale(x, center=T, scale=F) pc <- princomp(x) biplot(pc) There are a bunch of red arrows plotted, what do they mean? I knew that the first arrow labelled with "Var1" should be pointing the most varying direction of the data-set (if we think them as 2000 data points, each being a vector of size 6). I also read from
2011 Mar 03
2
PCA - scores
I am running a PCA, but would like to rotate my data and limit the number of factors that are analyzed. I can do this using the "principal" command from the psych package [principal(my.data, nfactors=3,rotate="varimax")], but the issue is that this does not report scores for the Principal Components the way "princomp" does. My question is: Can you get an
2009 Oct 28
2
Labelling individual points on 3D PCA scatterplot
Hi There, I'm attempting to plot 10 values on a three-dimensional PCA with text labels next to each point. While i have no trouble doing this on 2D plots using the 'text' or 'textxy' function, I cannot find a function to do this on a 3D plot. I am using princomp for my PCA: >PCA<-princomp(eucdata, cor=TRUE) >PCA$scores [,1:3] # the three principal components i