Re: [R] Find Principal Component Score per year

2011-03-22 Thread Carlos Ortega
Hello, First, you can try to split your data frame in this way: list.year<-split(pca, unique(pca$year)) And then apply the principal component analysis over the list "list.year". Regards, Carlos Ortega www.qualityexcellence.es On Tue, Mar 22, 2011 at 12:35 PM, mathijsdevaan wrote: > Hi, > > I

[R] Find Principal Component Score per year

2011-03-22 Thread mathijsdevaan
Hi, I am trying to calculate Principal Component Scores per id per year using the psych package. The following lines provide the scores per obeservation pca = data.frame(read.table(textConnection("id year A B C D 1001 1972 64 56 14 23 1003 1972 60 55