Hello
I'm writing an example PCA analysis for some students. I've done PCA on a
2-column matrix to show it at the most simple form (a rotation of two
axes). I can't, however, figure out how to plot the rotated axes as lines
over top of the original data plotted on the x-y. Does anyone know how to
do this? It will be a good way to show how the rotated axes describing the
most variation compared to the original axes.
I've used the princomp function, and here's how I set up the data.
library(MASS)
Sigma<-matrix(c(10,3,3,2),2,2)
dat<-mvrnorm(n=60, mu=c(12,13), Sigma)
plot(dat, xlab="x", ylab="y")
pc.ex<-princomp(dat)
Thanks in advance.
Gareth Campbell
PhD Candidate
The University of Auckland
P +649 815 3670
M +6421 256 3511
E [EMAIL PROTECTED]
[EMAIL PROTECTED]
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.