Re: [R] PCA with random effects

2018-04-02 Thread Bert Gunter
This is a statistical question, which is typically off topic here. This list is primarily concerned with R programming questions, although the two areas sometimes do intersect. I suggest you post on a statistical list such as stats.stackexchange.com instead, especially if you do not get a useful re

Re: [R] PCA in Q- and R-modes

2017-01-18 Thread Bert Gunter
Off topic for this list. Post on stats.stackexchange.com or similar for statistics questions. Post on Bioconductor list for biology-related (e.g. proteomics) data anaysis questions. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking th

Re: [R] PCA on SNP genotypes

2016-03-03 Thread Andrés Aragón Martínez
Mohsen, Check at Bioconductor. Andrés > El 03/03/2016, a las 9:43, Mohsen Jafarikia escribió: > > Hello everyone: > > I have about a couple of thousands of samples each with about 100 SNP > genotypes and I would like to do PCA using genotypes. I looked on the > web and found different option

Re: [R] PCA plot of variable names only

2015-11-30 Thread debra ragland via R-help
Of Boris Steipe Sent: Monday, November 30, 2015 9:01 AM To: debra ragland Cc: r-help Subject: Re: [R] PCA plot of variable names only Please keep communications on list. This is too confused to continue productively. See here: http://adv-r.had.co.nz/Reproducibility.html http://stackover

Re: [R] PCA plot of variable names only

2015-11-30 Thread David L Carlson
77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Boris Steipe Sent: Monday, November 30, 2015 9:01 AM To: debra ragland Cc: r-help Subject: Re: [R] PCA plot of variable names only Please keep communications on list. This is too confused to c

Re: [R] PCA plot of variable names only

2015-11-30 Thread Boris Steipe
Please keep communications on list. This is too confused to continue productively. See here: http://adv-r.had.co.nz/Reproducibility.html http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example ... and please read the posting guide and don't post in HTML. On Nov 3

Re: [R] PCA plot of variable names only

2015-11-30 Thread S Ellison
> Any idea on how to generate such a plot based on this description? One simple way of suppressing the individual points in biplot() is to give the labels a colour of 0. Adapting the biplot.princomp example: biplot(princomp(USArrests), col=c(0,1)) But that retains the point plot axes. If

Re: [R] PCA plot of variable names only

2015-11-30 Thread Boris Steipe
Your description is obscure but the following may get you started. The function prcomp() returns a list in which the matrix x contains the rotated values of your input. Assuming that your "variable names" are the rownames of your input, you can plot them with text(). Something like (untested)

Re: [R] PCA analysis and bootstraped loadings

2015-04-14 Thread Efstathia Defteraiou
Dear All, Thank You for the quick responses. Managed to solve my problem through: http://www.faculty.biol.ttu.edu/strauss/multivar/R/SamplePCABootstrap.R.txt or http://r.789695.n4.nabble.com/bootstrapped-eigenvector-method-following-prcomp-td877655.html Used the first one however, code is too long

Re: [R] PCA analysis and bootstraped loadings

2015-04-13 Thread William Revelle
psych does not currently have bootstrapped confidence intervals for loadings. That is a reasonable request and I will try to add it, perhaps in the “real soon now” version of 1.5.4 (almost finished), perhaps in the next release, Bill > On Apr 13, 2015, at 2:38 PM, stephen sefick wrote: > > H

Re: [R] PCA analysis and bootstraped loadings

2015-04-13 Thread stephen sefick
Hi, Please search the mailing list archives for this, or type bootstrapped PCA R into google. Please provide a minimal self-contained example of what you are trying to solve. Please read the posting guide that is referenced at the end of every email. kind regards, Stephen On Mon, Apr 13, 2015 at

Re: [R] PCA bibplot

2015-01-18 Thread Rich Shepard
On Sun, 18 Jan 2015, Jackson Rodrigues wrote: I have a matrix with 72 plant species, however most of them are irrelevant or not very important. When they are displayed together my plot is cluttered.So I want to constrain my biplot showing only species A B C D. How can I write the right code? J

Re: [R] PCA on stacked raster (multiple bands/ layers) in R

2014-10-30 Thread Gustavo Bediaga
Hi, You have to transform it to a Data Frame. Try: files <- stack(rasterlist) filesdf<-as.data.frame(files) pca <- princomp(formula = ~., data = filesdf, cor = TRUE, na.action=na.exclude) hope it helps Gustavo Em quinta-feira, 30 de outubro de 2014 14h38min56s UTC-2, John Wasige escreveu

