Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The GAM Procedure

MODEL Statement

MODEL dependent=<PARAM(effects)><smoothing effects> </options>;

MODEL event/trials=<PARAM(effects)> <smoothing effects> </options> ;

The MODEL statement specifies the dependent variable and the independent effects you want to use to model its values. Specify the independent parametric variables inside the parentheses of PARAM(). The parametric variables can be either CLASS variables or continuous variables. Class variables must be declared with a CLASS statement. Interactions between variables can also be included as parametric effects. The syntax for the specification of effects is the same as for the GLM procedure.

Any number of smoothing effects can be specified, as follows:

Smoothing Effect Meaning
SPLINE(variable <, df=number>)fit smoothing spline with the
 variable and with DF=number
LOESS(variable <, df=number>)fit local regression with the
 variable and with DF=number
SPLINE2(variable, variable <,df=number>)fit bivariate thin-plate smoothing spline
 with DF=number


If you do not specify the DF=number option with a smoothing effect, DF=4 is used by default, unless you specify the METHOD=GCV model option.

Both parametric effects and smoothing effects are optional, but at least one of them must be present.

If only parametric variables are present, PROC GAM fits a parametric linear model using the terms inside the parentheses of PARAM(). If only smoothing effects are present, PROC GAM fits a nonparametric additive model. If both types of effect are present, PROC GAM fits a semiparametric model using the parametric effects as the linear part of the model.

The following table shows how to specify various models for a dependent variable y and independent variables x, x1, and x2.

Table 5.1: Syntax for Common GAM Models
Type of Model Syntax Mathematical Form
Parametricmodel y = param(x);E(y)=\beta_0 + \beta_1 x
Nonparametricmodel y = spline(x);E(y)=\beta_0 + s(x)
Nonparametricmodel y = loess(x);E(y)=\beta_0 + s(x)
Semiparametricmodel y = param(x1) spline(x2);E(y)=\beta_0 + \beta_1 x_1 + s(x_2)
Additivemodel y = spline(x1) spline(x2);E(y)=\beta_0 + s_1(x_1) + s_2(x_2)
Thin-plate splinemodel y = spline(x1,x2);E(y)=\beta_0 + s(x_1,x_2)


You can specify the following options in the MODEL statement.

ALPHA=number
specifies the significance level \alpha of the confidence limits on the final nonparametric component estimates when you request confidence limits to be included in the output data set. Specify number as a value between 0 and 1. The default value is 0.05. See the "OUTPUT Statement" section for more information on the OUTPUT statement.

DIST=distribution-id
specifies the distribution family used in the model. The distribution-id can be either GAUSSIAN, BINOMIAL, BINARY, GAMMA, or POISSON. The canonical link is used with those distributions. Although theoretically, alternative links are possible, with nonparametric models the final fit is relatively insensitive to the precise choice of link function. Therefore, only the canonical link for each distribution family is implemented in PROC GAM. The loess smoother is not available for the Binomial distribution when the number of trials is greater than 1.

EPSILON=number
specifies the convergence criterion for the backfitting algorithm. The default value is 1.0e-8.

EPSSCORE=number
specifies the convergence criterion for the local score algorithm. The default value is 1.0e-8.

ITPRINT
produces an iteration summary table for the smoothing effects.

MAXITER=number
specifies the maximum number of iterations for the backfitting algorithm. The default value is 50.

MAXITSCORE=number
specifies the maximum number of iterations for the local score algorithm. The default value is 100.

METHOD=GCV
specifies that the value of the smoothing parameter should be selected by generalized cross validation. If you specify both METHOD=GCV and the DF= option for the smoothing effects, the user-specified DF= is used, and the METHOD=GCV option is ignored. See the "Selection of Smoothing Parameters" section for more details on the GCV method.

NOTEST
requests that the procedure not produce the "Analysis of Deviance" table. This option reduces the running time of the procedure.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.