[R] step.gam

Jari Oksanen jarioksa at sun3.oulu.fi
Wed Dec 1 16:20:24 CET 2004

On Wed, 2004-12-01 at 17:09, David Nogués wrote:
> Dear R-users:
> Im trying (using gam package) to develop a stepwise analysis. My gam 
> object contains five pedictor variables (a,b,c,d,e,f). I define the 
> step.gam:
> step.gam(gamobject, scope=list("a"= ~s(a,4), "b"= ~s(b,4), "c"= ~s(c,4), 
> "d"= ~s(d,4), "e"= ~s(e,4), "f"= ~s(f,4)))
Your scope doesn't look much like Trevor Hastie's help page. Have you
tried formulating your scope like Hastie tells you to do? That is, for
"a" you should list all possible cases for stepping instead of only one.
That is, something like ..."a" = ~ 1 + a + s(a, 2) + s(a, 4).....

Why do you want to use this kind of stepping, when the standard package
mgcv has a much better way of model building using generalized cross

Dave Roberts discusses R/S-plus (or mgcv/gam package level) gam fitting
in ecological context at
http://labdsv.nr.usu.edu/splus_R/lab5/lab5.html. You may find some
useful hints here, as Dave is partial to the traditional S-plus gam as

cheers, jari oksanen
Jari Oksanen -- Dept Biology, Univ Oulu, 90014 Oulu, Finland
email jari.oksanen at oulu.fi, homepage http://cc.oulu.fi/~jarioksa/

More information about the R-help mailing list