Re: [R] PCA with a lot of zeros

2014-07-08 Thread Martyn Byng
riginal Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Silverton Sent: 08 July 2014 17:30 To: r-help@r-project.org Subject: Re: [R] PCA with a lot of zeros Hello all, I was wondering if R has some routine that can handle PCA with a lot of

Re: [R] PCA with a lot of zeros

2014-07-08 Thread Jim Silverton
Hello all, I was wondering if R has some routine that can handle PCA with a lot of zeros. I have fourteen variables - these variables represent angles...so there are some negative and some positive angles. Histograms appear sparse - in the sense that there are gaps. Any ideas or papers would be gre

Re: [R] PCA factominer package, question about changing labels in individuals factor map

2014-01-21 Thread Andy.P
That worked! Wow easy fix, i feel dumb! Thanks! -- View this message in context: http://r.789695.n4.nabble.com/PCA-factominer-package-question-about-changing-labels-in-individuals-factor-map-tp4683924p4683941.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] PCA factominer package, question about changing labels in individuals factor map

2014-01-21 Thread David Carlson
Try rownames(dat) <- dat[,1] before running PCA. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of

Re: [R] PCA

2013-09-22 Thread Vojtěch Zeisek
Hi, see tutorial for Adegenet, http://adegenet.r-forge.r-project.org/ | Documents | adegenet-basics.pdf | section 6. It should help You. Vojtěch - Vojtěch Zeisek Department of Botany, Faculty of Science, Charles Uni., Prague, CZ Institute of Botany, Academy of Science, Czech Republic Commun

Re: [R] PCA and gglot2

2013-07-11 Thread John Kane
ingston ON Canada > -Original Message- > From: a...@walla.co.il > Sent: Wed, 10 Jul 2013 12:49:55 -0700 (PDT) > To: r-help@r-project.org > Subject: Re: [R] PCA and gglot2 > > Dear John, > > Thanks for the help. > > I did some minor modifications to your

Re: [R] PCA and gglot2

