Beginner's Guide to

Spatial, Temporal and Spatial-Temporal Ecological Data Analysis with R-INLA (2017)

Zuur, Ieno, Saveliev

This book consists of two volumes.

In Volume I we explain how to apply linear regression models, generalised linear models (GLM), and generalised linear mixed-effects models (GLMM) to spatial, temporal, and spatial-temporal data. The models that will be employed use the Gaussian and gamma distributions for continuous data, the Poisson and negative binomial distributions for count data, the Bernoulli distribution for absence–presence data, and the binomial distribution for proportional data.

In Volume II we apply zero-inflated models and generalised additive (mixed-effects) models to spatial and spatial-temporal data. Volume II is entitled  GAM and Zero-Inflated Models.

Volume I: Table of Contents

Volume I: Pdf of Chapter 1: Overview of this book

Volume II: Preface and Table of Contents

Volume II: Pdf of Chapter 17: Introduction to Volume II

 

Volumes 1 and II are sold separately. Click here to order Volume I and/or Volume II (or click on the 'Order Books or E-Books' at the top on the left-menu).


 

Outline of Volume I

In Chapter 2 we discuss an important topic: dependency. Ignoring this means that we have pseudoreplication. We present a series of examples and discuss how dependency can manifest itself.

We briefly discuss frequentist tools that are available for the analysis of temporal and spatial data in Chapters 3 and 4, and we will conclude that their application is rather limited, especially if non-Gaussian distributions are required. We will therefore consider alternative models, but these require Bayesian techniques.

In Chapter 5 we discuss linear mixed-effects models to analyse hierarchical (i.e. clustered or nested) data, and in Chapter 6 we outline how we add spatial and spatial-temporal dependency to regression models via spatial (and/or temporal) correlated random effects.

In Chapter 7 we introduce Bayesian analysis, Markov chain Monte Carlo techniques (MCMC), and Integrated Nested Laplace Approximation (INLA). INLA allows us to apply models to spatial, temporal, or spatial-temporal data.

In Chapters 8 through 16 we present a series of INLA examples. We start by applying linear regression and mixed-effects models in INLA (Chapters 8 and 9), followed by GLM examples in Chapter 10. In Chapters 11 through 13 we show how to apply GLM models on spatial data. In Chapter 14 we discuss time-series techniques and how to implement them in INLA. Finally, in Chapters 15 and 16 we analyse spatial-temporal models in INLA.

 

Outline of Volume II

In Chapter 18 we will explain how to deal with zero-inflated data. We introduce so-called zero-inflated Poisson (ZIP) models, zero-inflated negative binomial (ZINB) models, zero-altered Poisson (ZAP) models and zero-altered negative binomial (ZINB) models.

In Chapter 19 we extend the ZIP, ZINB, ZAP and ZANB models with spatial correlation. Both these chapters use a skate data set from South America. In the appendix accompanying Chapter 19 we also explain how to manipulate maps and create spatial polygons (e.g. for coastlines).

In Chapter 20 we revisit a data set with which we have been battling since 2006. It is about begging behaviour of owl nestlings. In Zuur (2009a) we applied linear mixed-effects models on it, and in Zuur et al. (2012a) we analysed it with a zero-inflated GLMM. Thanks to R-INLA we finally cracked this data set and apply a zero-inflated GAMM.

In Chapter 21 we analyse sandeel count data. This work came out of a consultancy project that we carried out for Wageningen Marine Research (The Netherlands) in 2017. Although the setup of the experiment is simple (approximately 400 sites sampled once per year, for 4 years), analysing these data and writing this chapter took about 30 days. This should give you an idea about the complexity of the statistical tools (zero-inflated GAMMs + spatial-temporal correlation) that we discuss in this book.

Chapter 22 is about zero-inflated bird densities sampled in the Labrador Sea, located between the Labrador Peninsula (Eastern Canada) and Greenland. This chapter is about the analysis of zero-inflated continuous data with spatial correlation. A zero-altered gamma model with spatial correlation is used.

