The GAMMOD Procedure
PROC GAMMOD Contrasted with Other SAS Procedures
The GAMMOD procedure provides generalized additive modeling functionality that is comparable to that of GAMPL and GAM procedures in SAS/STAT software.
PROC GAMMOD Compared with the GAMPL Procedure
The functionality of the GAMMOD procedure closely resembles that of the GAMPL procedure, which is a high-performance SAS/STAT procedure. The GAMMOD procedure is the next generation of the GAMPL procedure, and it was developed specifically for SAS Viya. Both procedures are designed to run on a cluster of machines that distribute the data and the computations. Both procedures perform computations in multiple threads.
PROC GAMMOD provides all the features and options that PROC GAMPL supports; in addition, it supports BY processing. The default link functions for two distributions differ between the two procedures, as shown in Table 6.1.
Table 6.1: Default Link Function
Distribution | GAMMOD | GAMPL |
|---|---|---|
Gamma | Log | Reciprocal |
Inverse Gaussian | Log | Reciprocal square |
You should expect close results between these two procedures, although exactly equivalent models are not guaranteed because their implementations are different.
PROC GAMMOD Compared with the GAM Procedure
Both the GAMMOD procedure and the GAM procedure in SAS/STAT software fit generalized additive models. However, the GAMMOD procedure uses different approaches for constructing spline basis expansions, fitting generalized additive models, and testing smoothing components. The GAMMOD procedure focuses on automatic smoothing parameter selection by using global model-evaluation criteria to find optimal models. The GAM procedure focuses on constructing models by fitting partial residuals against each smoothing term with fixed degrees of freedom. In general, you should not expect similar results from these two procedures. Table 6.2 summarizes the main differences.
Table 6.2: PROC GAMMOD Compared with PROC GAM
Functionality | GAMMOD | GAM |
|---|---|---|
Constructing spline basis expansions | Uses thin-plate regression splines to construct basis expansions for each spline term, and each term allows multiple variables. | Uses univariate or bivariate smoothing splines to construct basis expansions, and each term allows only one or two variables. Also allows loess smoothers. |
Fitting generalized additive models | Fits models that have fixed smoothness terms by optimizing penalized likelihood. For models that have varying smoothness terms, PROC GAMMOD estimates smoothing parameters simultaneously by optimizing global model fit criteria such as generalized cross validation (GCV). | Fits models that have fixed smoothness terms by fitting partial residuals against each smoothing term. For models that have varying smoothness terms, PROC GAM estimates each smoothing parameter by optimizing the local GCV criterion for one spline term at a time. |
Distribution families and link functions | Supports more distributions, including the negative binomial and the Tweedie families. Also supports any applicable link functions for each distribution. | Supports major distribution families and the canonical link function for each distribution. |
Testing smoothing components | Tests the total contribution for a spline term. | Tests the existence of nonlinearity for a spline term beyond the linear trend. |
Model inference | A global Bayesian posterior covariance matrix is available. The confidence limits for each observation’s prediction is available, in addition to componentwise confidence limits. | A local Bayesian posterior covariance matrix is available for each spline term. Only the componentwise confidence limits are available. |
Model degrees of freedom | Uses the trace of the global degrees-of-freedom matrix. | Uses the summation of the traces of individual smoothing matrix for each smoothing term. |
Multithreading scheme | Specifically designed to operate in SAS Viya and performs computations in multiple threads. | Executes in a single thread on a single machine. |