Displaying 20 results from an estimated 7000 matches similar to: "convert princomp output to equation for plane?"
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
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) # =^=
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 Apr 25
1
pca biplot.princomp has a bug?
x=rmvnorm(2000, rep(0, 6), diag(c(5, rep(1,5))))
x=scale(x, center=T, scale=F)
pc <- princomp(x)
biplot(pc)
There are a bunch of red arrows plotted, what do they mean? I knew that the
first arrow labelled with "Var1" should be pointing the most varying
direction of the data-set (if we think them as 2000 data points, each being
a vector of size 6). I also read from
2002 Oct 03
2
Error in princomp?
Hello!
When using princomp() for principal components analysis, the resulting
loadings matrix differs between R and the output from other programs (S-plus
and SAS)
The difference is that the sign of some columns in the loadings matrix. The
absolute values, however, are the same.
This sign difference also exists when comparing the princomp() results with
the manually calculated eigen vectors using
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
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
2005 Nov 22
3
loadings matrices in plsr vs pcr in pls pacakage
Dear list,
I have a question concerning the above mentioned methods in the pls
package with respect to the loadings matrix produced by the call. In
some work I am doing I have found that the values produced are nearly of
the same magnitude but of opposite sign. When I use the example data
(sensory) I find this result reproduced. I am prepared to work this
through but I have a feeling that
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
2010 May 06
1
how to get components / factors in factanal / princomp not loadings
Dear all,
i wonder if there?s a command to obtain the actual values of a principal component or a factor (not as.factor, but factanal) .
test=princomp(USArrests, cor = TRUE)
summary(test)
just outputs, standard deviation, Prop of Variance and cumulative proportion of variance.
test$loadings offers yet another proportion of variance scheme. why is that?
Apart from that:
Is there a
2003 Dec 09
2
problem with pls(x, y, ..., ncomp = 16): Error in inherit s( x, "data.frame") : subscript out of bounds
I don't know the details of pls (in the pls.pcr package, I assume), but if
you use validation="CV", that says you want to use CV to select the best
number of components. Then why would you specify ncomp as well?
Andy
> From: ryszard.czerminski at pharma.novartis.com
>
> When I try to use ncomp parameter in pls procedure I get
> following error:
>
> >
2003 Apr 11
2
princomp with not non-negative definite correlation matrix
$ R --version
R 1.6.1 (2002-11-01).
So I would like to perform principal components analysis on a 16X16
correlation matrix, [princomp(cov.mat=x) where x is correlation matrix],
the problem is princomp complains that it is not non-negative definite.
I called eigen() on the correlation matrix and found that one of the
eigenvectors is close to zero & negative (-0.001832311). Is there any
way
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
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
2003 May 06
2
R vs SPSS output for princomp
Hi,
I am using R to do a principal components analysis for a class
which is generally using SPSS - so some of my question relates to
SPSS output (and this might not be the right place). I have
scoured the mailing list and the web but can't get a feel for this.
It is annoying because they will be marking to the SPSS output.
Basically I'm getting different values for the component
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 10
1
A simple question about PRINCOMP
Hi,
I just wonder if this is a rounding error by the princomp command in R.
Although this does not make much sense, using a hypothetical dataset, a,
a<-matrix(runif(1000),100,10)
I did PCA with the princomp, and compared it with the results estimated
with the eigen and the prcomp commands. And I found some differences in
the results: opposite signs in the loadings; slight differences in
2017 Jun 26
2
Odd behaviour in within.list() when deleting 2+ variables
The behaviour of within() with list input changes if you delete 2 or more variables, compared to deleting one:
l <- list(x=1, y=2, z=3)
within(l,
{
rm(z)
})
#$x
#[1] 1
#
#$y
#[1] 2
within(l, {
rm(y)
rm(z)
})
#$x
#[1] 1
#
#$y
#NULL
#
#$z
#NULL
When 2 or more variables are deleted, the list entries are instead set to NULL. Is this intended?
2008 Jul 10
2
princomp loading help
Dear all,
When I print out princomp's loading outputs, there is alwasy a section for "SS loading", "Proportional Var" and "Cumulative Var". Anybody can tell what they are for? Or anyone can direct me to some reference to read about?
Any help will be highly appricated.
Hongsheng
[[alternative HTML version deleted]]