Dear R users, I have now managed to fit the curve using the thin plate spline as follows: library(mgcv) b <- gam(y~s(x1,x2,k=100),data =dat) vis.gam(b) What I want now is to get the fitted data for y and copy it so that I use it for further analysis. Many thanks in advance mintewab
curve fitted ... how to retreive data
3 messages · Mintewab Bezabih, Gene Leynes
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111207/f726104f/attachment.pl>
2 days later
THanks so much Gene, it worked mintewab ________________________________________ Fr?n: gleynes at gmail.com [gleynes at gmail.com] för Gene Leynes [gleynes+r at gmail.com] Skickat: den 7 december 2011 18:43 Till: Mintewab Bezabih Kopia: r-help at r-project.org ?mne: Re: [R] curve fitted ... how to retreive data For the components: result = predict(b, type="terms") For the total fit: result = predict(b) result = b$fitted.values
On Wed, Dec 7, 2011 at 3:24 AM, Mintewab Bezabih <Mintewab.Bezabih at economics.gu.se<mailto:Mintewab.Bezabih at economics.gu.se>> wrote:
Dear R users, I have now managed to fit the curve using the thin plate spline as follows: library(mgcv) b <- gam(y~s(x1,x2,k=100),data =dat) vis.gam(b) What I want now is to get the fitted data for y and copy it so that I use it for further analysis. Many thanks in advance mintewab ______________________________________________ R-help at r-project.org<mailto:R-help at 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.