Displaying 20 results from an estimated 800 matches similar to: "vector length help using prcomp"
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
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)
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
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 svd(x, nu = 0) : infinite or missing values in 'x'
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
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 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. one
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
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:
2002 Oct 29
0
patch to mva:prcomp to use La.svd instead of svd (PR#2227)
Per the discussion about the problems with prcomp() when n << p, which
boils down to a problem with svd() when n << p,
here is a patch to prcomp() which substitutes La.svd() instead of svd().
-Greg
(This is really a feature enhancement, but submitted to R-bugs to make sure
it doesn't get lost. )
*** R-1.6.0/src/library/mva/R/prcomp.R Mon Aug 13 17:41:50 2001
---
1998 Apr 02
2
prcomp
I've noticed that the arguments and result list of prcomp in the mva package
(with 61.1) are not quite the same as in the Blue Book and in Splus. Is this
intentional or can I change it? If I change it who should I send the code to?
Paul Gilbert
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read
2006 May 17
2
prcomp: problem with zeros? (PR#8870)
Full_Name: Juha Heljoranta
Version: R 2.1.1 (2005-06-20)
OS: Gentoo Linux
Submission from: (NULL) (88.112.29.250)
prcomp has a bug which causes following error
Error in svd(x, nu = 0) : infinite or missing values in 'x'
on a valid data set (no Infs, no missing values). The error is most likely
caused by the zeros in data.
My code and temporary workaround:
m = matrix(...
...
2013 Mar 14
2
Same eigenvalues but different eigenvectors using 'prcomp' and 'principal' commands
Dear all,
I've used the 'prcomp' command to
calculate the eigenvalues and eigenvectors of a matrix(gg).
Using the command 'principal' from the
'psych' packageĀ I've performed the same exercise. I got the same
eigenvalues but different eigenvectors. Is there any reason for that
difference?
Below are the steps I've followed:
1. PRCOMP
#defining the matrix
2004 Mar 04
1
prcomp: error code 1 from Lapack routine dgesdd
Dear all
I have a big matrix of standardized values (dimensions 285x5829) and R
fails to calculate
the principal components using prcomp() with the following error message:
pc <- prcomp(my.matrix)
Error in La.svd(x, nu, nv, method) : error code 1 from Lapack routine
dgesdd
Is the matrix too big? I'm using R-1.8.1 under Unix (Solaris8) and
Linux(Suse 8.2). I tried to
perform a principal
2012 Nov 16
1
tol in prcomp
Hi there,
I was wondering if anyone could explain how you should set tol in the prcomp
function.
Using help(prcomp) explains it as "a value indicating the magnitude below
which components should be omitted. (Components are omitted if their
standard deviations are less than or equal to tol times the standard
deviation of the first component.) With the default null setting, no
components
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) <-
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
2011 Aug 14
1
PCA Using prcomp()
Hey guys,
I am new to R and apologize for the basic question - I do not mean to
offend.
I have been using R to perform PCA on a set several hundred objects using a
set of 30 descriptors. From the results generated by prcomp(), is there a
way to print a matrix showing the contributions of the original variables to
each PC? My hope is to identify which of the original 30 variables are the
most
2004 Mar 17
0
mva :: prcomp
Dear R-list users,
I'm new to principal components and factor analysis.
I thought this method can be very useful for me to find relationships
between several variables (which I know there is, only don't know which
variables exactly and what kind of relation), so as a structure
detection method.
Now, I'm experimenting with the function prcomp from the mva package.
In my source code
2012 Jun 21
0
prcomp
Hi,
If center=T (by default) in invoking prcomp, that is, prcomp (x) where x is a matrix with the observations are in rows and the variables are in column, is this equivalent to scale(t(x),center=T,scale=F)?where?x is a matrix with?the observations are in rows and the variables are in columns?
Additionally, could you advise when the variables should mean centered (center = T in prcomp) before the