Generate a Scope Argument for Stepwise GAM

DESCRIPTION:

Generates a scope argument for a stepwise GAM.

USAGE:

gam.scope(frame, response = 1, smoother = "s", arg = NULL,  
          formula  =  T) 

REQUIRED ARGUMENTS:

frame
a data frame

OPTIONAL ARGUMENTS:

response
which variable is the response; the default is the first
smoother
what smoother to use; default is s
arg
any additional arguments required bu the smoother
formula
should a formula be returned (default), or else a character version of the formula

VALUE:

a list of formulas is returned, one for each column in frame (excluding the response). For a numeric variable, say x, the formula is ~ 1 + x + s(x) If x is a factor, the last smooth term is omitted.

DETAILS:

Each formula describes an ordered regimen of terms, each of which is eligible on their own for inclusion in the gam model. One of the terms is selected from each formula by step.gam. If a 1 is selected, that term is omitted.

SEE ALSO:

, , , .

EXAMPLES:

this.scope <- gam.scope(kyphosis,arg = "df = 6") 
this.scope 
# Produces the following: 
  $Age: 
   ~ 1 + Age + s(Age, df = 6) 
  $Number: 
   ~ 1 + Number + s(Number, df = 6) 
  $Start: 
   ~ 1 + Start + s(Start, df = 6) 
step(gamob,this.scope)