Heterogeneous Spatial Models
Overview
Spatial heterogeneity can be specified in various ways. 'hspm' is an ambitious project that aims at implementing various methodologies to control for heterogeneity in spatial models. The current version of 'hspm' deals with spatial and (non-spatial) regimes models. In particular, the package allows to estimate a general spatial regimes model with additional endogenous variables, specified in terms of a spatial lag of the dependent variable, the spatially lagged regressors, and, potentially, a spatially autocorrelated error term. Spatial regime models are estimated by instrumental variables and generalized methods of moments (see Arraiz et al., (2010) doi:10.1111/j.1467-9787.2009.00618.x, Bivand and Piras, (2015) doi:10.18637/jss.v063.i18, Drukker et al., (2013) doi:10.1080/07474938.2013.741020, Kelejian and Prucha, (2010) doi:10.1016/j.jeconom.2009.10.025).
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 6
- Examples that run
- 100%3 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 97%
- Return-value docs
- 100%
- Help pages citing references
- 17%
Downloads
Repository
- PRs merged (all time)
- 67%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 1
1 development-tooling and community-health practice detected across 1 family in the upstream repository
Checks run against github.com/gpiras/hspm on 2026-10-21.
Dependencies
Installing hspm adds 37 packages (23 with compiled code, 66 MB of source tarballs). Heaviest: stringi 11 MB, sf 9.3 MB, TH.data 8.2 MB.
CRAN will archive these unless their check problems are fixed by the date shown. This package needs each one to install.
- insight through sphet → spatialreg → marginaleffectsfix by Nov 14
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 1.1Latest
- 1.0-02022-11-18
- RR 4.2.0 released · 2022-04-22
Package metadata
- First published
- 2022-11-18
- Total releases
- 2 / 4 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 4.0
- Bundled data
- 974 KB / 3 files
- Download size
- 1.0 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("hspm")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.