Package: RSTr 1.2.0

David DeLara

RSTr: Gibbs Samplers for Discrete Bayesian Spatiotemporal Models

Takes Poisson or Binomial discrete spatial data and runs a Gibbs sampler for a variety of Spatiotemporal Conditional Autoregressive (CAR) models. Includes measures to prevent estimate over-smoothing through a restriction of model informativeness for select models. Also provides tools to load output and get median estimates. Implements methods from Besag, York, and Mollié (1991) "Bayesian image restoration, with two applications in spatial statistics" <doi:10.1007/BF00116466>, Gelfand and Vounatsou (2003) "Proper multivariate conditional autoregressive models for spatial data analysis" <doi:10.1093/biostatistics/4.1.11>, Quick et al. (2017) "Multivariate spatiotemporal modeling of age-specific stroke mortality" <doi:10.1214/17-AOAS1068>, and Quick et al. (2021) "Evaluating the informativeness of the Besag-York-Mollié CAR model" <doi:10.1016/j.sste.2021.100420>.

Authors:David DeLara [aut, cre], Centers for Disease Control and Prevention [aut, cph]

RSTr_1.2.0.tar.gz
RSTr_1.2.0.zip(r-4.7-x86_64)RSTr_1.2.0.zip(r-4.7-arm64)RSTr_1.2.0.zip(r-4.6-x86_64)RSTr_1.2.0.zip(r-4.6-arm64)RSTr_1.2.0.zip(r-4.5-x86_64)
RSTr_1.2.0.tgz(r-4.6-x86_64)RSTr_1.2.0.tgz(r-4.6-arm64)RSTr_1.2.0.tgz(r-4.5-x86_64)RSTr_1.2.0.tgz(r-4.5-arm64)
RSTr_1.2.0.tar.gz(r-4.7-arm64)RSTr_1.2.0.tar.gz(r-4.7-x86_64)RSTr_1.2.0.tar.gz(r-4.6-arm64)RSTr_1.2.0.tar.gz(r-4.6-x86_64)
RSTr_1.2.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
RSTr/json (API)

# Install 'RSTr' in R:
install.packages('RSTr', repos = c('https://cehi-code-repos.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/cehi-code-repos/rstr/issues

Pkgdown/docs site:https://cehicapacitybuilding.org

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:
  • maexample - Massachusetts Heart Attack Mortality Data
  • mamap - Massachusetts Shapefile
  • miadj - Michigan Adjacency Data
  • miheart - Michigan Heart Attack Mortality Data
  • minsample - Samples Generated for Michigan data
  • minsplit - Age- and Sex-stratified Samples for Michigan data
  • mishp - Michigan Shapefile

On CRAN:

Conda:

openblascppopenmp

6.70 score 1 stars 26 scripts 442 downloads 19 exports 21 dependencies

Last updated from:8eaf073135. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK200
linux-devel-x86_64OK217
source / vignettesOK283
linux-release-arm64OK165
linux-release-x86_64OK188
macos-release-arm64OK207
macos-release-x86_64OK484
macos-oldrel-arm64OK230
macos-oldrel-x86_64OK440
windows-devel-arm64OK410
windows-devel-x86_64OK316
windows-release-arm64OK404
windows-release-x86_64OK266
windows-oldrel-x86_64OK195
wasm-releaseOK163

Exports:add_neighborsage_standardizeaggregate_countaggregate_samplescarget_credible_intervalget_estimatesget_mediansget_relative_precisionload_modelload_sampleslong_to_list_matrixmcarmstcarrcarsplit_sample_groupsstandardize_samplessuppress_estimatesupdate_model

Dependencies:abindbootclassclassIntDBIdeldire1071KernSmoothlatticematrixStatsproxyRcppRcppArmadilloRcppDists2sfspspDataspdepunitswk

An Introduction to the RSTr Package
Overview | Models | Example workflow with the MSTCAR model | Data preparation | Event/population data | Adjacency information | Running the model | Estimate extraction | Age-standardization | Estimate suppression | Illustrative Example: Mapping Estimates | Closing Thoughts

Last update: 2026-04-28
Started: 2024-10-24

02: Understanding and Preparing Your Adjacency Structure
Overview | Requirements | Example: Massachusetts Map Data | Closing Thoughts

Last update: 2026-01-29
Started: 2025-11-21

04: Generating Estimates: Age-standardization
Overview | The get_estimates() function | The age_standardization() function | Final thoughts

Last update: 2026-01-29
Started: 2025-12-08

05: Generating Estimates: Reliability and Suppression
Overview | Traceplots | Final thoughts

Last update: 2026-01-29
Started: 2025-12-08

06: Model Informativeness
Overview | How does spatial smoothing work? | Model informativeness | The Restricted CAR (RCAR) model | Restricted models and age-standardization | The RCAR Model, Reliability, and Suppression | Choosing between restricted vs unrestricted models | Future developments | Final thoughts

Last update: 2026-01-29
Started: 2025-12-08

07: Sample Processing
Overview | The load_samples() function | Group aggregation | Age-standardization | Estimates and Reliability | Closing Thoughts

Last update: 2026-01-29
Started: 2024-10-24

01: Understanding and Preparing Your Event Data
Overview | Requirements | Example: CDC WONDER dataset | Data setup for other models | Closing Thoughts

Last update: 2026-01-12
Started: 2024-10-24

08: Initial Values
Overview | Initial value specifications | Initial values for the MSTCAR model | Initial values for the MCAR model | Initial values for the CAR/RCAR model

Last update: 2026-01-12
Started: 2025-12-04

03: The CAR Models
Overview | The *car() functions | The CAR model | The RCAR model | The MCAR model | The MSTCAR model | Arguments of the *car() function | The inits argument | The priors argument | The method argument | m0 and A | The update_rho argument | The seed argument | The ignore_checks argument | Closing Thoughts

Last update: 2025-12-23
Started: 2025-12-04

09: Priors
Overview | Prior specifications | Priors for the MSTCAR model | Priors for the MCAR model | Priors for the CAR/RCAR model

Last update: 2025-12-18
Started: 2025-12-04

Appendix A: The CAR Hierarchical Models
Overview | The CAR Hierarchical Model | The MCAR Hierarchical Model | The MSTCAR Hierarchical Model

Last update: 2025-12-18
Started: 2024-10-24

Appendix B: Troubleshooting
Overview | Generic errors and warnings | Errors and warnings with list data | Errors and warnings with list sp_data | inits and priors | ignore_checks

Last update: 2025-12-17
Started: 2024-10-24