similar to: What is the difference between prcomp and princomp?

Displaying 20 results from an estimated 7000 matches similar to: "What is the difference between prcomp and princomp?"

2006 Mar 25
1
Suggest patch for princomp.formula and prcomp.formula
Dear all, perhaps I am using princomp.formula and prcomp.formula in a way that is not documented to work, but then the documentation just says: formula: a formula with no response variable. Thus, to avoid a lot of typing, it would be nice if one could use '.' and '-' in the formula, e.g. > library(DAAG) > res <- prcomp(~ . - case - site - Pop - sex, possum)
2006 Jun 26
1
princomp and prcomp confusion
When I look through archives at https://stat.ethz.ch/pipermail/r-help/2003-October/040525.html I see this: Liaw, Andy wrote: >In the `Detail' section of ?princomp: > >princomp only handles so-called Q-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 variables. For
2009 Nov 25
1
which to trust...princomp() or prcomp() or neither?
According to R help: princomp() uses eigenvalues of covariance data. prcomp() uses the SVD method. yet when I run the (eg., USArrests) data example and compare with my own "hand-written" versions of PCA I get what looks like the opposite. Example: comparing the variances I see: Using prcomp(USArrests) ------------------------------------- Standard deviations: [1] 83.732400 14.212402
2004 Nov 03
2
Princomp(), prcomp() and loadings()
In comparing the results of princomp and prcomp I find: 1. The reported standard deviations are similar but about 1% from each other, which seems well above round-off error. 2. princomp returns what I understand are variances and cumulative variances accounted for by each principal component which are all equal. "SS loadings" is always 1. 3. Same happens
2008 Feb 10
1
prcomp vs. princomp vs fast.prcomp
Hi R People: When performing PCA, should I use prcomp, princomp or fast.prcomp, please? thanks. Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com
2009 Mar 08
2
prcomp(X,center=F) ??
I do not understand, from a PCA point of view, the option center=F of prcomp() According to the help page, the calculation in prcomp() "is done by a singular value decomposition of the (centered and possibly scaled) data matrix, not by using eigen on the covariance matrix" (as it's done by princomp()) . "This is generally the preferred method for numerical accuracy"
2005 Mar 24
1
RE: [R] Mapping actual to expected columns for princomp object
[Re-directing to R-devel, as I think this needs changes to the code.] Can I suggest a modification to stats:predict.princomp so that it will check for column (variable) names? In src/library/stats/R/princomp-add.R, insert the following after line 4: if (!is.null(cn <- names(object$center))) newdata <- newdata[, cn] Now Dana's example looks like: > predict(pca1, frz) Error in
2008 Nov 03
1
Input correlation matrix directly to princomp, prcomp
Hello fellow Rers, I have a no-doubt simple question which is turning into a headache so would be grateful for any help. I want to do a principal components analysis directly on a correlation matrix object rather than inputting the raw data (and specifying cor = TRUE or the like). The reason behind this is I need to use polychoric correlation coefficients calculated with John Fox's
2011 Nov 04
1
How to use 'prcomp' with CLUSPLOT?
Hello, I have a large data set that has more columns than rows (sample data below). I am trying to perform a partitioning cluster analysis and then plot that using pca. I have tried using CLUSPLOT(), but that only allows for 'princomp' where I need 'prcomp' as I do not want to reduce my columns. Is there a way to edit the CLUSPLOT() code to use 'prcomp', please? #
2003 Oct 16
1
princomp with more coloumns than rows: why not?
As of R 1.7.0, princomp no longer accept matrices with more coloumns than rows. I'm curious: Why was this decision made? I work a lot with data where more coloumns than rows is more of a rule than an exception (for instance spectroscopic data). To me, princomp have two advantages above prcomp: 1) It has a predict method, and 2) it has a biplot method. A biplot method shouldn't be too
2012 May 23
1
prcomp with previously scaled data: predict with 'newdata' wrong
Hello folks, it may be regarded as a user error to scale() your data prior to prcomp() instead of using its 'scale.' argument. However, it is a user thing that may happen and sounds a legitimate thing to do, but in that case predict() with 'newdata' can give wrong results: x <- scale(USArrests) sol <- prcomp(x) all.equal(predict(sol), predict(sol, newdata=x)) ## [1]
2010 Nov 10
2
prcomp function
Hello, I have a short question about the prcomp function. First I cite the associated help page (help(prcomp)): "Value: ... SDEV the standard deviations of the principal components (i.e., the square roots of the eigenvalues of the covariance/correlation matrix, though the calculation is actually done with the singular values of the data matrix). ROTATION the matrix of variable loadings
2012 Aug 23
1
Accessing the (first or more) principal component with princomp or prcomp
Hi , To my knowledge, there're two functions that can do principal component analysis, princomp and prcomp. I don't really know the difference; the only thing I know is that when the sample size < number of variable, only prcomp will work. Could someone tell me the difference or where I can find easy-to-read reference? To access the first PC using princomp:
2007 Apr 23
3
Help about princomp
Hello, I have a problem with the princomp method, it seems stupid but I don't know how to handle it. I have a dataset with some regular data and some outliers. I want to calculate a PCA on the regular data and get the scores for all data, including the outliers. Is this possible on R? Thank you for helping!!! -- View this message in context:
2005 Mar 26
5
PCA - princomp can only be used with more units than variables
Hi all: I am trying to do PCA on the following matrix. N1 N2 A1 A2 B1 B2 gene_a 90 110 190 210 290 310 gene_b 190 210 390 410 590 610 gene_c 90 110 110 90 120 80 gene_d 200 100 400 90 600 200 >dataf<-read.table("matrix") >
2006 Nov 16
1
Problems with principal components analysis PCA with prcomp
Dear friends, I am beginning to use R software in my academic research and I'm having some problems regarding the use of PCA. I have a table with 24445 rows and 9 columns, and I used the function prcomp() to do the analysis. Working with an example?: x<-read.table("test.txt", header=T) row.names(x)<-x[,1] x<-x[,-1] require(stats) pca<-prcomp(x, scale=T) names(pca) ##
2009 Jan 19
3
bootstrapped eigenvector method following prcomp
G'Day R users! Following an ordination using prcomp, I'd like to test which variables singnificantly contribute to a principal component. There is a method suggested by Peres-Neto and al. 2003. Ecology 84:2347-2363 called "bootstrapped eigenvector". It was asked for that in this forum in January 2005 by J?r?me Lema?tre: "1) Resample 1000 times with replacement entire
2007 May 10
1
A simple question about PRINCOMP
Hi, I just wonder if this is a rounding error by the princomp command in R. Although this does not make much sense, using a hypothetical dataset, a, a<-matrix(runif(1000),100,10) I did PCA with the princomp, and compared it with the results estimated with the eigen and the prcomp commands. And I found some differences in the results: opposite signs in the loadings; slight differences in
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
2005 Aug 03
3
prcomp eigenvalues
Hello, Can you get eigenvalues in addition to eigevectors using prcomp? If so how? I am unable to use princomp due to small sample sizes. Thank you in advance for your help! Rebecca Young -- Rebecca Young Graduate Student Ecology & Evolutionary Biology, Badyaev Lab University of Arizona 1041 E Lowell Tucson, AZ 85721-0088 Office: 425BSW rlyoung at email.arizona.edu (520) 621-4005