In Chapter 23 we analyse coral reef data sampled around an island. A lot of misery comes together in this chapter: smoothers, zero-inflation and spatial dependency that should not cross land as benthic species that live in a coral reef do not walk over land! We will discuss barrier models (Bakka et al. 2018) which ensure that spatial correlation seeps around a barrier (in this case an island).

Up to Chapter 23 all data sets analysed were geostatistical data and not areal or lattice data. The reason for this is that most ecological data is geostatistical. In Chapter 24 we analyse aggregated tornado data in 102 counties in Illinois. This is areal data. We will use various CAR models (e.g. iCAR, BYM, BYM2) for zero-inflated spatial and spatial-temporal correlated data.

 

Data and R code VOLUME I

All data is freely available. All the R code is provided as well, except that a password is needed to open the zip files. The password is given in the Preface of Volume I (see page vi). In some chapters we are sourcing our support file HighstatLibV10.R.

 

Data and R code VOLUME II

All data is freely available. All the R code is provided as well, except that a password is needed to open the zip files. The password is given in the Preface of Volume II. In some chapters we are sourcing our support file HighstatLibV11.R (Note on 19 August 2018: Please use HighstatLibV10.R for the moment).

  • Chapter 17: Introduction to Volume II
  • Chapter 18: Zero-inflated models for count data in R-INLA
    • Data used: Skate2.txt.zip. This file is zipped to avoid ftp problems. Just unzip it.
    • R code used: Chapter18.R.zip. The password is given in the Preface of Volume II.
    • Sample pages: Page 365
  • Chapter 19: Spatial correlated and zero-inflated skate data
    • Data used: Will be uploaded in August 2018
    • R code used: Will be uploaded in August 2018
    • Sample pages: Pages 403-404
  • Chapter 20: GAM with correlation and zero-inflation in R-INLA using owl data
    • Data used: Will be uploaded in August 2018
    • R code used: Will be uploaded in August 2018
    • Sample pages: Page 439
  • Chapter 21: GAM for zero-inflated and spatial-temporal correlated sandeel data
    • Data used: Will be uploaded in August 2018
    • R code used: Will be uploaded in August 2018
    • Sample pages: Pages 499-501
  • Chapter 22: Zero-inflated continuous seabird data
    • Data used: Will be uploaded in August 2018
    • R code used: Will be uploaded in August 2018
    • Sample pages: Pages 551-552
  • Chapter 23: Coral reef data and barrier models
    • Data used: Will be uploaded in August 2018
    • R code used: Will be uploaded in August 2018
    • Sample pages: Page 595
  • Chapter 24: Analysis of areal tornado data
    • Data used: Will be uploaded in August 2018
    • R code used: Will be uploaded in August 2018
    • Sample pages: Page 639
  • Appendix A: Creating spatial polygons
    • Data used: Will be uploaded in August 2018
    • R code used: Will be uploaded in August 2018
  • Appendix B: Other models that were considered for the skate data
    • Data used: Will be uploaded in August 2018
    • R code used: Will be uploaded in August 2018

 

Below you can add comments and ask questions.

 

 

 

 

 

Comments (32)

Rated 0 out of 5 based on 0 voters
  1. Alain Zuur

This is a short message from one of the authors of this book; Alain Zuur.

We teach around 25 statistics courses per year, all over the world. For years, participants have been asking for courses on spatial, temporal and spatial-temporal GLMs....

This is a short message from one of the authors of this book; Alain Zuur.

We teach around 25 statistics courses per year, all over the world. For years, participants have been asking for courses on spatial, temporal and spatial-temporal GLMs. It was only when R-INLA became available that we started to add such a module to our courses. A single module became two modules, two modules became a 5-day course....and eventually we wrote this book in 2016.

R-INLA allows the user to apply sophisticated models, but the underlying theory is rather daunting (unless you like integrals). The aim of this book is to make the R-INLA world understandable for a non-technical audience. We hope that we succeeded.

We do get the occasional email complaining about the price of the book. We agree that this is not a cheap book. But what is 89 GBP compared to 3 years of field work? Sometimes you are lucky when you buy a book in the sense that everything you need for the analysis of your own data is in it. We think that this is such a book.

