Re: [R] Scaling in predict.prcomp

2008-04-20 Thread Gad Abraham
Prof Brian Ripley wrote: > On Sun, 20 Apr 2008, Gad Abraham wrote: > >> Hi, >> >> Say x.train is a matrix of covariates that I want to do PCA on, so I can >> do regression on its principal components, and x.test is a test set of >> the same covariates on which I want to evaluate the regression fit

Re: [R] Scaling in predict.prcomp

2008-04-20 Thread Prof Brian Ripley
On Sun, 20 Apr 2008, Gad Abraham wrote: > Hi, > > Say x.train is a matrix of covariates that I want to do PCA on, so I can > do regression on its principal components, and x.test is a test set of > the same covariates on which I want to evaluate the regression fit. I > would like the covariates to

[R] Scaling in predict.prcomp

2008-04-19 Thread Gad Abraham
Hi, Say x.train is a matrix of covariates that I want to do PCA on, so I can do regression on its principal components, and x.test is a test set of the same covariates on which I want to evaluate the regression fit. I would like the covariates to be centred and scaled: p <- prcomp(x.train, cen