Just use 'predict' on the fitted model and subtract the predicted values from the data.
Kevin Wright On Wed, Jul 25, 2012 at 5:02 AM, petohtalrayn <h643...@rtrtr.com> wrote: > Hi everyone, > > I am relatively new to R, and I need to perform the principal components > analysis of a data matrix. I know that there are a bunch of methods to do it > (dudi.pca, princomp, prcomp...) but I have not managed to find a method that > can return the residuals obtained by retaining X principal components of the > original data, as this MATLAB function can do: http://is.gd/6WeUFF > > Suggestions? Please, help me to find a way to do it, any information you can > give will be highly appreciated. > > Thanks in advance! > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Obtain-residuals-from-a-Principal-Component-Analysis-tp4637754.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. -- Kevin Wright ______________________________________________ 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.