Displaying 20 results from an estimated 5000 matches similar to: "Wishlist: Make screeplot() a generic (PR#9541)"
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) # =^=
2001 May 31
1
Screeplot
I'm trying to make a screeplot including the Cumulative Proportion of
the Variance, something that can easily be done in S-Plus with
'screeplot(pc.object,cumulative=T)'. How can I access the Proportion of
Variance in an princomp object and how could I get the Cumulative
Proportion of the Variance on the screeplot?
Many thanks in advance, Jan:-)
--
2001 Mar 29
1
screeplot() v.s. plot()
Hi,
Suppose I've got a data set that I found the eigenvalues and eigenvectors. Then I want to draw a screeplot for the eigenvalues. However it returns:
Error in matrix(w.m, nc = NC) : negative extents to matrix
Then I tried a plot() function on the eigenvalues of the data set, and I can successfully draw it! And the output looks like what the screeplot would show to me.
Is there any
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 errors, and also pointed out that I was
suggesting replacing some
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 ############################
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)
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"
2013 Mar 21
1
values for the scree plot (package psych)
Hello,
I am using function princomp from the package psych.
I have my principle component object mypc:
mypc <- princomp(covmat=mycor)
plot(mypc) # shows me a screeplot
Question: how could I actually see the values displayed in the screeplot. I
don't mean on the graph - I just want to know the actual value for each
component (e.g., 10, 3.2, 1.8, etc.)
I need to know how much variance,
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
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:
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
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
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
2010 Jun 15
1
Getting the eigenvectors for the dependent variables from principal components analysis
Dear listserv,
I am trying to perform a principal components analysis and create an output table of the eigenvalues for the dependent variables. What I want is to see which variables are driving each principal components axis, so I can make statements like, "PC1 mostly refers to seed size" or something like that.
For instance, if I try the example from ?prcomp
> prcomp(USArrests,
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
1999 Oct 07
1
[Fwd: Libraries loading, but not really?] - it really IS a problem :-(
kalish at psy.uwa.edu.au wrote:
>
> I'm a newbie at R, and can't get libraries to really work.
> I did this:
> > library(help = mva)
> cancor Canonical Correlations
> cmdscale Classical (Metric) Multidimensional Scaling
> dist Distance Matrix Computation
> hclust Hierarchical Clustering
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?
#
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:
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]