The ‘geostan’ R package


Donegan, Connor (2022). geostan: An R package for Bayesian spatial analysis. The Journal of Open Source Software 7, no. 79: 4716 DOI:10.21105/joss.04716

DOI

The geostan R package supports a complete spatial analysis workflow with Bayesian models for areal or network data, including a suite of functions for visualizing spatial data and model results. The package implements models for spatial regression and spatial econometrics as well as hierarchical models for count data (i.e., `disease mapping'). Users can model censored outcomes—a common feature of vital statistics and disease registry data—and access spatial measurement error models, designed for working with American Community Survey (ACS) estimates. The models were built using the probabilistic programming language Stan. A tutorial on space-time modeling in Stan and a package vignette on building custom spatial models provide guidance for those who are interested in using geostan's custom probability density functions in their own Stan models.

Online documentation: connordonegan.github.io/geostan

Introduction to the package: Spatial analysis with geostan

Donegan, Connor (2021). Building spatial conditional autoregressive (CAR) models in the Stan programming language. OSF Preprints. DOI:10.31219/osf.io/3ey65

Donegan, Connor, Yongwan Chun and Daniel A. Griffith (2021). Modeling community health with areal data: Bayesian inference with survey standard errors and spatial structure International Journal of Environmental Research and Public Health 18, no. 13: 6856. DOI:10.3390/ijerph18136856 Supplementary material: https://github.com/ConnorDonegan/survey-HBM.

Donegan, Connor, Yongwan Chun and Amy E. Hughes (2020). Bayesian estimation of spatial filters with Moran's eigenvectors and hierarchical shrinkage priors. Spatial Statistics 38: 100450. DOI:10.1016/j.spasta.2020.100450 Pre-print URL: https://osf.io/fah3z/

The ‘surveil’ R package

Donegan, Connor, Amy E Hughes and Simon J Craddock Lee (2022). Colorectal Cancer Incidence, Inequalities, and Prevention Priorities in Urban Texas: Surveillance Study with the "surveil" software package. JMIR Public Health & Surveillance 8, no. 8: e34589 DOI:10.2196/34589 PMID:35972778

The surveil R package provides time series models for routine public health monitoring tasks: model time trends in mortality or disease incidence rates to make inferences about levels of risk, cumulative and period percent change, age-standardized rates, and health inequalities. This software provides an accessible alternative to joinpoint regression. Basic usage requires introductory-level R programming skills.

Demonstration: Modeling time trends for disease monitoring studies

Online documentation: connordonegan.github.io/surveil

Donegan, Connor, Amy E Hughes and Simon J Craddock Lee (2022). Time Series Models for Public Health Surveillance: Colorectal Cancer Incidence, Inequalities, and Prevention Priorities in Urban Texas. Poster presentation to the Interdisciplinary Association of Population Health Science (IAPHS), Minneapolis, MN. Poster PDF.

R/Stan code

Donegan, Connor (2021). "Building spatial conditional autoregressive (CAR) models in the Stan programming language." OSF Preprints. DOI: 10.31219/osf.io/3ey65 Supplementary material: https://osf.io/ewxut/.

This paper provides computationally efficient R and Stan code for building spatial conditional autoregressive (CAR) models in Stan. The paper details various CAR model specifications and provides a comparison to Nimble in terms of sampling efficiency (with about 10-fold improvement over Nimble). The paper provides a demonstration analysis of county mortality data (including censored observations). This shows how the geostan R package can facilitate the process of building custom spatial models in Stan. (This work has since been revised and extended to include the simultaneous spatial autoregressive (SAR) models, now implemented in geostan.)

Donegan, Connor and Mitzi Morris (2021). "Flexible functions for ICAR, BYM, and BYM2 models in Stan.” Code repository. https://github.com/ConnorDonegan/Stan-IAR

This code repository contains a set of functions in the R and Stan programming languages that make it easier to implement the BYM and BYM2 spatial models in RStan. The code addresses multiple challenges that arise when using a disconnected graph structure with the intrinsic conditional autoregressive model. The functions support the construction of custom spatial models in Stan, and are also used by the geostan R package.