# Generalized additive models (GAM's)
ADMB Files
Code: union.tpl Data: union.dat Initial values: union.pin Expected Results: union.par R (S-Plus) scripts: union.s
| ### Model description Since their introduction by Hastie & Tibshirani in the late 80ies, GAM's have become very popular. This example shows how to fit a GAM using penalized splines. The reason why GAM's can easily be handled in ADMB-RE is that penalized splines are a special case of random effects. ADMB-RE automatically estimates the degrees of freedom for each spline component, as this only amounts to estimate the variance of the random effects. A more detailed discussion of the model and the estimation approach can be found here: union.pdf The data, which are available from Statlib (lib.stat.cmu.edu/), contain information for each of 534 workers about whether they are members (y=1) of a workers union or not (y=0). The goal is to model the probability of membership as a function of various covariates. The file union.s shows how to create design matrices for B-splines in R (S-Plus). When sourced into R, union.s creates the input file for ADMB union.dat. You can use it as a basis for you own spline models. If you find the R-function `gam` too restrictive, the following extensions are easily accommodated in ADMB-RE: Mix spline component with `ordinary' random effects to account for correlation within groups/clusters. Add parametric nonlinear components to the linear predictor ### Results The probability of union membership as function of covariates (with all remaining covariate-effects fixed at their sample means):