Displaying 20 results from an estimated 10000 matches similar to: "lda() called with data=subset() command"
2010 Aug 15
2
adding a built-in drop.levels option for subset() in 2.12 ?
With the approach of R 2.12.0:
with mild apologies for re-opening this perennial issue:
is there any hope, if appropriate patches are submitted, of adding a
drop.levels argument (with default equal to FALSE to preserve backward
compatibility/efficiency) to the subset function ... ?
If not, would a patch to the documentation and/or the R FAQ be accepted?
This does seem to be a continuing
2004 Mar 01
1
pca scores for newdata
Hi
I used princomp on a dataset x[!sub,]. How can I get the scores for
another dataset, say x[sub,]? I didn't succeed using predict()
thanks for a hint
cheers
christoph
--
Christoph Lehmann <christoph.lehmann at gmx.ch>
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 Jul 08
2
extract prop. of. var in pca
Dear R-helpers,
Using the package Lattice, I performed a PCA.
For example
pca.summary <- summary(pc.cr <- princomp(USArrests, cor = TRUE))
The Output of "pca.summary" looks as follows:
Importance of components:
Comp.1 Comp.2 Comp.3 Comp.4
Standard deviation 1.5748783 0.9948694 0.5971291 0.41644938
Proportion of Variance 0.6200604
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
2003 Jun 03
3
lda: how to get the eigenvalues
Dear R-users
How can I get the eigenvalues out of an lda analysis?
thanks a lot
christoph
--
Christoph Lehmann <christoph.lehmann at gmx.ch>
2011 Apr 21
1
Rearranging PCA results from R
Hi!!
I'm having trouble selecting 10 out of 41 attributes of the KDD data set. In
order to identify the components with the higher variance I'm using
princomp. the result i get for summary(pca1) is:
Comp.1 Comp.2 Comp.3
Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
Comp.9
2004 Jul 14
2
PCA in R
Hello,
I'm attempting to run a PCA on an example data set. I ran it
just fine, but I don't know how to few the output? I listed what the
variable got stored in it, but I don't know how I can get anything else out
of it. Are there other ways to view the results?
Also, I'm confused about the last line "6 variables and 8 observations"
Aren't the rows the
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 how I
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
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
2009 Apr 26
1
help with plotting results of lda
Hi,
I've performed an lda and obtained a classification table for some of my
data:
> efa.dfa<-lda(groups~.,efa.scores.8,CV=T)
> str(efa.dfa)
List of 5
$ class : Factor w/ 2 levels "1","2": 1 2 1 2 1 1 2 2 1 2 ...
$ posterior: num [1:160, 1:2] 0.99083 0.00852 0.93983 0.23186 0.85931 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : chr [1:160]
2005 Nov 17
1
Principal Components Analysis (PR#8320)
Full_Name: Sahotra Sarkar
Version: 2.2.0
OS: Windows XP Professional
Submission from: (NULL) (146.6.130.180)
The following two commands should give the same results for the eigenvectors but
do not (there is a sign reversal for the first one):
> summary(princomp(bumpus),loading = TRUE)
Importance of components:
Comp.1 Comp.2 Comp.3 Comp.4 Comp.5
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
2004 Nov 24
2
LDA with previous PCA for dimensionality reduction
Dear all, not really a R question but:
If I want to check for the classification accuracy of a LDA with
previous PCA for dimensionality reduction by means of the LOOCV method:
Is it ok to do the PCA on the WHOLE dataset ONCE and then run the LDA
with the CV option set to TRUE (runs LOOCV)
-- OR--
do I need
- to compute for each 'test-bag' (the n-1 observations) a PCA
2011 Dec 21
1
Reg : Using RJDBC to read UTF-8 characterrs
Hi All,
We are using the following dataset which contains UTF-8 characters and is
stored in a MySQL database. When we use
RODBC and read the data, the characters are read correctly.But when we read
using RJDBC ,the characters are read like ???????????????????????????1
Can you please let me know how we can read the UTF-8 characters as it is
done by RODBC.
ID code Outlook Temperature Humidity
2008 Aug 01
4
Plotting ordered nominal data
Hi
I'm sure this question has been asked before but I can't find it in the
archives.
I have a data frame which includes interval and ordered nominal results.
It looks something like
"Measured" "Eyeball"
46.5 Normal
43.5 Mild
56.2 Normal
41.1 Mild
37.8 Moderate
12.6 Severe
17.3 Moderate
39.1 Normal
26.7 Mild
NULL Normal
27.9 NULL
68.1
2002 Apr 10
4
Principal Component analysis question
I have a question about princomp(mva) that I hope isn't too newbie.
I used the sample data from Table 1.1 in "Manly (1986/1994) Multivariate
Statistical Methods: a primer. Chapman and Hall" on sparrow body
measurements.
I rescaled the data to mean 0 and SD 1, and the covariance matrix is:
V1 V2 V3 V4 V5
V1 1.0000000 0.7349642 0.6618119
2008 Jan 02
3
Find missing days
Hi,
I have a data.frame like this:
y <- rnorm(60)
lev <- gl(3,20, labels=paste("lev", 1:3, sep=""))
date1 <- as.Date(seq(ISOdate(2007,9,1), ISOdate(2007,11,5),
by=60*60*24))
date1 <- date1[-c(3,4,15,34,38,40)]
df <- data.frame(lev=lev, date1=date1, y=y)
I would like to produce a new data.frame with missing days in df$date1
in each df$lev, like this:
lev
2012 Sep 09
1
PCA legend outside of PCA plot
Hi All,
I have been trying to get to plot my PCA legend outside of the PCA plot,
but success still alludes me.
Can you guys please advise how I can achieve this. I used locater() to
obtain coordinates for below the Comp.1 axis. Using these coordinates the
legend disappears.
Below is the code for the PCA and legend.
Thanks in advance for the help.
Regards
Tinus
r.cols <-