Dear all; Does anyone have implemented a function for cross-validation in PCA? I know of one in the package pcaMethods but it doesn't work as I need. Assuming there's no one available, I tried to write a function for doing CV using prcomp but I'm not sure to understand how to obtain the PRESS error. I know that PRESS in PCA can be calculated as the (x-xhat)^2, but how can I obtain xhat? I used predict.prcomp but what I get is the predicted scores of the sample not included in the PC model and no xhat really, am I wrong?
Any suggestions will be more than appreciated SW ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.