[R] Princomp and calculations of original values

From: Stefaan Lhermitte <stefaan.lhermitte_at_biw.kuleuven.be>
Date: Fri 13 May 2005 - 01:53:28 EST


Dear R-ians,

I am working with princomp and I now want to manually recalculate my original values. I want to do it to completely understand the procedure of principal components.

I tried it with a test data set (2 dimensions) and I was able to calculate my original values (of a random point of my dataset) using the output of princomp:
test.data$scores[1,]%*%matrix(data=test.data$loadings,ncol=2)+test.data$center it seemed that result is identical with
test[1,]

When I tried it with my 4 dimensional real dataset, it did not work: pca.data$scores[1,]%*%matrix(data=pca.data$loadings,ncol=4)+pca.data$center is not equal to
data[1,]

Do I misunderstand the procedure somewhere, or what else do I do wrong?

Thanx in advance and kind regards,
Stef



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri May 13 01:59:45 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:44 EST