Dear R-users, I am trying to do a principal components analysis using the attached data. My code looks as follows. I want to calculate the time series of the principal components (PC) . To this end, I transform the coefficients and the data into matrices and employ a matrix multiplication but it does not work.
data<-equityfunds[,-1] PC<-prcomp(data) coef1<-PC$rotation data<-as.matrix(data) PC1<-coef1 %*% data This is the error message I get. Error in coef1 %*% data : non-conformable arguments So, what is wrong with my code? How do I multiply the coefficients with the observations? ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.