Package overview

geostan-package

The geostan R package.

Spatial analysis

Functions for measuring and visualizing spatial autocorrelation and dispersion, including model diagnostics

aple()

Spatial autocorrelation estimator

expected_mc()

Expected value of the residual Moran coefficient

gr()

The Geary Ratio

lg()

Local Geary

lisa()

Local Moran's I

mc()

The Moran coefficient

me_diag()

Data model diagnostics

moran_plot()

Moran plot

n_eff()

Effective sample size

sp_diag()

Spatial data diagnostics

row_standardize()

Row-standardize a matrix; safe for zero row-sums.

Models

Model fitting functions and methods

stan_car()

Conditional autoregressive (CAR) models

stan_esf()

Spatial filtering

stan_glm()

Generalized linear models

stan_icar()

Intrinsic autoregressive models

stan_sar()

Simultaneous autoregressive (SAR) models

print(<geostan_fit>) plot(<geostan_fit>) as.matrix(<geostan_fit>) as.data.frame(<geostan_fit>) as.array(<geostan_fit>) residuals(<geostan_fit>) fitted(<geostan_fit>) spatial() predict(<geostan_fit>)

geostan_fit methods

sp_diag()

Spatial data diagnostics

posterior_predict()

Draw samples from the posterior predictive distribution

uniform() normal() student_t() gamma() hs()

Prior distributions

Convenience functions

Tools for working with spatial data and geostan models

auto_gaussian()

Auto-Gaussian family for CAR models

edges()

Edge list

get_shp()

Download shapefiles

make_EV()

Extract eigenfunctions of a connectivity matrix for spatial filtering

prep_car_data()

Prepare data for a Stan CAR model

prep_icar_data()

Prepare data for ICAR models

prep_me_data()

Prepare data for spatial measurement error models

prep_sar_data()

Prepare data for a simultaneous autoregressive (SAR) model

se_log()

Standard error of log(x)

shape2mat()

Create spatial and space-time connectivity matrices

sim_sar()

Simulate spatially autocorrelated data

uniform() normal() student_t() gamma() hs()

Prior distributions

waic()

Widely Applicable Information Criteria (WAIC)

Data

georgia

Georgia all-cause, sex-specific mortality, ages 55-64, years 2014-2018

sentencing

Florida state prison sentencing counts by county, 1905-1910