[R] Centering (e.g. on prcomp)

Jessica Streicher j.streicher at micromata.de
Thu Apr 12 14:30:17 CEST 2012


Hi!

I'm doing a PCA on some testdata (only 2 features) currently to see what happens. I read a lot of times one should center ones data, so i left the option on.

But now i am scratching my head on how to correctly transform new data to be comparable to the data used in the pca.

pca$x are the points (in PC system) the function returns
origpoints%*%pca$rotation

is not quite the same, because it is missing the centering

for the original data i can of course do scale(origpoints,scaled=F) beforehand, and then the results will be the same, but for new data that option isn't available. So how would i properly transform it?

greetings
Jessica


More information about the R-help mailing list