21Spatial Statistics

Spatial statistics enables us to build models for data that are set in more than one dimension; for instance, the spread of mould on the surface of a piece of cheese in two dimensions or the locations of galaxies in three dimensions. The critical issue is that what goes on at one location might affect what happens nearby. There are two kinds of data sets that we will explore here:

  • data which occur at specific points, e.g. trees in a forest or crimes on a map, and are known as spatial point patterns;
  • data that take values across the whole of the space, e.g. pollution levels in a city, and are known as geospatial statistics, from their origin in mining.

We are interested in modelling the location and, possibly, the value of the data at specific points or over an area. We will just give a flavour of the possible analyses.

Modelling using spatial statistics usually requires extra images packages and a list of these is given at https://cran.r-project.org/web/views/Spatial.html. This should give some idea of the range of functionality and techniques encompassed by spatial statistics. There are also some links to data sources.

21.1 Spatial point processes

If our data form a spatial point pattern, then we model them using spatial point processes. For most of this section, we will use the spatstat package (Baddeley et al., 2015a) to examine the data and build those ...

Get The R Book, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.