[R] Gam() function in R
wt43 at cornell.edu
Mon Dec 6 12:06:58 CET 2004
Thank you very much. I am using gam() from mgcv actually. You answered my
question about degree of freedom.
One more question, if I were to compare the results from gam() and glm(),
which numbers are of the greatest interest?
What if my response variables are binary?
From: Simon Wood [mailto:simon at stats.gla.ac.uk]
Sent: Monday, December 06, 2004 5:54 AM
To: Janice Tse
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] Gam() function in R
> I'm a new user of R gam() function. I am wondering how do we decide on
> smooth function to use?
> The general form is gam(y~s(x1,df=i)+s(x2,df=j).......) , how do we
> decide on the degree freedom to use for each smoother, and if we shold
> apply smoother to each attribute?
I guess you are using gam() from package gam, in which case you probably
need to look at the help file for step.gam.
By default gam() in package mgcv estimates the appropriate degrees of
freedom automatically as part of model estimation using generalized cross
validation, (although there is an adjustable upper limit on the range of
degrees of freedom considered).
Package gss also has routines for fitting GAMs where the choise of df is
> Simon Wood simon at stats.gla.ac.uk www.stats.gla.ac.uk/~simon/
>> Department of Statistics, University of Glasgow, Glasgow, G12 8QQ
>>> Direct telephone: (0)141 330 4530 Fax: (0)141 330 4814
More information about the R-help