search for: prcomp

Displaying 20 results from an estimated 300 matches for "prcomp".

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 nu...
2005 Oct 18
3
Finding code for R functions
Greetings, I am trying to figure out how to find the source code for R functions. I am specifically interested in finding the code for the "prcomp" function. I know that typing the function name without parenthesis will lead to the code (or to a .Internal or .FORTRAN or .C call). However, I don't really understand what is going on. For example, typing "mean" gives a "UseMethod" response, while typing "mean.d...
2011 Mar 09
1
biplot breakdown help
Hi, I am trying to understand how the biplot.prcomp is constructed so I can manipulate it to emphasise particular observations and reduce the number of variables shown. The prcomp model I have ran has cor=TRUE and scale=TRUE I have worked out from looking at str(prcomp.model) that... prcomp.model$x = the observations ploted in the biplot prcomp....
2009 Dec 23
1
prcomp : plotting only explanatory axis arrows
Dear all, I have a very large dataset (1712351 , 20) and would like to plot only the arrows that represent the contribution of each variables. On the sample below I woild like to plot only the explanatory variables (Murder, Assault..) and not the sites. prcomp(USArrests) # inappropriate prcomp(USArrests, scale = TRUE) prcomp(~ Murder + Assault + Rape, data = USArrests, scale = TRUE) plot(prcomp(USArrests)) summary(prcomp(USArrests, scale = TRUE)) biplot(prcomp(USArrests, scale = TRUE)) Thanks a lot, milton [[alternative HTML version deleted]]
2006 Jun 16
2
bug in prcomp (PR#8994)
The following seems to be an bug in prcomp(): > test <- ts( matrix( c(NA, 2:5, NA, 7:10), 5, 2)) > test Time Series: Start = 1 End = 5 Frequency = 1 Series 1 Series 2 1 NA NA 2 2 7 3 3 8 4 4 9 5 5 10 > prcomp(test, scale.=TRUE, na.action=na.omit) Erro en s...
2013 Oct 03
1
prcomp - surprising structure
Hello, I did a pca with over 200000 snps for 340 observations (ids). If I plot the eigenvectors (called rotation in prcomp) 2,3 and 4 (e.g. plot (rotation[,2]) I see a strange "column" in my data (see attachment). I suggest it is an artefact (but of what?). Suggestion: I used prcomp this way: prcomp (mat), where mat is a matrix with the column means already substracted followed by a normalisation procedure (...
2004 Jan 15
2
prcomp scale error (PR#6433)
Full_Name: Ryszard Czerminski Version: 1.8.1 OS: GNU/Linux Submission from: (NULL) (205.181.102.120) prcomp(..., scale = TRUE) does not work correctly: $ uname -a Linux 2.4.20-28.9bigmem #1 SMP Thu Dec 18 13:27:33 EST 2003 i686 i686 i386 GNU/Linux $ gcc --version gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) > a <- matrix(rnorm(6), nrow = 3) > sum((scale(a %*% svd(cov(a))$u, scale = F)[,1]...
1998 Aug 26
0
prcomp & princomp - revised
My previous post about prcomp and princomp was done in some haste as I had long ago indicated to Kurt that I would try to have this ready for the June release, and it appeared that I would miss yet another release. I also need to get it out before it becomes hopelessly buried by other work. Brian Ripley kindly pointed out some...
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
2013 Jan 23
0
na.omit option in prcomp: formula interface only
Dear r-devel list, dear Ben I came across a post of Ben Bolker from Feb 2012 (see below) on handling NA values in prcomp(). As I faced the same issue and found Ben's suggestions interesting, I was wondering whether this led to further discussions I might have missed? I understand handling NA values is far from trivial, but would it be possible to add a warning in the documentation, and/or whenever na.action is us...
2016 Mar 22
3
Memory usage in prcomp
Hi All: I am running prcomp on a very large array, roughly [500000, 3650]. The array itself is 16GB. I am running on a Unix machine and am running ?top? at the same time and am quite surprised to see that the application memory usage is 76GB. I have the ?tol? set very high (.8) so that it should only pull out a few compon...
2016 Mar 22
3
Memory usage in prcomp
Hi All: I am running prcomp on a very large array, roughly [500000, 3650]. The array itself is 16GB. I am running on a Unix machine and am running ?top? at the same time and am quite surprised to see that the application memory usage is 76GB. I have the ?tol? set very high (.8) so that it should only pull out a few compon...
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...
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 for...
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....
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 ma...
2007 Jun 14
2
Difference between prcomp and cmdscale
I'm looking for someone to explain the difference between these procedures. The function prcomp() does principal components anaylsis, and the function cmdscale() does classical multi-dimensional scaling (also called principal coordinates analysis). My confusion stems from the fact that they give very similar results: my.d <- matrix(rnorm(50), ncol=5) rownames(my.d) <- paste("c&qu...
2009 Nov 09
4
prcomp - principal components in R
Hello, not understanding the output of prcomp, I reduce the number of components and the output continues to show cumulative 100% of the variance explained, which can't be the case dropping from 8 components to 3. How do i get the output in terms of the cumulative % of the total variance, so when i go from total solution of 8 (8 vari...
2008 May 18
1
predict.prcomp: 'newdata' does not have the correct number of columns
Hi, I'm doing PCA on wide matrices and I don't understand why calling predict.prcomp on it throws an error: > x1 <- matrix(rnorm(100), 5, 20) > x2 <- matrix(rnorm(100), 5, 20) > p <- prcomp(x1) > predict(p, x2) Error in predict.prcomp(p, x2) : 'newdata' does not have the correct number of columns > dim(x2) [1] 5 20 > dim(p$rotation) [1]...
2012 Feb 09
0
na.omit option in prcomp: formula interface only
This is a wishlist/request for discussion about the behaviour of the na.action option in prcomp, specifically the fact that it only applies to the formula interface. I had a question from a friend (who is smart and careful and generally R's TFM, although like all of us he misses things sometimes) asking why the na.action= argument didn't seem to be doing anything in prcomp (i.e. o...