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 variables and the columns the observations? (NOTE: if anyone knows a good guide for doing a PCA on an example data set, from start to finish, it would be greatly appreciated)> m[,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 2 3 4 5 6 [2,] 3 4 3 7 8 1 [3,] 1 2 3 4 5 6 [4,] 8 7 4 1 4 3 [5,] 1 2 3 4 5 6 [6,] 4 5 8 2 1 3 [7,] 9 8 7 6 7 8 [8,] 1 3 7 3 5 0> pc.cr<-princomp(m,cor=TRUE) > pc.crCall: princomp(x = m, cor = TRUE) Standard deviations: Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 1.545609e+00 1.407093e+00 9.886649e-01 7.539927e-01 2.919276e-01 2.460515e-09 6 variables and 8 observations.>thanks! Dave [[alternative HTML version deleted]]
On 07/14/04 16:05, Herman, David (NIH/NIMH) wrote:>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?Take a look at the help file for prcomp, especially the bottom of it. (This is completely general advice for any R function.) You will see under "See also" a number of things listed, and if you look them up or try them, then you will see several different ways of viewing the result. Under that is "Examples," which provides more hints still. And, if this isn't enough, type example(prcomp) on the command line. The biplot function is especially nice. Jon -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron R search page: http://finzi.psych.upenn.edu/
When all else fails, RTFM; e.g., see ?princomp and read it in its entirety. Then maybe also try running example(princomp). Andy> From: Herman, David (NIH/NIMH) > > 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 variables and the columns the observations? > > (NOTE: if anyone knows a good guide for doing a PCA on an > example data set, > from start to finish, it would be greatly appreciated) > > > m > [,1] [,2] [,3] [,4] [,5] [,6] > [1,] 1 2 3 4 5 6 > [2,] 3 4 3 7 8 1 > [3,] 1 2 3 4 5 6 > [4,] 8 7 4 1 4 3 > [5,] 1 2 3 4 5 6 > [6,] 4 5 8 2 1 3 > [7,] 9 8 7 6 7 8 > [8,] 1 3 7 3 5 0 > > pc.cr<-princomp(m,cor=TRUE) > > pc.cr > Call: > princomp(x = m, cor = TRUE) > > Standard deviations: > Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 > Comp.6 > 1.545609e+00 1.407093e+00 9.886649e-01 7.539927e-01 2.919276e-01 > 2.460515e-09 > > 6 variables and 8 observations. > > > > thanks! > Dave > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >