search for: pca1

Displaying 15 results from an estimated 15 matches for "pca1".

Did you mean: pca
2005 Mar 24
1
RE: [R] Mapping actual to expected columns for princomp object
...gest 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 "[.data.frame"(newdata, , names(object$center)) : undefined columns selected > names(frz) <- c("x2", "x1") > predict(pca1, frz) Comp.1 Comp.2 1 -3.29329963 -1.24675774 2 0.15760569 0.09364550 3 1.90206906 0.06292855...
2012 Sep 09
1
PCA legend outside of PCA plot
...s 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 <- rainbow(length(unique(SEData$Seamount))) pca1 <- princomp(SEData3, scores=TRUE, cor=TRUE) biplot(pca1, var.axes= TRUE, xlabs=rep("",nrow(SEData3)),main="Seamounts PCA") rrr <- apply(pca1$scores[,1:2],2, range) par(usr=as.vector(rrr)) points(pca1$scores[,1:2], col=r.cols , pch=20) legend(-8, 2.95, sm, col = r.cols, tex...
2012 Nov 14
2
error data frame
...t;StationCode" "Abramisbrama" "Alburnoidesbipunctatus" "Alburnusalburnus" [5] "Ameiurusmelas" > Fish89PCA <-read.csv("Fish89PCA.csv") > names (Fish89PCA) [1] "StationCode" "PCA1" > # Check data (1:X rows, e.g. 1:3,=1.-3.row or else) > Fish89PCA [1:3,] StationCode PCA1 1 DE582 -1.5592527 2 DE38 0.3530658 3 FR02116570 2.8057854 > > names (Fish89PCA) [1] "StationCode" "PCA1" > Fish89TiTAN <- titan(...
2013 Jul 10
3
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 is: # Loadings data of 5 columns and 100 rows of data data1<-read.csv("C:/?/MyPCA.csv") pairs(data1[,1:4]) pca1 <- princomp(data1[,1:4], score=TRUE, cor=TRUE) biplot(pca1) 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? Thanks -- View t...
2004 Nov 04
2
biplot drawing conc ellipses
Is there an option to draw concentration ellipses in biplots ? It seems really nice to summarize large number of points of each group. Cheers../ Murli
2005 Mar 24
0
Mapping actual to expected columns for princomp object
...mpting? If so, can anyone tell me how to accomplish steps 1 and 2 above? Thanks, Dana Honeycutt P.S. Here's a script that demonstrates the problem: x1 <- rnorm(10) x2 <- rnorm(10) y <- rnorm(10) frx <- data.frame(x1,x2) frxy <- data.frame(x1,x2,y) lm1 <- lm(y~x1+x2,frxy) pca1 <- princomp(frx) rm(x1,x2,y,frx,frxy) z1 <- rnorm(10) z2 <- rnorm(10) frz <- data.frame(z1,z2) predict(lm1, frz) # gives error: Object "x1" not found predict(pca1, frz) # gives no error, indicating column names ignored z3 <- rnorm(10) fr3z <- data.frame(frz,z3) pred...
2009 Aug 03
1
principal component analysis for class variables
...ble 2 and variable 3. What I want is to see if the combination of var 2 and var 3, will give me a pattern that allows to distinguish populations. I found several packages like ade4, with pcaiv function and factoMineR. but there are not working. Using the ade4 package, when I try to build the pca: pca1 <- dudi.pca(D, scan = FALSE, nf = 2) Error in v * row.w : non-numeric argument to binary operator Does someone has suggestions? Thanks, Andy -- View this message in context: http://www.nabble.com/principal-component-analysis-for-class-variables-tp24792474p24792474.html Sent from the R help ma...
2007 Jul 18
0
multicollinearity in nlme models
...) mod.vol.nlme<-nlme(fa20~(ah*habdiv+ads*ds+ads2*ds2+at*trout)+asymporig(da.p,th1,th2)+ asymporigb(vol,th1b,th2b), fixed=ah+ads+ads2+at+th1+th2+th1b+th2b~1, random=pdBlocked(list(th1~1,th2~1)), start=c(ah=.5524,ads=.8,ads2=-.1,at=-1,th1=2.542,th2=-7.117,th1b=2,th2b=-7), data=pca1.grouped,verbose=T) I am looking at potential multicollinearity among the fixed effects, in particular I am concerned about multicollinearity between da.p (drainage area) and vol (volume). How do I interpret the correlation reported in the summary command for th1 and th1b, which are the asymptotes...
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 Comp.10 Standard deviation 9.882181e+05 3.303966e+04 7.083767e+02 3.282215e+02 9.839173e+01 4.642...
2007 Jun 20
1
nlme correlated random effects
...del. asymporig<-function(x,th1,th2)th1*(1-exp(-exp(th2)*x)) mod1<-nlme(fa20~(ah*habdiv+ad*log(d)+ads*ds+ads2*ds2+at*trout)+asymporig(da.p,th1,th2), fixed=ah+ad+ads+ads2+at+th1+th2~1, random=th1+th2~1, start=c(ah=.9124,ad=.9252,ads=.5,ads2=-.1,at=-1,th1=2.842,th2=-6.917), data=pca1.grouped) However, the two random effects (th1 and th2) which describe the asymptotic relationship between richness (fa20) and area (da.p) are correlated: -0.904 with approximate 95% ci of -0.99 to -.32. I examined the anova of mod1 with both random effects and mod2 with just th1 and mod1 is prefer...
2011 Nov 11
6
need help
hello all R experts, how do I calculate the reliability between the two groups using the ICCs? I'll appreciate your reply, Thanks Sincerely, Supreet kaur, Biomedical research engineer, Nationwide Childrens Hospital, Columbus, OH (614)355-3509 [[alternative HTML version deleted]]
2013 Oct 01
5
Análisis de componentes principales con ade4 y FactoMineR
...(paquete "ade4") y "PCA" (paquete "FactoMineR"). Sucede que al comparar las coordenadas de cada individuo que obtiene cada función, las que corresponden al segundo componente principal tienen idéntica magnitud pero con signos contrarios: Función dudi.pca: Comando: PCA1 <- dudi.pca(df = DATOS[,(2:ncol(DATOS))], center = TRUE, scale = TRUE, scannf = FALSE, nf = 6) Individuo Comp1 Comp2 1 -14.18 -4.47 2 -14.63 -4.53 3 -14.77 -2.57 4 -14.12 -1.71 5 -16.32 4.22 6 -17.03 5.94 7 -16.90 3.68 8 -17.75 5.86 9 13...
2013 Oct 01
3
Análisis de componentes principales con ade4 y FactoMineR
...(paquete "ade4") y "PCA" (paquete "FactoMineR"). Sucede que al comparar las coordenadas de cada individuo que obtiene cada función, las que corresponden al segundo componente principal tienen idéntica magnitud pero con signos contrarios: Función dudi.pca: Comando: PCA1 <- dudi.pca(df = DATOS[,(2:ncol(DATOS))], center = TRUE, scale = TRUE, scannf = FALSE, nf = 6) Individuo Comp1 Comp2 1 -14.18 -4.47 2 -14.63 -4.53 3 -14.77 -2.57 4 -14.12 -1.71 5 -16.32 4.22 6 -17.03 5.94 7 -16.90 3.68 8 -17.75 5.86...
2013 Oct 01
0
Análisis de componentes principales con ade4 y FactoMineR
..." (paquete > "FactoMineR"). Sucede que al comparar las coordenadas de cada > individuo que obtiene cada función, las que corresponden al segundo > componente principal tienen idéntica magnitud pero con signos contrarios: > > Función dudi.pca: > > Comando: > PCA1 <- dudi.pca(df = DATOS[,(2:ncol(DATOS))], center = TRUE, scale = > TRUE, scannf = FALSE, nf = 6) > > Individuo Comp1 Comp2 > 1 -14.18 -4.47 > 2 -14.63 -4.53 > 3 -14.77 -2.57 > 4 -14.12 -1.71 > 5 -16.32 4.22 > 6 -17.03 5.94 &gt...
2013 Oct 02
0
Análisis de componentes principales con ade4 y FactoMineR
...las coordenadas de cada >>> individuo que obtiene cada función, las que corresponden al segundo >>> componente principal tienen idéntica magnitud pero con signos >>> contrarios: >>> >>> Función dudi.pca: >>> >>> Comando: >>> PCA1 <- dudi.pca(df = DATOS[,(2:ncol(DATOS))], center = TRUE, scale >>> = TRUE, scannf = FALSE, nf = 6) >>> >>> Individuo Comp1 Comp2 >>> 1 -14.18 -4.47 >>> 2 -14.63 -4.53 >>> 3 -14.77 -2.57 >>> 4 -14.12 -1....