spmodel Workshop
Introduction
Hello đź‘‹ and welcome! The purpose of this site is to provide workshop materials for the spmodel
workshop at the 2023 Spatial Statistics Conference 🌎. Slides that accompany this workshop are available for download linked here. Slides that accompany a short presentation given elsewhere at the conference are available for download linked here. Slides are downloaded by clicking the “Download raw file” button via the ellipsis or downward arrow symbol on the right side of the screen.
What is spmodel
? The spmodel
R
package (Dumelle, Higham, and Ver Hoef 2023) can be used to fit, summarize, and predict for a variety of spatial statistical models. Some of the things that spmodel
can do include:
- Fit spatial linear and generalized linear models for point-referenced and areal (lattice) data
- Compare model fits and inspect model diagnostics
- Predict at unobserved spatial locations (i.e., Kriging)
- And much more!
Why use spmodel
? There are many great spatial modeling packages in R
. A few reasons to use spmodel
for spatial analysis are that:
-
spmodel
syntax is similar to baseR
syntax for functions likelm()
,glm()
,summary()
, andpredict()
, making the transition from fitting non-spatial models to spatial models relatively seamless. - There are a wide variety of
spmodel
capabilities that give the user significant control over the specific spatial model being fit. -
spmodel
is compatible with other modernR
packages likebroom
andsf
.
Throughout the rest of these materials, we introduce spmodel
through a few applied examples. We connect basic summary output with the spatial linear model for both point-referenced and areal (lattice) data. We discuss prediction and generalized linear spatial models for response variables whose distribution is not Gaussian. Along the way, we mention a few other advanced spmodel
features.
Workshop Summary. The spmodel
R
package can be used to fit, summarize, and predict for a variety of spatial statistical models for both point-referenced and areal spatial data. What distinguishes spmodel
from many other R
packages for modeling spatial data is (1) a syntactic structure similar to the syntactic structure of base R
functions lm()
and glm()
that makes spmodel
relatively easy to learn, (2) the breadth of options that give the user a high amount of control over the model being fit, and (3) compatibility with other modern R
packages like broom
and sf
. By the end of this workshop, participants can expect to be able to use spmodel
to fit spatial linear models for point-referenced and areal (lattice) data, make predictions for unobserved spatial locations, fit anisotropic models for point-referenced data, fit spatial models with additional non-spatial random effects, fit generalized linear models for spatial data, and use big data methods to analyze large spatial data sets. More information on spmodel
can be found on our website at https://usepa.github.io/spmodel/.
Set Up
The packages that we use throughout this bundle include spmodel
and ggplot2
. To install and load them, run
install.packages("spmodel")
library(spmodel)
install.packages("ggplot2")
library(ggplot2)
Citation Information
If you use spmodel
in a formal report or publication, please cite it:
citation(package = "spmodel")
To cite spmodel in publications use:
Dumelle M, Higham M, Ver Hoef JM (2023). spmodel: Spatial statistical
modeling and prediction in R. PLOS ONE 18(3): e0282524.
https://doi.org/10.1371/journal.pone.0282524
A BibTeX entry for LaTeX users is
@Article{,
title = {{spmodel}: Spatial statistical modeling and prediction in {R}},
author = {Michael Dumelle and Matt Higham and Jay M. {Ver Hoef}},
journal = {PLOS ONE},
year = {2023},
volume = {18},
number = {3},
pages = {1--32},
doi = {10.1371/journal.pone.0282524},
url = {https://doi.org/10.1371/journal.pone.0282524},
}
The spmodel
journal article associated with the citation is linked here.
Disclaimer
The views expressed in this manuscript are those of the authors and do not necessarily represent the views or policies of the U.S. Environmental Protection Agency or the U.S. National Oceanic and Atmospheric Administration. Any mention of trade names, products, or services does not imply an endorsement by the U.S. government, the U.S. Environmental Protection Agency, or the U.S. National Oceanic and Atmospheric Administration. The U.S. Environmental Protection Agency and the U.S. National Oceanic and Atmospheric Administration do not endorse any commercial products, services, or enterprises.