FAQ/gam - CBU statistics Wiki

Please enter your password of your account at the remote wiki below.
/!\ You should trust both wikis because the password could be read by the particular administrators.

Clear message
location: FAQ / gam

Generalized Additive (Mixed) Models (GAM(M)) - an overview

GAMs or GAMMs are used to fit and plot a combination of time varying functions such as polynomials to responses. GAMs allow fitting of a penalized regression spline to time predictors such as time since diagnosis. Use of a spline allows for investigation of more flexible relationships rather than simply assuming a straight line relationship. More than one function can be used in the same model of a response with one function fitted to the response over one time period and another function used over another time period with the functions possibly linked at a single time point, known as a knot.

They can also include the 'usual' linear regression predictors including interaction terms to compare curves across different groups (e.g. males and females) with R^2 used as a means of assessing the degree of fit (interpreted as in linear regression). The Akaike Information Criterion can be used to compare model fits. A second order Akaike Information Criterion (AICc – see Sugiura 1978, Hurvich and Tsai 1991) is recommended for comparing GAMs when there are small sample sizes. GAMs and GAMMs can be fitted in R using the mgcv procedure. McKeown and Sneddon (2014) describe and illustrate the use of GAMs and GAMMs with accompanying R code using the mgcv procedure presented in the appendix to the paper. Wood (2017) provides an introduction and overview to using GAMs in R.


Hurvich CM and Tsai C-L (1991) Bias of the corrected AIC criterion for underfitted regression and time series models. Biometrika 78, 499–509.

McKeown GJ and Sneddon I (2014) Modeling Continuous Self-Report Measures of Perceived Emotion Using Generalized Additive Mixed Models. Psychological Methods 19(1), 155-174.

Sugiura N (1978) Further analysis of the data by Akaike’s information criterion and the finite corrections. Communications in Statistics: Theory and Methods A7, 13–2

Wood SN (2017) Generalized Additive Models: An Introduction with R (2nd edition). Chapman and Hall/CRC.