similar to: Input correlation matrix directly to princomp, prcomp

Displaying 20 results from an estimated 3000 matches similar to: "Input correlation matrix directly to princomp, prcomp"

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
1999 Sep 09
1
princomp
Peter, As I understand your Q. You probably have data that is similar to each other like stock Prices for all RHS variable. In that case the difference between corr and cov is not significant; however, if your RHS contains totally dissimilar variables it matters a great deal. If x1 income, x2 job type, x3 Education level, etc..., then taking cov of these variables would not be desireable
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
2000 Oct 03
3
prcomp compared to SPAD
Hi ! I've used the example given in the documentation for the prcomp function both in R and SPAD to compare the results obtained. Surprisingly, I do not obtain the same results for the coordinates of the principal composantes with these two softwares. using USArrests data I obtain with R : > summary(prcomp(USArrests)) Importance of components: PC1 PC2
2003 Jul 15
2
"na.action" parameter in princomp() (PR#3481)
Full_Name: Jerome Asselin Version: 1.7.1 OS: Red Hat Linux 7.2 Submission from: (NULL) (24.77.125.119) Setting the parameter na.action=na.omit should remove incomplete records in princomp. However this does not seem to work as expected. See example below. Sincerely, Jerome Asselin data(USArrests) princomp(USArrests, cor = TRUE) #THIS WORKS USArrests[1,3] <- NA princomp(USArrests, cor =
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
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
2000 Jul 20
1
Installing R-1.1.0 (PR#612)
Dear R-developers, I finally got around to install R 1.1.0 but had problems at the `make check' stage. After compiling the released R 1.1.0 version the `make check' stage stopped while checking the examples in base. There was some problem with the quantile function and the check stopped complaining that NA's are not allowed. But I assume that this problem is already known because
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 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) # =^=
2012 Oct 19
1
factor score from PCA
Hi everyone, I am trying to get the factor score for each individual case from a principal component analysis, as I understand, both princomp() and prcomp() can not produce this factor score, the principal() in psych package has this option: scores=T, but after running the code, I could not figure out how to show the factor score results. Here is my code, could anyone give me some advice please?
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"
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)
2012 Jan 24
0
PCA for assets based household income analysis (" hetcor" and "princomp")
I am doing Principal Component Analysis (PCA) on assets data for household income prediction. The problem is that the assets data are rank ordered (usually binary ... possess car/don't possess car), so the normal correlation is inappropriate for the calculation of the PCA. Instead one has to use the polychoric correlation coefficient. It uses the "random.polychor.pa" package.
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:
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
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]
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
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: