Introducing Spatial Statistics using the spmodel R Package
On this page:
In scientific disciplines like ecology and environmental science, spatial data (i.e., data that are distributed in space) are common. For spatial data, statistical models incorporating spatial dependence (i.e., spatial models) tend to be more realistic than statistical models ignoring spatial dependence (i.e., nonspatial models). Recent software advances in R's spatial data ecosystem have made spatial models much more accessible to practitioners. Here we focus on the spmodel R package (https://github.com/USEPA/spmodel), which fits, summarizes, and makes predictions for a variety of spatial models. We discuss three reasons why spmodel is an effective tool for introducing (and teaching) spatial statistics: First, spmodel uses a syntactic structure similar to that of familiar base R functions like lm() and glm(); Second, spmodel provides a wide breadth of options that give users a high amount of control over the model being fit; And third, spmodel is compatible with other modern R packages like sf, broom, and emmeans.