2013-07-10 Thread ashz
Hi, Thanks to ssefick for the ggbiplot tip. It works fine so I submit a general script thats works for future users. library(ggbiplot) data<-read.csv("C:/…/MyPCA.csv") data1<-data[,1:4] my.pca <- prcomp(data1, scale. = TRUE) my.class<- data$Group g <- ggbiplot(my.pca, obs.scale = 1, var.scal

Re: [R] PCA and gglot2

2013-07-10 Thread ashz
Dear John, Thanks for the help. I did some minor modifications to your script as I had some problems: ... pca = PCA(data[,1:4], scale.unit=T, graph=F) dat1 <- data.frame(pca$scores) # creates the data.frame dat1$items <- rownames(data$group) # adds item names ggplot(dat1, aes(pca$ind$coord[

Re: [R] PCA and gglot2

2013-07-10 Thread stephen sefick
Fig 4 but there the author is using geom_segment to add the lines but I > have not looked at it all that carefully. > > > > > > John Kane > Kingston ON Canada > > > > -Original Message- > > From: a...@walla.co.il > > Sent: Wed, 10 Jul 2013 11:02

Re: [R] PCA and gglot2

2013-07-10 Thread stephen sefick
Fig 4 but there the author is using geom_segment to add the lines but I > have not looked at it all that carefully. > > > > > > John Kane > Kingston ON Canada > > > > -Original Message- > > From: a...@walla.co.il > > Sent: Wed, 10 Jul 2013 11:02

Re: [R] PCA and gglot2

2013-07-10 Thread John Kane
N Canada > -Original Message- > From: a...@walla.co.il > Sent: Wed, 10 Jul 2013 11:02:11 -0700 (PDT) > To: r-help@r-project.org > Subject: Re: [R] PCA and gglot2 > > Hi, > > Thanks. Fig 4 in the link you provided is what I am looking for. > > I still do no

Re: [R] PCA and gglot2

2013-07-10 Thread ashz
Hi, Thanks. Fig 4 in the link you provided is what I am looking for. I still do not know how to implement my data1 and pca1 in the script you provided as I think it is only a part of a full script. " data1<-read.csv("C:/…/MyPCA.csv") pca1 <- princomp(data1[,1:4], score=TRUE, cor=TRUE) " Am I ri

Re: [R] PCA and gglot2

2013-07-10 Thread S Ellison
> > The biplot present the data points as numbers. How can I > present the > > data point in color (depends on their group-column 5). I > was thinking > > about doing it using ggplot2 but I can not succeed. Any > idea how to do > > it? Perhaps the post at http://www.codesofmylife.com/2012/06

Re: [R] PCA and gglot2

2013-07-10 Thread John Kane
It looks like you can if I understand properly. Try this dat1 <- data.frame(dat1$scores) dat1$items <- rownames(data1) ggplot(dat1, aes(Comp.1, Comp.2, colour = items)) + geom_point() + theme(legend.position="none") John Kane Kingston ON Canada > -Original Message- > From: a...@w

Re: [R] PCA with spearman and kendall correlations

2013-02-28 Thread David L Carlson
Spearman would be easier since you just convert the data to ranks and use the Pearson correlation: > set.seed(42) > x <- data.frame(matrix(sample(1:9, 20, replace=TRUE), 10, 2)) > x X1 X2 1 9 5 2 9 7 3 3 9 4 8 3 5 6 5 6 5 9 7 7 9 8 2 2 9 6 5 10 7 6 > cor(x)

Re: [R] PCA legend outside of PCA plot

2012-09-09 Thread David L Carlson
Try adding the parameter xpd=TRUE to your legend() statement. Without reproducible code it is pretty hard to be sure what the problem is. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 >

Re: [R] PCA

2012-07-18 Thread Yasir Kaheil
in biplot you could set the limits xlim, ylim of the axes to zoom in on the plot. - Yasir Kaheil -- View this message in context: http://r.789695.n4.nabble.com/PCA-tp4636840p4636961.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] pca biplot.princomp has a bug?

2012-04-25 Thread Kevin Wright
The arrows are not pointing in the most-varying direction of the data. The principal components are pointing in the most-varying direction of the data. But you are not plotting the data on the original scale, you are plotting the data on the rotated scale, and thus the horizontal axis is the most

Re: [R] PCA sensitive to outliers?

2012-04-23 Thread Martin Maechler
> "SL" == Steve Lianoglou > on Mon, 23 Apr 2012 01:10:31 -0400 writes: SL> On Mon, Apr 23, 2012 at 12:01 AM, Michael SL> wrote: >> yes, but that is not a good Review or Survey... thx SL> But the packages listed there do have their own SL> documentation and vignet

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Steve Lianoglou
On Mon, Apr 23, 2012 at 12:01 AM, Michael wrote: > yes, but that is not a good Review or Survey... thx But the packages listed there do have their own documentation and vignettes. For instance the rrcov package seems to have a nice vignette about its design as well as methods it implements, and r

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Michael
yes, but that is not a good Review or Survey... thx On Sun, Apr 22, 2012 at 9:47 PM, Bert Gunter wrote: > As I believe I already told you, look at the CRAN Robust task view. > > -- Bert > > On Sun, Apr 22, 2012 at 6:29 PM, Michael wrote: > > Even in R, there are so many of "robust PCA"... any s

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Bert Gunter
As I believe I already told you, look at the CRAN Robust task view. -- Bert On Sun, Apr 22, 2012 at 6:29 PM, Michael wrote: > Even in R, there are so many of "robust PCA"... any survey or review of all > these different methods? > > On Sun, Apr 22, 2012 at 6:58 PM, Joshua Wiley wrote: > >> On Su

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Michael
Even in R, there are so many of "robust PCA"... any survey or review of all these different methods? On Sun, Apr 22, 2012 at 6:58 PM, Joshua Wiley wrote: > On Sun, Apr 22, 2012 at 4:43 PM, Michael wrote: > > I actually tried "robustPca" in "pcaMethods" on bioconductor. > > > > It keeps giving me

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Joshua Wiley
On Sun, Apr 22, 2012 at 4:43 PM, Michael wrote: > I actually tried "robustPca" in "pcaMethods" on bioconductor. > > It keeps giving me the warning "Input data is not complete"... > > Reading into the function: > > When there is no "NA"s, it will give this warning... > > It seems that there is a bu

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Michael
Any thoughts on this error in robustSVD? Thanks a lot! Error in if (!all(tmp)) { : missing value where TRUE/FALSE needed Enter a frame number, or 0 to exit 1: #73: pca(dTmp, method = "robustPca", nPcs = nNumFactors, center = FALSE) 2: robustPca(prepres$data, nPcs = nPcs, ...) 3: robustSvd(Mat

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Michael
I actually tried "robustPca" in "pcaMethods" on bioconductor. It keeps giving me the warning "Input data is not complete"... Reading into the function: When there is no "NA"s, it will give this warning... It seems that there is a bug in this code... Is it reliable at all?

Re: [R] PCA sensitive to outliers?

2012-04-20 Thread Kevin Wright
You can also have a look at the pcaMethods package on Bioconductor. Kevin On Thu, Apr 19, 2012 at 11:20 PM, Michael wrote: > Hi all, > > I found that the PCA gave chaotic results when there are big changes in a > few data points. > > Are there "improved" versions of PCA in R that can help with

Re: [R] PCA sensitive to outliers?

2012-04-19 Thread Bert Gunter
Michael: On Thu, Apr 19, 2012 at 9:20 PM, Michael wrote: > Hi all, > > I found that the PCA gave chaotic results when there are big changes in a > few data points. Yup. > > Are there "improved" versions of PCA in R that can help with this problem? Yup. Consult the "Robust" task view on CRAN. Yo

Re: [R] PCA Kernel

2012-03-12 Thread Jim Silverton
Hi, I have 6 variables and I want to do a PCA Kernel on the 6 variables. But I want the scores from the from the PCA kernel method. for each subject. Does anyone know how to do this? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-h

Re: [R] PCA in predefined Groups??

2012-03-10 Thread chuck.01
Without taking away all the fun of trial and error, and exploration in R... I will direct you to this website which I found invaluable when I first began to use R. one way would be to use: plot(Yourdata, type="n") and then 3 text() or points() statements to plot the groups represented by differen

Re: [R] PCA in r

2011-12-22 Thread Sarah Goslee
You'll get more useful answers if you tell us what you did, and provide a reproducible example. For instance, a bit of your data using dput(), your sessionInfo(), str() for your data, and the actual commands you're using to run PCA, as well as the error messages you're getting. The clearer you ar

Re: [R] PCA on high dimentional data

2011-12-10 Thread Bert Gunter
... and adding to what has already been said, PCA can be distorted by non-ellipsoidal distributions or small numbers of unusual values. Careful (chiefly graphical) examination of results is therefore essential, and usually fairly easy to do. There are robust/resistant versions of PCA in R, but they

Re: [R] PCA on high dimentional data

2011-12-10 Thread Mark Difford
On Dec 10, 2011 at 5:56pm deb wrote: > My question is, is there any way I can map the PC1, PC2, PC3 to the > original conditions, > so that i can still have a reference to original condition labels after > PCA? deb, To add to what Stephen has said. Best to do read up on principal component anal

Re: [R] PCA on high dimentional data

2011-12-10 Thread Stephen Sefick
By doing PCA you are trying to find a lower dimensional representation of the major variation structure in your data. You get PC* to represent the "new" data. If you want to know what loads on the axes then you need to look at the loadings. These are the link between the original data and th

Re: [R] PCA and Regression with complex categorical variables

2011-10-21 Thread David Winsemius
Did you perhaps send an HTML message? As detailed in the Posting Guide, those get scrubbed by the mail-server. On Oct 21, 2011, at 10:48 AM, seanstcl...@verizon.net wrote: -- David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing li

Re: [R] PCA Using prcomp()

2011-08-15 Thread S Ellison
> -Original Message- > christopher stratton > Sent: 14 August 2011 22:22 > Subject: [R] PCA Using prcomp() > > From the results > generated by prcomp(), is there a way to print a matrix > showing the contributions of the original variables to each > PC? Sounds like you're looking for

Re: [R] PCA - princomp can only be used with more units than variables

2011-07-20 Thread Joshua Wiley
Hi Armin, Please copy the list on your emails. Providing your matrix A (or some other reproducible example) would be useful to anyone who wanted to help you. It is easy to do by copying the output from your console from running: dput(A) This would at least let us try out your code on your data

Re: [R] PCA - princomp can only be used with more units than variables

2011-07-20 Thread Michael Dewey
At 03:56 20/07/2011, Joshua Wiley wrote: On Mon, Jul 18, 2011 at 10:48 AM, a.me...@yahoo.co.uk wrote: > Ok thank you Josh. > > Basically I have a matrix A with 7 rows and 18 columns. If i < j (where i is the number of rows in your matrix and j is the number of columns), then the determinant of

Re: [R] PCA - princomp can only be used with more units than variables

2011-07-19 Thread Joshua Wiley
On Mon, Jul 18, 2011 at 10:48 AM, a.me...@yahoo.co.uk wrote: > Ok thank you Josh. > > Basically I have a matrix A with 7 rows and 18 columns. If i < j (where i is the number of rows in your matrix and j is the number of columns), then the determinant of the covariance (or correlation) matrix |Sig

Re: [R] PCA - princomp can only be used with more units than variables

2011-07-18 Thread Joshua Wiley
Hi, You need to explain what you want to do. This is not a software issue, you simply cannot create more uncorrelated variables than you have observations. Josh On Mon, Jul 18, 2011 at 8:53 AM, a.me...@yahoo.co.uk wrote: > Hi, > > May I ask a question about a thread > https://stat.ethz.ch/pipe

Re: [R] PCA - scores

2011-03-05 Thread Uwe Ligges
On 04.03.2011 17:52, Shari Clare wrote: Hi Bill and Josh: When I run any "principal" code with scores=TRUE, I get the following Error: Error in principal (my.data,3,scores=TRUE) : unused argument (scores=TRUE) Thoughts? Your psych version (and probably also your R version) is outdated? Ple

Re: [R] PCA - scores

2011-03-04 Thread Shari Clare
Hi Bill and Josh: When I run any "principal" code with scores=TRUE, I get the following Error: Error in principal (my.data,3,scores=TRUE) : unused argument (scores=TRUE) Thoughts? Thanks, Shari On 3-Mar-11, at 9:42 PM, William Revelle wrote: > Shari, > Josh partly answered your ques

Re: [R] PCA - scores

2011-03-04 Thread William Revelle
At 9:52 AM -0700 3/4/11, Shari Clare wrote: Hi Bill and Josh: When I run any "principal" code with scores=TRUE, I get the following Error: Error in principal (my.data,3,scores=TRUE) : unused argument (scores=TRUE) Thoughts? What version of psych are you using? Does it work on the example I

Re: [R] PCA - scores

2011-03-03 Thread William Revelle
Shari, Josh partly answered your question, but his example did not include rotation because he took out just one factor. Try: require(psych) mt.pc <- principal(mtcars,3,scores=TRUE) #this gives you the varimax rotated first 3 principal components #pc.scores <- mt.pc$scores #here are

Re: [R] PCA - scores

2011-03-03 Thread Joshua Wiley
Hi Shari, Yes, please look at the documentation for principal. You can access this (assuming you have loaded psych) by typing at the console: ?principal note the logical argument "scores". Here is a small example: ## require(psych) require(GPArotation) dat <- prin

Re: [R] pca analysis: extract rotated scores?

2010-12-01 Thread Mark Difford
Hi He Zhang, >> Is the following right for extracting the scores? >> ... >> pca$loadings >> pca$score Yes. But you should be aware that the function principal() in package psych is standardizing your data internally, which you might not want. That is, the analysis is being based on the correla

Re: [R] pca analysis: extract rotated scores?

2010-12-01 Thread He Zhang
Hi, I am also doing PCA. Is the following right for extracting the scores? library(psych) pca<-principal(data,nfactors=,rotate="varimax",scores=T) pca$loadings pca$score Best regards, He On Tue, Nov 30, 2010 at 10:22 AM, Liviu Andronic wrote: > Dear all > I'm unable to find an example of extra

Re: [R] pca analysis: extract rotated scores?

2010-12-01 Thread Mark Difford
Hi Liviu, >> However, I'm still confused on how to compute the scores when rotations >> (such as 'varimax' or other methods in GPArotation) are applied. PCA does an orthogonal rotation of the coordinate system (axes) and further rotation is not usually done (in contrast to factor analysis). Nei

Re: [R] pca analysis: extract rotated scores?

2010-11-30 Thread Liviu Andronic
Take 2 on this. Below I'm pasting the code to perform PCA in R (without any rotation), manually; using ?princomp; and using ?principal. I also point out some differences in teh output and terminology of the two functions. In short, I found how to compute the scores of principal components when no r

Re: [R] PCA and Regression

2010-07-06 Thread Joris Meys
PCA components are orthogonal by definition so no, that doesn't make sense at all. Do yourself a favor and get a book on multivariate data analysis. Two books come to mind: Obviously the one of Hair and colleagues, called "multivariate data analysis" and easily found in a university library (or on

Re: [R] PCA scores

2010-04-16 Thread Gavin Simpson
On Fri, 2010-04-16 at 10:23 -0700, phoebe kong wrote: > Hi all, > > I have a difficulty to calculate the PCA scores. The PCA scores I calculated > doesn't match with the scores generated by R, > > mypca<-princomp(mymatrix, cor=T) > > myscore<-as.matrix(mymatrix)%*%as.matrix(mypca$loadings) > >

Re: [R] PCA - blank loadings

2010-03-18 Thread Uwe Ligges
On 17.03.2010 00:16, Xanthe Walker wrote: Hi, I have successfully completed a PCA and printed the loadings, however, numerous values are blank. I know that this means the values are just very small but not equal to zero. Is there a way to print out the loadings, including the very small value

Re: [R] PCA - blank loadings

2010-03-17 Thread S Ellison
Which principal component function are you using? Check the documentation for that and look for the part of the object that provides the PC's. Those are your loadings. >>> Xanthe Walker 16/03/2010 23:16:47 >>> Hi, I have successfully completed a PCA and printed the loadings, however, numerous v

Re: [R] PCA

2010-03-10 Thread Paul Johnson
On Wed, Mar 10, 2010 at 4:42 PM, Xanthe Walker wrote: > Hello, > > I am trying to complete a PCA on a set of standardized ring widths from 8 > different sites (T10, T9, T8, T7, T6, T5, T3, and T2). > The following is a small portion of my data: > > T10 T9 T8 T7 T6 T5 T3 T2 1.33738 0.92669 0.91146

Re: [R] pca in R

2010-01-30 Thread Ista Zahn
I've found the functions in the psych package easier to use than the built in functions for principal components analysis. -Ista On Sat, Jan 30, 2010 at 2:09 PM, ogbos okike wrote: > Hi, > I am learning how to do principal component analysis in R. However, since I > am family with only a few bui

Re: [R] PCA: Showing file datalabels on biplot

2010-01-25 Thread colin1
t$sample pca <- prcomp (t(catopsis)) plot(pca, catopsis []) summary(prcomp(catopsis)) biplot(prcomp(catopsis, scale = TRUE)) - Original Message - From: Kevin Wright-5 [via R] To: colin1 Sent: Monday, January 25, 2010 5:04 PM Subject: Re: [R] PCA: Showing file datalabels

Re: [R] PCA: Showing file datalabels on biplot

2010-01-25 Thread Kevin Wright
str(catopsis) shows no labels, so how can biplot know what to use? Try this before call prcomp: colnames(catopsis) <- c('a','b','c','d') rownames(catopsis) <- cat$sample Also, see the 'reshape' package for easier data manipulation. Kevin On Mon, Jan 25, 2010 at 10:39 AM, colin1 wrote: > > Th

Re: [R] PCA with tow response variables

2009-11-04 Thread Kevin Wright
After an off-list email exchange, it sounds like the pls package and Partial Least Squares are appropriate for this analysis. Kevin Wright 2009/11/4 Joel Fürstenberg-Hägg > > Hi all, > > > > I'm new to PCA in R, so this might be a basical thing, but I cannot find > anything on the net about it

Re: [R] PCA or CA

2009-09-30 Thread Bernardo Rangel Tura
On Tue, 2009-09-29 at 17:02 +, Paul Dennis wrote: > Dear all > > I have a data set for which PCA based between group analysis (BGA) gives > significant results but CA-BGA does not. > > I am having difficulty finding a reliable method for deciding which > ordination technique is most appropr

Re: [R] PCA or CA

2009-09-29 Thread Mark Difford
Hi Paul, >> I have a data set for which PCA based between group analysis (BGA) gives >> significant results but CA-BGA does not. >> I am having difficulty finding a reliable method for deciding which >> ordination >> technique is most appropriate. Reliability really comes down to you thinking

Re: [R] PCA and automatic determination of the number of components

2009-04-20 Thread Bruno Falissard
You can also use parallel analysis using the scree.plot function of the "psy" package. Regards, Bruno Bruno Falissard INSERM U669, PSIGIAM "Paris Sud Innovation Group in Adolescent Mental Health" Maison de Solenn 97 Bou

Re: [R] pca vs. pfa: dimension reduction

2009-03-27 Thread Michael Dewey
At 18:22 25/03/2009, Jonathan Baron wrote: On 03/25/09 19:06, soeren.vo...@eawag.ch wrote: > Can't make sense of calculated results and hope I'll find help here. > > I've collected answers from about 600 persons concerning three > variables. I hypothesise those three variables to be components (o

Re: [R] pca vs. pfa: dimension reduction

2009-03-25 Thread William Revelle
Dear Sören, Mark, and Jon, At 12:51 PM -0700 3/25/09, Mark Difford wrote: Hi Sören, (1) Is there an easy example, which explains the differences between pca and pfa? (2) Which R procedure should I use to get what I want? There are a number of fundamental differences between PCA and FA (Fa

Re: [R] pca vs. pfa: dimension reduction

2009-03-25 Thread Mark Difford
Hi Sören, >> (1) Is there an easy example, which explains the differences between >> pca and pfa? (2) Which R procedure should I use to get what I want? There are a number of fundamental differences between PCA and FA (Factor Analysis), which unfortunately are quite widely ignored. FA is expli

Re: [R] pca vs. pfa: dimension reduction

2009-03-25 Thread Jonathan Baron
On 03/25/09 19:06, soeren.vo...@eawag.ch wrote: > Can't make sense of calculated results and hope I'll find help here. > > I've collected answers from about 600 persons concerning three > variables. I hypothesise those three variables to be components (or > indicators) of one latent factor. In

Re: [R] PCA and categorical data

2009-03-06 Thread Hans Ekbrand
On Fri, Mar 06, 2009 at 09:46:17AM -, Ted Harding wrote: > On 06-Mar-09 09:25:26, Prof Brian Ripley wrote: > > You might want to look into correspondence analysis, which has several > > variants of PCA designed for categorical data. > > In particular, have a look at the results of > > RSit

Re: [R] PCA and categorical data

2009-03-06 Thread Mark Difford
Hi Galandis, dudi.mix() in package ade4 does PCA using categorical and/or quantitative variables. Ordered cats are replaced by poly(x, deg=2). Squares of categoricals can also be used. The method is a generalization by Chessel of the method of Hill and Smith. Regards, Mark. Galanidis Alexandro

Re: [R] PCA and categorical data

2009-03-06 Thread Ted Harding
On 06-Mar-09 09:25:26, Prof Brian Ripley wrote: > You might want to look into correspondence analysis, which has several > variants of PCA designed for categorical data. In particular, have a look at the results of RSiteSearch("correspondence") Ted. > On Fri, 6 Mar 2009, Galanidis Alexandros

Re: [R] PCA and categorical data

2009-03-06 Thread Prof Brian Ripley
You might want to look into correspondence analysis, which has several variants of PCA designed for categorical data. On Fri, 6 Mar 2009, Galanidis Alexandros wrote: Hi all, I' m trying to figure out if it is appropriate to do a PCA having only categorical data (not ordinal). I have only fin

Re: [R] PCA functions

2009-02-16 Thread S Ellison
Many apologies for the poor steer; you are quite right. 'fraid I hit 'send' before double-checking the help page myself. Next time... S >>> Gavin Simpson 16/02/2009 10:59 >>> On Mon, 2009-02-16 at 10:45 +, S Ellison wrote: > princomp uses the raw data and calculates the correlation or > co

Re: [R] PCA functions

2009-02-16 Thread Gavin Simpson
On Mon, 2009-02-16 at 10:45 +, S Ellison wrote: > princomp uses the raw data and calculates the correlation or > covariance matrix on the way to the PC's, so that doesn't use a > correlation matrix itself. You do, however, get the choice. That *isn't* what princomp() does. If you supply a vali

Re: [R] PCA functions

2009-02-16 Thread andrew
sqrt(svd(x)$d) maybe 2 more operations than princomp(covmat=x), but it is hardly a chore. On Feb 16, 9:15 pm, Mark Difford wrote: > Hi Glen, Andrew, > > >> The PCA is just a singular value decomposition on a sample covariance/... > > I believe that Bjørn-Helge Mevik's point was that __if you read

Re: [R] PCA functions

2009-02-16 Thread S Ellison
princomp uses the raw data and calculates the correlation or covariance matrix on the way to the PC's, so that doesn't use a correlation matrix itself. You do, however, get the choice. However, PC's are the eigenvectors of the correlation (or covariance) matrix, so in principle calling eigen()

Re: [R] PCA functions

2009-02-16 Thread Mark Difford
Hi Glen, Andrew, >> The PCA is just a singular value decomposition on a sample covariance/... I believe that Bjørn-Helge Mevik's point was that __if you read the documentation__ you will see the argument "covmat" to princomp(). This, really, is much more straightforward and practical than Andrew

Re: [R] PCA functions

2009-02-16 Thread andrew
The PCA is just a singular value decomposition on a sample covariance/ correlation matrix. Do a search for ?svd and get the eigenvalues and vectors from that function. On Feb 14, 10:30 am, "glenn" wrote: > Hi All, would appreciate an answer on this if you have a moment; > > Is there a function (

Re: [R] PCA functions

2009-02-16 Thread Bjørn-Helge Mevik
"glenn" writes: > Is there a function (before I try and write it !) that allows the input of a > covariance or correlation matrix to calculate PCA, rather than the actual > data as in princomp() Yes, there is: princomp(). :-) -- Bjørn-Helge Mevik _

Re: [R] PCA loadings differ vastly!

2009-01-14 Thread Greg Snow
PCA is only defined up to a multiplicative constant and different programs use different constants. Without code or output we cannot tell if this is the case, or if something more is going on. Try rescaling one of the answers to see if you can get the other answer, if so, then it is just a dif

Re: [R] PCA

2008-11-06 Thread Noela Sánchez
pletely trustworthy at this point, but SVD > would be worth looking into. > > Joe > > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Noela Sánchez > > Sent: Thursday, November 06, 2008 1:10 PM > > To:

Re: [R] PCA

2008-11-06 Thread Pedro Mardones
nal Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Noela Sánchez > Sent: Thursday, November 06, 2008 1:10 PM > To: stephen sefick > Cc: r-help@r-project.org > Subject: Re: [R] PCA > > My matrix have 436 registers and 518 variables. I need to do a

Re: [R] PCA

2008-11-06 Thread Lucke, Joseph F
elp@r-project.org Subject: Re: [R] PCA My matrix have 436 registers and 518 variables. I need to do a PCA analyst. Usually I use princomp command to perform PCA analyst, but this time i can't because of my variables are more than my registers. 2008/11/6 stephen sefick <[EMAIL PROTECTED]&

Re: [R] PCA

2008-11-06 Thread Noela Sánchez
My matrix have 436 registers and 518 variables. I need to do a PCA analyst. Usually I use princomp command to perform PCA analyst, but this time i can't because of my variables are more than my registers. 2008/11/6 stephen sefick <[EMAIL PROTECTED]> > would you please provide a dummy example tha

Re: [R] PCA

2008-11-06 Thread Jorge Ivan Velez
Hi Noela, Take a loot at ?prcomp HTH, Jorge On Thu, Nov 6, 2008 at 1:42 PM, Noela Sánchez <[EMAIL PROTECTED]> wrote: > I need perform PCA analyst with a matrix with more variables than units. > > The princomp command don't match with this matrix. > > Anybody knows a good command to do it? >

Re: [R] PCA

2008-11-06 Thread Prof Brian Ripley
?princomp refers you to prcomp for that case: '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 variables. For Q-mode PCA use 'p

Re: [R] PCA

2008-11-06 Thread stephen sefick
would you please provide a dummy example that explains your problem. Then maybe I can help you. thanks Stephen On Thu, Nov 6, 2008 at 1:42 PM, Noela Sánchez <[EMAIL PROTECTED]> wrote: > I need perform PCA analyst with a matrix with more variables than units. > > The princomp command don't match w

Re: [R] PCA

2008-10-23 Thread stephen sefick
reproducible code - are you assigning the results to an object On Thu, Oct 23, 2008 at 10:34 AM, Gianni Messeri <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to perform a Principal Component Analysis on meteorological data > with 10 predictors. > I use the library pcaMethods to obtain a lot of in

Re: [R] PCA and % variance explained

2008-09-10 Thread pgseye
Thanks everyone, Paul -- View this message in context: http://www.nabble.com/PCA-and---variance-explained-tp19388970p19410675.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

Re: [R] PCA and % variance explained

2008-09-10 Thread Gad Abraham
pgseye wrote: After doing a PCA using princomp, how do you view how much each component contributes to variance in the dataset. I'm still quite new to the theory of PCA - I have a little idea about eigenvectors and eigenvalues (these determine the variance explained?). Are the eigenvalues related

  1   2   >