Package overview

geostan-package geostan

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

predict(<geostan_fit>)

Predict method for geostan_fit models

print(<geostan_fit>) plot(<geostan_fit>)

print or plot a fitted geostan model

residuals(<geostan_fit>) fitted(<geostan_fit>) spatial()

Extract residuals, fitted values, or the spatial trend

as.matrix(<geostan_fit>) as.data.frame(<geostan_fit>) as.array(<geostan_fit>)

Extract samples from a fitted model

sp_diag()

Spatial data diagnostics

posterior_predict()

Draw samples from the posterior predictive distribution

uniform() normal() student_t() gamma2() 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

eigen_grid()

Eigenvalues of a spatial weights matrix: raster analysis

get_shp()

Download shapefiles

make_EV()

Extract eigenfunctions of a connectivity matrix for spatial filtering

prep_car_data()

Prepare data for the CAR model

prep_car_data2()

Prepare data for the CAR model: raster analysis

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

prep_sar_data2()

Prepare data for SAR model: raster analysis

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() gamma2() 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