A Beginner's Guide to Generalized Additive Mixed Models with R. Zuur AF, Saveliev AA, Ieno EN.


Jump straight to

Price and Order the book (or Ebook)


Table of Contents

Data sets and R code used

Support chapters



This book begins with an introduction to generalised additive models (GAM) using stable isotope ratios from squid. In Chapter 2 we explain additive mixed effects using polar bear movement data. In Chapter 3 we apply additive mixed effects models on coral reef data. Ruddy turnstone data are used in Chapter 4 to explain Poisson generalised additive mixed effects models (GAMMs) using the gamm4 package. A simulation study is applied to investigate the effect unbalanced random effects. In Chapter 5 parasite data sampled on anchovy fishes are used to explain overdispersed Poisson GAMM, negative binomial GAMM, and NB-P GAMM models. We briefly discuss generalised Poisson models for underdispersed data. In Chapters 6 and 7 two-dimensional smoothers are applied on zero-inflated guillemots and harbour porpoise datasets. A short revision of zero-inflated models is included. Gamma GAMMs are applied on two-way nested tree data in Chapter 8. In Chapter 9 binary nested data are analysed using binomial GAMM. In Chapter 10 we analyse maximum length of cod fishes. The generalised extreme value distribution is used. The data are from a large number of spatial locations and we use INLA to implement spatial correlation. In Chapter 11 sea ducks are analysed using zero-inflated Poisson GAMMs (and GLMMs) with spatial correlation. We again use INLA. Throughout the book we contrast frequentist and Bayesian approaches. All R code is either included and explained in the book or is available from the website for the book.

The title of this book contains the phrase ‘Beginner’s Guide to …’. This does not mean that this book is for the statistical novice and can be read as a stand-alone book. On the contrary, we assume that the reader is familiar with R, data exploration, multiple linear regression, generalised linear modelling, generalised additive modelling, linear mixed effects modelling, and Markov chain Monte Carlo (MCMC) techniques. This is quite a substantial number of statistical techniques. This book is written as a sequel to our Beginner’s Guide to GAM with R and Beginner’s Guide to GLM and GLMM with R books. If you are familiar with the material described in those two books, then the current volume is indeed a ‘Beginner’s Guide’. But if you are not familiar with these techniques then the learning curve may be steep. However, wherever possible we have included short revisions. And we also provide the reader with access to Chapter 1 of Zuur et al. (2012a), which contains an introduction to Markov chain Monte Carlo techniques (see below for access details).


In this book we take the reader on an exciting voyage into the world of generalised additive mixed effects models (GAMM). Keywords are GAM, mgcv, gamm4, random effects, Poisson and negative binomial GAMM, gamma GAMM, binomial GAMM, negative binomial-P models, GAMMs with generalised extreme value distributions, overdispersion, underdispersion, two-dimensional smoothers, zero-inflated GAMMs, spatial correlation, INLA, Markov chain Monte Carlo techniques, JAGS, and two-way nested GAMMs. The book includes three chapters on the analysis of zero-inflated data.

Table of Contents

Click for

Price and Order the book

Copyright statement

This book is copyright material from Highland Statistics Ltd. Scanning this book (or parts of it) and distributing the digital media (including uploading to the Internet) without our explicit permission is copyright infringement. Infringing copyright is a criminal offence and you will be taken to court and run the risk of paying ALL damages and compensation. Highland Statistics Ltd. actively polices against copyright infringement.

All data sets used in the book are provided as *.txt or *.csv files. Right-mouse click on a data file and click on Save-As.
R code for each chapter is password protected. The password is given on page vi in the preface of the book. See the paragraph "Data sets and R code used in this book"
Support routines that we source in various chapters:
MCMCSupportHighstatV2.R (older version: MCMCSupportHighstat.R)
Just copy these files in the working directory (use Save As) and type:
source(file = "HighstatLibV6.R")

source(file = "MCMCSupportHighstatV2.R")
source(file = "SupportFilesHighstat.R")
pdf file with some simple explanations on matrix notation
Chapter Title Data sets R code*
1 Introduction SquidNorway.txt Squid.zip
2 Additive mixed effects models applied on polar bear movement data PolarBearsV2.txt PolarBears.zip
3 Additive mixed effects models applied on coral reef data  coralData.txt CoralReef.zip
4 Poisson GAMM applied on ruddy turnstone data TurnstoneDataV2.txt TurnStone.zip
5 GAMM applied on parasite data Anchoita.csv Parasites.zip
6 Zero-inflated sea bird data sampled at offshore wind farms Common_Guillemot.txt July 2014
7 Zero-inflated GAMM applied on harbour porpoise Not available HarbourPorpoise.zip
8 Gamma GAMM applied on tree growth data BeechDataV2.txt Beech.zip
9 Bernoulli GAMM applied on cowbird brood parasitism CowbirdV2Book.txt Cowbirds.zip
10 GAMM applied on maximum cod length using inla CodMaximumLenghtV3.txt cod.zip
11 Zero-inflated and spatial correlated Common Scoter data SeaDucks4.txt July 2014

Support chapters

Rather than reproducing the material on MCMC, we give the reader of this book electronic access to Chapter 1 of Zuur et al. (2012a), which contains an introduction to Bayesian statistics and MCMC. Chapter 1 of Zuur (2012b) provides an introduction to multiple linear regression, which is also prerequisite knowledge for this book. These two chapters are downloadable from:

Both chapters are password protected. The password is given on page vi in the Preface. See the paragraph labelled "Chapter 1 of Zuur et al. (2012a) and Zuur (2012b)".