<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>FAQ/gam</title><revhistory><revision><revnumber>8</revnumber><date>2018-07-27 12:31:43</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>7</revnumber><date>2018-07-27 12:30:25</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>6</revnumber><date>2018-07-27 12:29:17</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>5</revnumber><date>2018-07-27 12:26:40</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>4</revnumber><date>2014-04-08 11:27:18</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>3</revnumber><date>2014-04-08 11:26:48</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>2</revnumber><date>2014-04-08 11:21:35</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>1</revnumber><date>2014-04-08 11:21:23</date><authorinitials>PeterWatson</authorinitials></revision></revhistory></articleinfo><section><title>Generalized Additive (Mixed) Models (GAM(M)) - an overview</title><para>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.  </para><para>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 <emphasis>mgcv</emphasis> procedure. <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/gam/statswiki/McKeown#">McKeown</ulink> and Sneddon (2014) describe and illustrate the use of GAMs and GAMMs with accompanying R code using the <emphasis>mgcv</emphasis> procedure presented in the appendix to the paper. Wood (2017) provides an introduction and overview to using GAMs in R. </para><para><emphasis role="underline">References</emphasis> </para><para>Hurvich CM and Tsai C-L (1991) Bias of the corrected AIC criterion for underfitted regression and time series models. <emphasis>Biometrika</emphasis> <emphasis role="strong">78</emphasis>, 499–509. </para><para><ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/gam/statswiki/McKeown#">McKeown</ulink> GJ and Sneddon I (2014) Modeling Continuous Self-Report Measures of Perceived Emotion Using Generalized Additive Mixed Models. <emphasis>Psychological Methods</emphasis> <emphasis role="strong">19(1)</emphasis>, 155-174. </para><para>Sugiura N (1978) Further analysis of the data by Akaike’s information criterion and the finite corrections. <emphasis>Communications in Statistics: Theory and Methods</emphasis> <emphasis role="strong">A7</emphasis>, 13–2 </para><para>Wood SN (2017) Generalized Additive Models: An Introduction with R (2nd edition). Chapman and Hall/CRC. </para></section></article>