Generate a scope for step.gam
Given a data.frame as an argument, generate a scope list for use in step.gam, each element of which gives the candidates for that term.
a data.frame to be used in
The column in
which smoother to use for the nonlinear terms; i.e. "s" or "lo", or any other supplied smoother. Default is "s".
a character (vector), which is the
This function creates a similar scope formula for each variable in the
frame. A column named "x" by default will generate a scope term
arg=c("df=4","df=6") we get
With form=FALSE, we would get the character vector
a scope list is returned, with either a formula or a character vector for each term, whcih describes the candidates for that term in the gam.
Written by Trevor Hastie, following closely the design in the
"Generalized Additive Models" chapter (Hastie, 1992) in Chambers and
This version of
gam.scope is adapted from the S
Hastie, T. J. (1991) Generalized additive models. Chapter 7 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth \& Brooks/Cole.
1 2 3 4 5 6