Thanks for the help, but I think I already found what I'm looking for. If I'm not mistaken, predict.princomp() will do the job...
Radford Neal wrote: > Alexander Sirotkin <[EMAIL PROTECTED]> wrote: > > >>>>I use princomp() to get a PCA components and then use these components >>>>to build a classification model. >>>> >>>>When I use new data with that model (data which I did not have when >>>>I did the original PCA), I have to aplly a PCA first and then use PCA >>>>components with my model. >>>> >>>>The problem is - I would like (actually, I think I have) to use an >>>>eigenbasis from the first PCA when I do a PCA on a new data. >>>> >>>>So the question is - how can I use the eigenbasis (loadings ??) from >>>>princomp() output as an argument to another princomp() when processig a >>>>new data. >>> > > Radford Neal wrote: > > >>>You probably want to just find the projections of the new data on the >>>principle components you found before, which I presume are the inputs >>>to your classification model. I think you don't want to find principle >>>components all over again. >> > > Alexander Sirotkin <[EMAIL PROTECTED]> wrote: > > >>Right. The only question left - how I can do this in S-Plus/R... > > > > I think you can just take your new vector, subtract the sample mean of > each variable from each component, and then multiply it by the > "loadings" matrix in the princomp object. That should get you the > "score" for that new vector. Maybe you need to rescale the vector > too, if you were doing PCA on the correlation matrix rather than the > covariance matrix. > > You can try it out by finding the scores for the old data, and seeing > if they match what you had before. > > Radford Neal > . . ================================================================= Instructions for joining and leaving this list, remarks about the problem of INAPPROPRIATE MESSAGES, and archives are available at: . http://jse.stat.ncsu.edu/ . =================================================================
