R packages


Donegan, Connor (2021). “surveil: Public health surveillance.” R package version 0.1.0. https://connordonegan.github.io/surveil/

The surveil R package provides time series models for routine public health surveillance 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.


Donegan, Connor (2021). “geostan: Bayesian spatial analysis.” R package version 0.2.0. https://connordonegan.github.io/geostan/

The geostan R package supports a complete spatial analysis workflow with Bayesian models for areal data, including a suite of functions for visualizing spatial data and model results. 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 package offers spatial methods suitable for modeling both count and continuous outcome data types.


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 demonstrates how users can use the geostan R package to facilitate the process of building custom spatial models in Stan. A demonstration analysis of county mortality rates also shows how to adjust for censored count data.

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.