Displaying 20 results from an estimated 311 matches for "princomp".
2005 May 05
3
body of non-visible function
Hello,
Is there any possibility in R to see the body of the non-visible
function, for
example princomp?
If I do :
> methods(princomp)
so, I get that princomp.default and princomp.formula are non-visible
functions and
body(princomp.default) doesnt show it.
In particular, I guess I have a very nave question
Id like to see how scores calculation is implemented in the function
princomp. Because...
2009 Jan 14
1
Adressing list-elements
...######### CODE ############################
analyse<-read.csv2("C:\\Users\\Thomas\\Desktop\\PCA_Kohle_2007.csv",sep=";")
rownames(analyse)<-analyse[,1]
analyse<-analyse[,-1]
require(tseries)
require(fSeries)
st_rendite<-apply(apply(analyse,2,log),2,diff)*100
pca<-princomp(st_rendite)
summary(pca)
summary(pca)$loadings
screeplot(pca,type="l",main="Screeplot der Prinzipalkomponenten")
loadings_pca1<--summary(pca)$loadings[1:6]
loadings_pca2<--summary(pca)$loadings[7:12]
loadings_pca3<--summary(pca)$loadings[13:18]
loadings_pca4<--summ...
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...
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
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 = TRUE, na.action=na.omit) #THIS FAILS!
#Error in cov.wt(z) : x must contain finite values on...
2000 Sep 29
2
non-ideal behavior in princomp/ not a feature but a bug
... I checked and Brian and I are both right (see bottom for prior mail
exchange).
Let me explain:
=============================================================
1. Indeed, in principle, princomp allows data matrices with are wider than
high.
Example:
> x1
[,1] [,2] [,3] [,4]
[1,] 1 1 2 2
[2,] 1 1 2 2
> princomp(x1)
Call:
princomp(x = x1)
Standard deviations:
Comp.1 Comp.2 Comp.3 Comp.4
0 0 0 0
4 variables and 2 observations.
So...
2000 Sep 29
2
non-ideal behavior in princomp/ not a feature but a bug
... I checked and Brian and I are both right (see bottom for prior mail
exchange).
Let me explain:
=============================================================
1. Indeed, in principle, princomp allows data matrices with are wider than
high.
Example:
> x1
[,1] [,2] [,3] [,4]
[1,] 1 1 2 2
[2,] 1 1 2 2
> princomp(x1)
Call:
princomp(x = x1)
Standard deviations:
Comp.1 Comp.2 Comp.3 Comp.4
0 0 0 0
4 variables and 2 observations.
So...
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 <-...
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()
## ----------------------------------------------------------------------
scores <- xx$scores[, paste("Comp", comps, sep = &qu...
2012 Feb 29
2
Principal Component Analysis
Dear R buddies,
I’m trying to run Principal Component Analysis, package
princomp: http://stat.ethz.ch/R-manual/R-patched/library/stats/html/princomp.html.
My question is: why do I get different results with pca =
princomp (x, cor = TRUE) and pca = princomp (x, cor = FALSE) even when I
standardize variables in my matrix?
Best regards,
Blaž Simčič
[[alternative HTML version del...
2000 Sep 28
1
non-ideal behavior in princomp
This problem is not limited to R, but R is one of the packages in which it
arises.
princomp is a nice function which creates an object for which inspection
methods have been written.
Unfortunately, princomp does not admit cases in which the x matrix is wider
than high (i. e. more variables than observations). Such cases are typical
in spectroscopy and related disciplines. It would be nic...
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)
&g...
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 r...
1999 Oct 07
1
[Fwd: Libraries loading, but not really?] - it really IS a problem :-(
...Classical (Metric) Multidimensional Scaling
> dist Distance Matrix Computation
> hclust Hierarchical Clustering
> kmeans K-Means Clustering
> prcomp Principal Components Analysis
> > (pc.cr<-princomp(USArrests))
> Error: couldn't find function "princomp"
> >
>
> I should say that ?princomp works beautifully, but the function itself
> is absent.
> I imagine I have done something stupid in installation?
>
> thanks,
I accidently left off the fact that wha...
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 H...
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 R-mode PCA
>use prcomp.
>
It doesn't appear that anyone dis...
2013 Mar 20
2
Dealing with missing values in princomp (package "psych")
Hello!
I am running principle components analysis using princomp function in
pacakge psych.
mypc <- princomp(mydataforpc, cor=TRUE)
Question: I'd like to use pairwise deletion of missing cases when
correlations are calculated. I.e., I'd like to have a correlation between
any 2 variables to be based on all cases that have valid values on both
variabl...
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 f...
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...
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...