similar to: How to set up number of prin comp.

Displaying 20 results from an estimated 3000 matches similar to: "How to set up number of prin comp."

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]]
2005 Nov 18
1
pr[in]comp: predict single observation when data has colnames (PR#8324)
To my knowledge, this has not been reported previously, and doesn't seem to have been changed in R-devel or R-patched. If M is a matrix with coloumn names, and mod <- prcomp(M) # or princomp then predicting a single observation (row) with predict() gives the error Error in scale.default(newdata, object$center, object$scale) : length of 'center' must equal the number of
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
2006 Jul 16
1
princomp and eigen
Consider the following output [R2.2.0; Windows XP] > set.seed(160706) > X <- matrix(rnorm(40),nrow=10,ncol=4) > Xpc <- princomp(X,cor=FALSE) > summary(Xpc,loadings=TRUE, cutoff=0) Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Standard deviation 1.2268300 0.9690865 0.7918504 0.55295970 Proportion of Variance 0.4456907 0.2780929
2005 May 23
1
Can't reproduce clusplot princomp results.
Dear R folk: Perhaps I'm just dense today, but I am having trouble reproducing the principal components plotted and summarized by clusplot. Here is a brief example using the pluton dataset. clusplot reports that the first two principal components explain 99.7% of the variability. But this is not what princomp is reporting. I would greatly appreciate any advice. With best regards, -- Tom
2007 May 25
2
R-About PLSR
hi R help group, I have installed PLS package in R and use it for princomp & prcomp commands for calculating PCA using its example file(USArrests example). But How I can use PLS for Partial least square, R square, mvrCv one more think how i can import external file in R. When I use plsr, R2, RMSEP it show error could not find function plsr, RMSEP etc. How I can calculate PLS, R2, RMSEP, PCR,
2003 Jan 30
3
Principal comp. scores in R
Hello, I am trying to run a PCA in R and I cannot get the PC scores for each of the values. Using pcX <- princomp(X) then loadings(pcX) I can get a listing of the eigenvectors but not the actual PC scores for each value in the dataset. I greatly appreciate any help anyone can offer Thanks Ken
2009 Nov 26
1
R help with princomp and pam clustering
Hi all! I am working with R package cluster and I have a little problem: let's say I have two datasets...first one ("A") is divided into 4 clusters by means of Pam algorythm. Let's say I want to project the second database ("B") onto the Comp.1 X Comp.2 graph, and see where its elements are placed. The two datasets are made of different dim (54x19 and 28x19). I tried
2005 Apr 25
2
Pca loading plot lables
Dear colleagues, I a m a beginner with R and I would like to add labels (i.e. the variable names) on a pca loading plot to determine the most relevant variables. Could you please tell me the way to do this kind of stuff. The command I use to draw the pca loading plot is the following : Plot(molprop.pc$loading[,1] ~ molprop.pc$loading[,2]) Thanks for your help Fred Ooms
2005 May 05
3
body of non-visible function
Hello, Is there any possibility in R to see the body of the non-visible function, for example princomp? If I do : > methods(princomp) so, I get that princomp.default and princomp.formula are non-visible functions and body(princomp.default) doesnt show it. In particular, I guess I have a very nave question Id like to see how scores calculation is implemented in the function princomp.
2009 Jan 14
1
Adressing list-elements
Dear all, I'm using R 2.8.1 under Vista. I programmed a Simulation with the code enclosed at the end of the eMail. After the simulation I want to analyse the columns of the single simulation-runs, i.e. e.g. Simulation[[1]][,1] sth. like that but I cannot address these columns... Can anybody please help? Best, Thomas ############################ CODE ############################
2003 Sep 10
2
Need your help-SOS
Hello, I am a newbie in R project and trying to call prcomp(x) of R function using (D)COM server communicate with R in ASP, and encountering the error "Runtime error -2147221493(8004000b). Automation Error, Object is static, operation not allowed." Source code is shown as below: <% Set StatConn=Server.CreateObject("StatConnectorSrv.StatConnector")
2006 Jul 31
1
How does biplot.princomp scale its axes?
I'm attempting to modify how biplot draws its red vectors (among other things). This is how I've started: Biplot <- function(xx, comps = c(1, 2), cex = c(.6, .4)) { ## Purpose: Makes a biplot with princomp() object to not show arrows ## ---------------------------------------------------------------------- ## Arguments: xx is an object made using princomp() ##
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
2007 Feb 13
1
Questions about results from PCAproj for robust principal component analysis
Hi. I have been looking at the PCAproj function in package pcaPP (R 2.4.1) for robust principal components, and I'm trying to interpret the results. I started with a data matrix of dimensions RxC (R is the number of rows / observations, C the number of columns / variables). PCAproj returns a list of class princomp, similar to the output of the function princomp. In a case where I can
2005 Sep 16
1
About princomp
Hi, I run the example for princomp for R211 I got the following error for biplot > ## The variances of the variables in the > ## USArrests data vary by orders of magnitude, so scaling is appropriate > (pc.cr <http://pc.cr> <- princomp(USArrests)) # inappropriate Erreur dans cov.wt(z) : 'x' must contain finite values only > princomp(USArrests, cor = TRUE) # =^=
2004 Sep 14
3
Signs of loadings from princomp on Windows
I start a clean session of R 1.9.1 on Windows and I run the following code: > library(MASS) > data(painters) > pca.painters <- princomp(painters[ ,1:4]) > loadings(pca.painters) Loadings: Comp.1 Comp.2 Comp.3 Comp.4 Composition 0.484 -0.376 0.784 -0.101 Drawing 0.424 0.187 -0.280 -0.841 Colour -0.381 -0.845 -0.211 -0.310 Expression 0.664 -0.330 -0.513
2003 Aug 08
1
covmat argument in princomp() (PR#3682)
R version: 1.7.1 OS: Red Hat Linux 7.2 When "covmat" is supplied in princomp(), the output value "center" is all NA's, even though the input matrix was indeed centered. I haven't read anything about this in the help file for princomp(). See code below for an example: pc2$center is all NA's. Jerome Asselin x <- rnorm(6) y <- rnorm(6) X <- cbind(x,y)
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 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