One of the chapters in the book is about storks. They say that storks bring babies. Well...when we wrote the storks chapter in October 2016, my wife found out that she was pregnant from a twin. On 5 June 2017, Aidan and Naila were born. Babies and mother are doing well. Father is doing well too...and has become an expert in nappy changing.

So...storks do bring babies!

Alain

Read More
  Attachments
 
  1. Adam    Alain Zuur
  1. 5 / 5

As someone finishing up my last semester of graduate school, I took a gamble by purchasing this book in hopes that it would help me figure out the best way to analyze my thesis data. The amount of time it has saved me alone is worth the price...

As someone finishing up my last semester of graduate school, I took a gamble by purchasing this book in hopes that it would help me figure out the best way to analyze my thesis data. The amount of time it has saved me alone is worth the price point, not to mention how approachable the explanations are and how thorough the code is for replicating the examples and adapting to personal workflows. My research is more thorough and better looking than I ever could have managed alone.

Excellent books. Cheers to you and your family.

Read More
  Attachments
 
  1. Alain    Adam

Adam....it is always nice to hear that people enjoy our books.

Kind regards,

Alain

  Attachments
 
  1. Marc Girondot

When the book will be fully available ?
The link http://www.highstat.com/Data/White_Stork_Growth_20112012_V2.csv is not valid.
Thanks to put this online.

  Attachments
 
  1. Alain Zuur    Marc Girondot

Marc..thanks. I have updated the link to the white stork data. It is:

http://highstat.com/Books/BGS/SpatialTemp/Data/White_Stork_Growth_20112012_V2.csv

The book is fully available....but I guess your question is when all the R code is...

Marc..thanks. I have updated the link to the white stork data. It is:

http://highstat.com/Books/BGS/SpatialTemp/Data/White_Stork_Growth_20112012_V2.csv

The book is fully available....but I guess your question is when all the R code is available? I got sidetracked with the first chapter of Volume II (a chapter on zero inflated and spatial correlated models in INLA)..but I will try to upload all the R code of Volume I this week.

Kind regards,
Alain

Read More
  Attachments
 
  1. Alain Zuur    Alain Zuur

Friday 14 July 2017: All data sets and all R code has now been uploaded. Please send me an email (highstat@highstat.com) in case a link doesn't work, or if a piece of R does not run.

Alain

  Attachments
 
  1. Alex

Where can I buy the book?

  Attachments
 
  1. Alain Zuur    Alex

At the top left of this page you will see a menu...and the first menu item states: "Order books or E-books". If you click on it, then you will be transferred to:

http://highstat.com/index.php/order-books-or-e-books

This book can only be bought...

At the top left of this page you will see a menu...and the first menu item states: "Order books or E-books". If you click on it, then you will be transferred to:

http://highstat.com/index.php/order-books-or-e-books

This book can only be bought from this link. I will add a credit card logo so that it is more clear.


Kind regards,

Alain

Read More
  Attachments
 
  1. Alain Zuur    Alain Zuur

I have added a VISA/Mastercard pic to make more clear where the book can be bought.

Kind regards,
Alain

  Attachments
 
  1. John T. Finn

I have had problems with the .txt files in Chapters 14 and 15. They come in as only a single record (no carriage returns). I have a Windows computer. The .csv files in Chapter 14 worked fine. Thanks.

  Attachments
 
  1. Alain Zuur    John T. Finn

John...thanks for the comment. I guess going from a Mac OS, to an internet file, and then to your Windows computer has caused some trouble. I have zipped the original files and uploaded these. Please let me know if this does not solve the...

John...thanks for the comment. I guess going from a Mac OS, to an internet file, and then to your Windows computer has caused some trouble. I have zipped the original files and uploaded these. Please let me know if this does not solve the problem.

Kind regards,
Alain

Read More
  Attachments
 
  1. Daniel Câmara

Hi, even though the book and chapters names mention only inla, I'd like to know if the examples are also implemented in jags. Many thanks for your incredible work me. Zuur!

  Attachments
 
  1. Alain Zuur    Daniel Câmara

