Package: geostan 0.8.2

Connor Donegan

geostan: Bayesian Spatial Analysis

For spatial data analysis; provides exploratory spatial analysis tools, spatial regression, spatial econometric, and disease mapping models, model diagnostics, and special methods for inference with small area survey data (e.g., the America Community Survey (ACS)) and censored population health monitoring data. Models are pre-specified using the Stan programming language, a platform for Bayesian inference using Markov chain Monte Carlo (MCMC). References: Carpenter et al. (2017) <doi:10.18637/jss.v076.i01>; Donegan (2021) <doi:10.31219/osf.io/3ey65>; Donegan (2022) <doi:10.21105/joss.04716>; Donegan, Chun and Hughes (2020) <doi:10.1016/j.spasta.2020.100450>; Donegan, Chun and Griffith (2021) <doi:10.3390/ijerph18136856>; Morris et al. (2019) <doi:10.1016/j.sste.2019.100301>.

Authors:Connor Donegan [aut, cre], Mitzi Morris [ctb], Amy Tims [ctb]

geostan_0.8.2.tar.gz
geostan_0.8.2.zip(r-4.7-x86_64)geostan_0.8.2.zip(r-4.7-arm64)geostan_0.8.2.zip(r-4.6-x86_64)geostan_0.8.2.zip(r-4.6-arm64)
geostan_0.8.2.tar.gz(r-4.7-arm64)geostan_0.8.2.tar.gz(r-4.7-x86_64)geostan_0.8.2.tar.gz(r-4.6-arm64)geostan_0.8.2.tar.gz(r-4.6-x86_64)
geostan_0.8.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
geostan/json (API)

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

Bug tracker:https://github.com/connordonegan/geostan/issues

Pkgdown/docs site:https://connordonegan.github.io

Uses libs:
  • onetbb– Parallelism library for C++
  • c++– GNU Standard C++ Library v3
Datasets:
  • georgia - Georgia all-cause, sex-specific mortality, ages 55-64, years 2014-2018
  • sentencing - Florida state prison sentencing counts by county, 1905-1910

On CRAN:

Conda:

onetbbcpp

4.40 score 84 scripts 543 downloads 43 exports 68 dependencies

Last updated from:dbceb1fd53. Checks:8 NOTE, 2 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-arm64NOTE331
linux-devel-x86_64NOTE401
source / vignettesOK407
linux-release-arm64NOTE317
linux-release-x86_64NOTE402
windows-devel-arm64NOTE441
windows-devel-x86_64NOTE487
windows-release-arm64NOTE444
windows-release-x86_64NOTE421
wasm-releaseOK189

Exports:apleauto_gaussiandicedgeseigen_gridexpected_mcgamma2get_shpgrhsimpactslglisalog_likmake_EVmcme_diagmoran_plotn_effn_nbsnormalposterior_predictprep_car_dataprep_car_data2prep_icar_dataprep_me_dataprep_sar_dataprep_sar_data2row_standardizese_logshape2matsim_sarsp_diagspatialspillstan_carstan_esfstan_glmstan_icarstan_sarstudent_tuniformwaic

Dependencies:abindbackportsBHbootcallrcheckmateclassclassIntclicpp11DBIdeldirdescdistributionale1071farvergenericsggplot2gluegridExtragtableinlineisobandKernSmoothlabelinglatticelifecycleloomagrittrMASSMatrixmatrixStatsnumDerivotelpillarpkgbuildpkgconfigposteriorprocessxproxypsQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelrlangrstanrstantoolss2S7scalessfsignsspspDataspdepStanHeaderstensorAtibbletruncnormunitsutf8vctrsviridisLitewithrwk

Custom spatial models with RStan and geostan
CAR models | Autonormal model | Hierarchical model | Zero-mean parameterization | SAR models | References

Last update: 2025-07-16
Started: 2023-10-05

Raster regression
Demonstration | Discussion | Simulating spatial data | References

Last update: 2024-12-04
Started: 2023-05-29

Spatial analysis with geostan
Summary | Installation | From github | From CRAN | Getting started | Adjacency matrix | Non-spatial regression | MCMC output | Methods | Spatial regression | A filtering approach | A bivariate model | Predicted values | Future work and support | Appendix | References

Last update: 2024-12-04
Started: 2024-11-16

Exploratory spatial data analysis
Getting started | Exploratory spatial data analysis (ESDA) | Spatial diagnostic summary | Spatial weights matrix | The Moran scatter plot | The Moran coefficient (MC) | The Geary ratio (GR) | Local indicators of spatial association (LISAs) | Effective sample size | Model diagnostics | References

Last update: 2024-11-16
Started: 2022-02-09

Spatial measurement error models
Modeling errors of observation | Discussion | Getting started | Preparing the data | Spatial ME model | Visual diagnostics | Working with MCMC samples from ME models | Non-spatial ME models | Multiple covariates | Log transforms | References

Last update: 2024-11-16
Started: 2022-02-09

Spatial weights matrix
Getting started | Contiguity | Visualizing connectivity | K-nearest neighbors | Row-standardized matrix | Editing the matrix | Using the matrix

Last update: 2024-06-05
Started: 2024-05-11

Readme and manuals

Help Manual

Help pageTopics
The geostan R package.geostan-package geostan
Spatial autocorrelation estimatoraple
Extract samples from a fitted modelas.array.geostan_fit as.data.frame.geostan_fit as.matrix.geostan_fit
Auto-Gaussian family for CAR modelsauto_gaussian
Edge listedges
Eigenvalues of a spatial weights matrix: for spatial regression with raster dataeigen_grid
Expected value of the residual Moran coefficientexpected_mc
Georgia all-cause, sex-specific mortality, ages 55-64, years 2014-2018georgia
Download shapefilesget_shp
The Geary Ratiogr
Local Gearylg
Local Moran's Ilisa
Extract log-likelihoodlog_lik log_lik.geostan_fit
Prepare data for spatial filteringmake_EV
The Moran coefficient (Moran's I)mc
Measurement error model diagnosticsme_diag
Moran scatter plotmoran_plot
Effective sample sizen_eff
Count neighbors in a connectivity matrixn_nbs
Sample from the posterior predictive distributionposterior_predict
Predict method for 'geostan_fit' modelspredict.geostan_fit
Prepare data for the CAR modelprep_car_data
Prepare data for the CAR model: raster analysisprep_car_data2
Prepare data for ICAR modelsprep_icar_data
Prepare data for spatial measurement error modelsprep_me_data
Prepare data for a simultaneous autoregressive (SAR) modelprep_sar_data
Prepare data for SAR model: raster analysisprep_sar_data2
print or plot a fitted geostan modelplot.geostan_fit print.geostan_fit
Prior distributionsgamma2 hs normal priors student_t uniform
Extract residuals, fitted values, or the spatial trendfitted.geostan_fit residuals.geostan_fit spatial spatial.geostan_fit
Row-standardize a matrix; safe for zero row-sums.row_standardize
Standard error of log(x)se_log
Florida state prison sentencing counts by county, 1905-1910sentencing
Create spatial and space-time connectivity matricesshape2mat
Simulate spatially autocorrelated datasim_sar
Visual displays of spatial data and spatial modelssp_diag sp_diag.geostan_fit sp_diag.numeric
Spillover/diffusion effects for spatial lag modelsimpacts print.impacts_slm spill
Conditional autoregressive (CAR) modelsstan_car
Spatial filteringstan_esf
Generalized linear modelsstan_glm
Intrinsic autoregressive modelsstan_icar
Simultaneous autoregressive (SAR) modelsstan_sar
Model comparisondic waic