SpatialInference: Tools for Statistical Inference with Geo-Coded Data

Fast computation of Conley (1999) <doi:10.1016/S0304-4076(98)00084-0> spatial heteroskedasticity and autocorrelation consistent (HAC) standard errors for linear regression models with geo-coded data, with a fast C++ implementation by Christensen, Hartman, and Samii (2021) <doi:10.1017/S0020818321000187>. Performance-critical distance calculations, kernel weighting, and variance component accumulation are implemented in C++ via 'Rcpp' and 'RcppArmadillo'. Includes tools for estimating the spatial correlation range from covariograms and correlograms following the bandwidth selection method proposed in Lehner (2026) <doi:10.48550/arXiv.2603.03997>, and diagnostic visualizations for bandwidth selection.

Version: 0.1.0
Depends: R (≥ 4.1.0)
Imports: Rcpp, sf, data.table, magrittr, stats, tibble
LinkingTo: Rcpp, RcppArmadillo
Suggests: lfe, fixest, dplyr, stringr, spdep, ncf, gstat, sandwich, ggplot2, modelsummary, knitr, rmarkdown, geosphere, testthat (≥ 3.0.0)
Published: 2026-03-25
DOI: 10.32614/CRAN.package.SpatialInference (may not be active yet)
Author: Alexander Lehner ORCID iD [aut, cre]
Maintainer: Alexander Lehner <alehner at worldbank.org>
BugReports: https://github.com/axlehner/SpatialInference/issues
License: GPL (≥ 3)
URL: https://github.com/axlehner/SpatialInference
NeedsCompilation: yes
Materials: README, NEWS
CRAN checks: SpatialInference results

Documentation:

Reference manual: SpatialInference.html , SpatialInference.pdf
Vignettes: spatial_HAC (source, R code)

Downloads:

Package source: SpatialInference_0.1.0.tar.gz
Windows binaries: r-devel: SpatialInference_0.1.0.zip, r-release: not available, r-oldrel: not available
macOS binaries: r-release (arm64): SpatialInference_0.1.0.tgz, r-oldrel (arm64): not available, r-release (x86_64): SpatialInference_0.1.0.tgz, r-oldrel (x86_64): SpatialInference_0.1.0.tgz

Linking:

Please use the canonical form https://CRAN.R-project.org/package=SpatialInference to link to this page.