Dear Daniel,

Doing models with spatial correlation in JAGS is a major challenge.... You could try WinBUGS. But the whole point of INLA is to avoid MCMC. I managed to burn a Macbook while running spatial models in WinBUGS.

We did write a book...

Dear Daniel,

Doing models with spatial correlation in JAGS is a major challenge.... You could try WinBUGS. But the whole point of INLA is to avoid MCMC. I managed to burn a Macbook while running spatial models in WinBUGS.

We did write a book containing lots of JAGS code for GLMs, GLMMs, zero inflated models, beta models, etc. That is this one:

http://highstat.com/index.php/beginner-s-guide-to-zero-inflated-models

But there is no spatial correlation in the zero inflarion book; just JAGS. You could try OpenBUGS for that.
Good to hear you like our books.

Kind regards,
Alain

Read More
  Attachments
  Comment was last edited about 1 year ago by Super User Super User
  1. Daniel Câmara    Alain Zuur

Thanks for your answer mr. Zuur. In fact I didn't know about this problem with spatial correlation in jags. Thanks for explaining this. In fact I use bugs, but I'm not that proficient with it yet. I've had contact with inla some time ago and was...

Thanks for your answer mr. Zuur. In fact I didn't know about this problem with spatial correlation in jags. Thanks for explaining this. In fact I use bugs, but I'm not that proficient with it yet. I've had contact with inla some time ago and was very impressed with its power. I'll be sending an email to you to ask some more questions before I buy this book (which I'm very excited about). Thanks again for your time and kindness!

Read More
  Attachments
 
  1. MB

I can't seem to find the file HighstatLibV10.R mentioned in chapter 2. Can you please point to where it is.

  Attachments
 
  1. Alain Zuur    MB

Sorry..I forgot that we used it. I have uploaded the file and adjusted the text above. You may need to refresh your browser in order to see it.

Note that you need to Right-Mouse click on the link, and select 'Save Link As'. Otherwise it...

Sorry..I forgot that we used it. I have uploaded the file and adjusted the text above. You may need to refresh your browser in order to see it.

Note that you need to Right-Mouse click on the link, and select 'Save Link As'. Otherwise it becomes a *.R.html file, and then you cannot source it.

Alain

Read More
  Attachments
 
  1. Marcello DE GIOSA

Alain,
it seems to me something is wrong with file LaPalma.txt on ch13.
I'm not able to correctly read the file in R. By direct inspection it seems something is lost in the file.
Please, may you check it.

Regards

MDG

Warning message:
In...

Alain,
it seems to me something is wrong with file LaPalma.txt on ch13.
I'm not able to correctly read the file in R. By direct inspection it seems something is lost in the file.
Please, may you check it.

Regards

MDG

Warning message:
In read.table(file = "LaPalma.txt", header = TRUE, dec = ".") :
incomplete final line found by readTableHeader on 'LaPalma.txt'

Read More
  Attachments
 
  1. Alain Zuur    Marcello DE GIOSA

Marcello,
Apologies for the delay in responding; nappy changing duties.
I have uploaded the file again using a different ftp program. I think/hope that it is ok now. Otherwise, I will upload it as an Excel file.

Kind regards,
Alain

  Attachments
 

Could we get the data for chapter 10? something is wrong with most of those files
thanks

  Attachments
 
  1. Alain Zuur   

Fixed.

Alain

  Attachments
 
  1. Gustavo Machado    Alain Zuur

Thank you very much

  Attachments
 
  1. Aaron

The file "snow.csv" seems to be missing for Chapter 2.

  Attachments
 
  1. Daniel    Aaron

Yeah, I can't seem to find it anywhere.

  Attachments
 
  1. Alain Zuur    Daniel

Apologies for the delay. This file has now been uploaded under Chapter 2.

Alain

  Attachments
 
  1. Kousei

I downloaded the R file of chapter 6.
The password written in page vi in the book to open the file does not work ... The password has been changed ?

  Attachments
 
There are no comments posted here yet
Load More

Leave your comments

Posting comment as a guest.
Attachments (0 / 3)
Share Your Location