Skip to content
Prev 87330 / 398506 Next

question about Principal Component Analysis in R?

Michael wrote:

            
This is because you have subtracted a different means vector.  You
should use the coloumn means of the training data (as predict does;
see the last line of stats:::predict.prcomp):

d1=scale(test_data, center=pca$center, scale=FALSE) %*% pca$rotation;
Message-ID: <m0bqwr6f16.fsf@bar.nemo-project.org>
In-Reply-To: <b1f16d9d0602270100m59f2b925s39715e0022a231de@mail.gmail.com> (comtech.usa@gmail.com's message of "Mon, 27 Feb 2006 01:00:06 -0800")