Description Usage Arguments Details Value Author(s) References See Also Examples

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.

1 |

`frame` |
a data.frame to be used in |

`response` |
The column in |

`smoother` |
which smoother to use for the nonlinear terms; i.e. "s" or "lo", or any other supplied smoother. Default is "s". |

`arg` |
a character (vector), which is the
argument to |

`form` |
if |

This function creates a similar scope formula for each variable in the
frame. A column named "x" by default will generate a scope term
`~1+x+s(x)`

. With `arg=c("df=4","df=6")`

we get `~1+x+s(x,df=4)+s(x,df=6)`

.
With form=FALSE, we would get the character vector `c("1","x","s(x,df=4)","s(x,df=6")`

.

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
Hastie (1992).
This version of `gam.scope`

is adapted from the S
version.

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 |

```
Loading required package: splines
Loading required package: foreach
Loaded gam 1.14-4
$x
~1 + x + s(x)
<environment: 0x243a150>
$z
~1 + z + s(z)
<environment: 0x243a150>
$x
~1 + x + s(x, df = 5)
<environment: 0x244ca10>
$z
~1 + z + s(z, df = 5)
<environment: 0x244ca10>
$x
[1] "1" "x" "s(x,df=5)"
$z
[1] "1" "z" "s(z,df=5)"
$x
~1 + x + s(x, df = 4) + s(x, df = 6)
<environment: 0x368fd58>
$z
~1 + z + s(z, df = 4) + s(z, df = 6)
<environment: 0x368fd58>
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.