Displaying 20 results from an estimated 10000 matches similar to: "prcomp with previously scaled data: predict with 'newdata' wrong"
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
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
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"
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
2016 Mar 25
2
summary( prcomp(*, tol = .) ) -- and 'rank.'
> On 25 Mar 2016, at 10:41 am, peter dalgaard <pdalgd at gmail.com> wrote:
>
> As I see it, the display showing the first p << n PCs adding up to 100% of the variance is plainly wrong.
>
> I suspect it comes about via a mental short-circuit: If we try to control p using a tolerance, then that amounts to saying that the remaining PCs are effectively zero-variance, but
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] 20 5
2004 May 10
1
environmental data as vector in PCA plots
Hi,
I want to include a vector representing the sites - environmental data
correlation in a PCA.
I currently use prcomp (no scaling) to perform the PCA, and envfit to
retrieve the coordinates of the environmental data vector. However, the
vector length is different from the one obtained in CAnoco when performing
a species - environmental biplot (scaling -2). How can I scale the vector
in order to
2005 Apr 20
4
results from sammon()
Dear all,
I'm trying to get a two dimensional embedding of some data using different
meythods, among which princomp(), cmds(), sammon() and isoMDS(). I have a
problem with sammon() because the coordinates I get are all equal to NA.
What does it mean? Why the method fails in finding the coordinates? Can I do
anything to get some meaningful results?
Thank you very much
Domenico
2005 Jan 29
1
Bootstrapped eigenvector
Hello alls,
I found in the literature a technique that has been evaluated as one of the
more robust to assess statistically the significance of the loadings in a
PCA: bootstrapping the eigenvector (Jackson, Ecology 1993, 74: 2204-2214;
Peres-Neto and al. 2003. Ecology 84:2347-2363). However, I'm not able to
transform by myself the following steps into a R program, yet?
Can someone could help
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:
2004 Nov 04
2
biplot drawing conc ellipses
Is there an option to draw concentration ellipses in biplots ? It seems
really nice to summarize large number of points of each group.
Cheers../ Murli
2010 Apr 02
2
Biplot for PCA using labdsv package
Hi everyone,
I am doing PCA with labdsv package. I was trying to create a biplot graphs
in order to observe arrows related to my variables. However when I run the
script for this graph, the console just keep saying:
*Error in nrow(y) : element 1 is empty;
the part of the args list of 'dim' being evaluated was:
(x)*
could please someone tell me what this means? what i am doing
2003 Mar 27
5
Plot of Canonical Correlation Analysis
Dear all,
I didn't find any graphical solution in the package "mva" to plot the
canonical scores from a CCA (canonical correlation analysis).
Does anybody knows how to plot or has anybody already programmed :
- the map of the canonical scores,
- the graph of the canonical weights,
- the correlation circle i.e. the canonical loadings ?
Thank you for help ...
2008 Apr 20
1
Scaling in predict.prcomp
Hi,
Say x.train is a matrix of covariates that I want to do PCA on, so I can
do regression on its principal components, and x.test is a test set of
the same covariates on which I want to evaluate the regression fit. I
would like the covariates to be centred and scaled:
p <- prcomp(x.train, center=TRUE, scale=TRUE)
x.train.pc <- predict(p)
Now I want to get the PCs from the test set.
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
2004 Sep 30
3
biplot.princomp with loadings only
Hi
is there a way to plot only the loadings in a biplot (with the nice
arrows), and to skip the scores?
thanks
christoph
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)
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
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:
2016 Mar 24
3
summary( prcomp(*, tol = .) ) -- and 'rank.'
I agree with Kasper, this is a 'big' issue. Does your method of taking only
n PCs reduce the load on memory?
The new addition to the summary looks like a good idea, but Proportion of
Variance as you describe it may be confusing to new users. Am I correct in
saying Proportion of variance describes the amount of variance with respect
to the number of components the user chooses to show? So