[R] PCA biplot customising point shape and legend

2020-12-01 Thread PIKAL Petr
Dear all I am struggling to customise biplot from FactoMineR pacakge My code is almost correct but piece of information is missing Here is data temp <- structure(list(leukocyte28 = c(96875L, 73438L, 68229L, 94479L, 76563L, 141667L, 111042L, 9L, 132083L, 103542L, 61667L,

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

[R] PCA with random effects

2018-04-02 Thread David Sidhu
I have the results of a rating study in which ~30 participants rated a subset of 20 items on 25 different dimensions. I would like to perform PCA on these ratings to reduce the 25 different dimensions. However, instead of doing this on the mean ratings for each item, I would like to perform the

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

[R] PCA in Q- and R-modes

2017-01-18 Thread Josh Mitteldorf
I'm working with proteomic data, helping a student who knows biology and has done analysis in R without understanding it in depth. We have 3000 protein levels for 6 ages. I can treat this as 6 vectors in 3000-dimensional space, diagonalize a 6x6 covariance matrix and find 5 principal components,

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

[R] PCA on SNP genotypes

2016-03-03 Thread Mohsen Jafarikia
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 options available on R for PCA. I was wondering if I could have advice about the program fits better what I am trying

Re: [R] PCA plot of variable names only

2015-11-30 Thread debra ragland via R-help
] 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 continue productively. See here: http://adv-r.had.co.nz/Reproducibility.html http://stackov

Re: [R] PCA plot of variable names only

2015-11-30 Thread David L Carlson
-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 continue p

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

[R] PCA plot of variable names only

2015-11-30 Thread debra ragland via R-help
Hello,  A colleague of mine prepared a PCA plot of my data and I have no clue how he did it. My original data set contains 15 variables and 64 observations. I have been trying to figure out how he did it on my own, and I have asked but he's swamped so his response is taking longer than usual.

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

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 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

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

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

[R] PCA analysis and bootstraped loadings

2015-04-13 Thread Efstathia Defteraiou
Dear All, I am relatively new in R. Im working with the 'psych' package and 'principal' function. I would like to know how to generate the bootstraped conf.intervals for loadings, looking for sth similar to setting 'n.iter' argument for the 'fa' function. If in 'psych' can't work and suggest

[R] PCA bibplot

2015-01-18 Thread Jackson Rodrigues
Hi everybody, I am using vegan package. 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? I am

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?

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

2014-10-30 Thread John Wasige
Hello community, I need help on how I can perform PCA on stacked raster (multiple bands/ layers) in R. Does any body have an idea or script? Thanks John [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

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 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

Re: [R] PCA with a lot of zeros

2014-07-08 Thread Martyn Byng
- 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 zeros. I have

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

2014-01-21 Thread Andy.P
I am looking to do a PCA with the factominer package on a dataset of mine, named dat. The individuals in my dataset have character names, represented in the first column of my dataset, but since they aren't quantitative I can't include that column in my PCA analysis. Leading to the command

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

2014-01-21 Thread David Carlson
Of Andy.P Sent: Tuesday, January 21, 2014 12:18 PM To: r-help@r-project.org Subject: [R] PCA factominer package, question about changing labels in individuals factor map I am looking to do a PCA with the factominer package on a dataset of mine, named dat. The individuals in my dataset have character

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

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

Re: [R] PCA and gglot2

2013-07-11 Thread John Kane
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 script as I had some problems: ... pca = PCA(data[,1:4

[R] PCA and gglot2

2013-07-10 Thread ashz
Hi, I was trying as well as looking for an answer without success (a bit strange since it should be an easy problem) and therefore I will appreciate you help: My simple script is: # Loadings data of 5 columns and 100 rows of data data1-read.csv(C:/…/MyPCA.csv) pairs(data1[,1:4]) pca1 -

Re: [R] PCA and gglot2

2013-07-10 Thread John Kane
: a...@walla.co.il Sent: Wed, 10 Jul 2013 06:09:00 -0700 (PDT) To: r-help@r-project.org Subject: [R] PCA and gglot2 Hi, I was trying as well as looking for an answer without success (a bit strange since it should be an easy problem) and therefore I will appreciate you help: My simple script

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

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 right,

Re: [R] PCA and gglot2

2013-07-10 Thread John Kane
- 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 not know how to implement my data1 and pca1 in the script you provided as I

Re: [R] PCA and gglot2

2013-07-10 Thread stephen sefick
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:11 -0700 (PDT) To: r-help@r-project.org Subject: Re: [R] PCA and gglot2 Hi, Thanks. Fig 4 in the link you

Re: [R] PCA and gglot2

2013-07-10 Thread stephen sefick
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:11 -0700 (PDT) To: r-help@r-project.org Subject: Re: [R] PCA and gglot2 Hi, Thanks. Fig 4 in the link you

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,

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.scale =

[R] PCA with spearman and kendall correlations

2013-02-28 Thread BOURGADE Eric
Hello, I would like to do a PCA with dudi.pca or PCA, but also with the use of Spearman or Kendall correlations Is it possible ? Otherwise, how can I do, according to you ? Thanking you in advance Eric Bourgade RTE France [[alternative HTML version deleted]]

Re: [R] PCA with spearman and kendall correlations

2013-02-28 Thread David L Carlson
To: r-help@r-project.org Subject: [R] PCA with spearman and kendall correlations Hello, I would like to do a PCA with dudi.pca or PCA, but also with the use of Spearman or Kendall correlations Is it possible ? Otherwise, how can I do, according to you ? Thanking you in advance Eric

[R] PCA legend outside of PCA plot

2012-09-09 Thread Tinus Sonnekus
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

Re: [R] PCA legend outside of PCA plot

2012-09-09 Thread David L Carlson
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Tinus Sonnekus Sent: Sunday, September 09, 2012 1:37 PM To: r-help@r-project.org Subject: [R] PCA legend outside of PCA plot Hi All, I have been trying to get to plot my PCA legend

[R] PCA

2012-07-18 Thread Guforu
Hi everybody! I do at this time PCA. Everything was going good, I have got good results. Now I want make a plot. You can see it on the next image: http://r.789695.n4.nabble.com/file/n4636840/Forum.jpg For this plot I use the simple biplot function. Now, it is not exactly what I want. I prefer

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. __

[R] pca biplot.princomp has a bug?

2012-04-25 Thread Michael
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

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

Re: [R] PCA sensitive to outliers?

2012-04-23 Thread Martin Maechler
SL == Steve Lianoglou mailinglist.honey...@gmail.com on Mon, 23 Apr 2012 01:10:31 -0400 writes: SL On Mon, Apr 23, 2012 at 12:01 AM, Michael SL comtech@gmail.com wrote: yes, but that is not a good Review or Survey... thx SL But the packages listed there do have their

[R] PCA sensitive to outliers?

2012-04-23 Thread Igor Carron
I could not reply directly to the initial thread with the same title. There are two sorts of Robust PCA, those that were devised before the recent string of Low Rank approaches and then the new set of algorithms that provide robust PCA in light of sparse but potentially large errors/outliers

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 NAs, 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-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:

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Joshua Wiley
On Sun, Apr 22, 2012 at 4:43 PM, Michael comtech@gmail.com 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 NAs, it will give this warning... It seems that there is

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 jwiley.ps...@gmail.comwrote: On Sun, Apr 22, 2012 at 4:43 PM, Michael comtech@gmail.com wrote: I actually tried robustPca in pcaMethods on

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 comtech@gmail.com 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

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 gunter.ber...@gene.com 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 comtech@gmail.com wrote: Even in R, there

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Steve Lianoglou
On Mon, Apr 23, 2012 at 12:01 AM, Michael comtech@gmail.com 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

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 comtech@gmail.com 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

[R] PCA sensitive to outliers?

2012-04-19 Thread Michael
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 this problem? Please give me some pointers... Thank you! [[alternative HTML version deleted]]

Re: [R] PCA sensitive to outliers?

2012-04-19 Thread Bert Gunter
Michael: On Thu, Apr 19, 2012 at 9:20 PM, Michael comtech@gmail.com 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

[R] PCA R

2012-03-15 Thread Samantha Allcock
Hello can anyone help, I have been running the following script to obtain a PCA plot but the end result is rather disappointing as the points are very very small and there are no titles etc geochemdata-read.csv(file.choose(),header=TRUE) names(geochemdata) library(vegan) bstick-function(n,

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] PCA in predefined Groups??

2012-03-10 Thread SHAFI
Hi This has a simple answer but it has been eluding me nonetheless. I have been trying to build a PCA plot from scratch with the ability to plot predefined groups in different colors. I can plot PCA but I want it to plot with predefined groups(samples) with top 100 expressed genes. I have

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 different

[R] PCA for assets based household income analysis ( hetcor and princomp)

2012-01-24 Thread Mohd masood
I am doing Principal Component Analysis (PCA) on assets data for household income prediction. The problem is that the assets data are rank ordered (usually binary ... possess car/don't possess car), so the normal correlation is inappropriate for the calculation of the PCA. Instead one has to

[R] PCA in r

2011-12-22 Thread Mark
Hello Would anyone be able to direct me to information on how to perform a straightforward Principal Components Analysis in r?  Including the data file set-up?  I'm rather new to r and not having much luck. I'm pretty certain I have the data entered into the txt file properly but when I try

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

[R] PCA on high dimentional data

2011-12-10 Thread mail me
Hi: I have a large dataset mydata, of 1000 rows and 1000 columns. The rows have gene names and columns have condition names (cond1, cond2, cond3, etc). mydata- read.table(file=c:/file1.mtx, header=TRUE, sep=) I applied PCA as follows: data_after_pca- prcomp(mydata, retx=TRUE, center=TRUE,

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 the

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

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

[R] PCA and Regression with complex categorical variables

2011-10-24 Thread seanstclair
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] PCA and Regression with complex categorical variables

2011-10-21 Thread seanstclair
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

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: nothing -- David Winsemius, MD West Hartford, CT __ R-help@r-project.org

[R] PCA: prcomp rotations

2011-09-28 Thread Colin Wahl
Hi all, I think I may be confused by different people/programs using the word rotation differently. Does prcomp not perform rotations by default? If I understand it correctly retx=TRUE returns ordinated data, that I can plot for individual samples (prcomp()$x: which is the scaled and centered

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

[R] PCA Using prcomp()

2011-08-14 Thread christopher stratton
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

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 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

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

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 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

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

2011-07-18 Thread a.me...@yahoo.co.uk
Hi, May I ask a question about a thread https://stat.ethz.ch/pipermail/r-help/2005-March/068365.html? I understand I need to use prcomp instead of princomp when i have less units than variables. However, when I use prcomp the scores is NULL. How can I overcome this? Regards, Armin -- Kind

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 a.me...@yahoo.co.uk wrote: Hi, May I ask a question about a thread

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?

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-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

[R] PCA - scores

2011-03-03 Thread Shari Clare
I am running a PCA, but would like to rotate my data and limit the number of factors that are analyzed. I can do this using the principal command from the psych package [principal(my.data, nfactors=3,rotate=varimax)], but the issue is that this does not report scores for the Principal

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 -

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 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).

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 landronim...@gmail.com wrote: Dear all I'm unable to find

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 correlation

[R] pca analysis: extract rotated scores?

2010-11-30 Thread Liviu Andronic
Dear all I'm unable to find an example of extracting the rotated scores of a principal components analysis. I can do this easily for the un-rotated version. data(mtcars) .PC - princomp(~am+carb+cyl+disp+drat+gear+hp+mpg, cor=TRUE, data=mtcars) unclass(loadings(.PC)) # component loadings

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] PCA analysis, presence-absence of mammals in parks

2010-08-10 Thread zloutor
Hi everyone, So I am trying to see which ecological parameter of different parks in nyc influence the most the diversity of the medium-sized mammals in those parks. I have a bunch of different parameters for each park I'm done studying and the presence (1) and absence (0) of each mammal. I

[R] PCA and Regression

2010-07-06 Thread Marino Taussig De Bodonia, Agnese
Hello, I am currently analyzing responses to questionnaires about general attitudes. I have performed a PCA on my data, and have retained two Principal Components. Now I would like to use the scores of both the principal comonents in a multiple regression. I would like to know if it makes

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

[R] PCA scores

2010-04-16 Thread phoebe kong
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) Does anybody know how the mypca$scores were calculated? Is my formula not

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) Does

[R] pca error message

2010-03-24 Thread ogbos okike
Hi All, I have been running pca smoothly for some time now. However, the error message below makes progress difficult for me. It will be much appreciated if anybody can hint me on the possible source of this error. Thanks Ogbos The error: Error in pca$rotation %*% sqrt(data.cor.eigen.matrix) :

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

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 xanthe.wal...@gmail.com 16/03/2010 23:16:47 Hi, I have successfully completed a PCA and printed the loadings,

[R] PCA - blank loadings

2010-03-16 Thread Xanthe Walker
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 values, I need them for graphing purposes.

[R] PCA

2010-03-10 Thread Xanthe Walker
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 0.98922 0.9308 0.88201 0.92287 0.91775 0.82181 1.05319 0.92908

  1   2   >