The GAM Procedure

Forms of Additive Models

Suppose that y is a continuous variable and x1 and x2 are two explanatory variables of interest. To fit an additive model, you can use a MODEL statement similar to that used in many regression procedures in the SAS System:

model y = spline(x1) spline(x2);

This model statement requires the procedure to fit the following model:

\[  \eta (x_1,x_2) = \beta _0 + \beta _1 x_1 + \beta _2 x_2 + s_1(x_1) + s_2(x_2)  \]

where the $s_ i(~ )$ terms denote nonparametric spline functions of the respective explanatory variables.

The GAM procedure can fit semiparametric models. The following MODEL statement assumes a linear relation with x1 and an unknown functional relation with x2:

model y = param(x1) spline(x2);

If you want to fit a model containing a functional two-way interaction between x1 and x2, you can use the following MODEL statement:

model y = spline2(x1,x2);

In this case, the GAM procedure fits a model equivalent to that of PROC TPSPLINE.