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. 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 include 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). 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.
Reference
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.