Spatial Regression Analysis
Overview
A collection of all the estimation functions for spatial cross-sectional models (on lattice/areal data using spatial weights matrices) contained up to now in 'spdep'. These model fitting functions include maximum likelihood methods for cross-sectional models proposed by 'Cliff' and 'Ord' (1973, ISBN:0850860369) and (1981, ISBN:0850860814), fitting methods initially described by 'Ord' (1975) doi:10.1080/01621459.1975.10480272. The models are further described by 'Anselin' (1988) doi:10.1007/978-94-015-7799-1. Spatial two stage least squares and spatial general method of moment models initially proposed by 'Kelejian' and 'Prucha' (1998) doi:10.1023/A:1007707430416 and (1999) doi:10.1111/1468-2354.00027 are provided. Impact methods and MCMC fitting methods proposed by 'LeSage' and 'Pace' (2009) doi:10.1201/9781420064254 are implemented for the family of cross-sectional spatial regression models. Methods for fitting the log determinant term in maximum likelihood and MCMC fitting are compared by 'Bivand et al.' (2013) doi:10.1111/gean.12008, and model fitting methods by 'Bivand' and 'Piras' (2015) doi:10.18637/jss.v063.i18; both of these articles include extensive lists of references. A recent review is provided by 'Bivand', 'Millo' and 'Piras' (2021) doi:10.3390/math9111276. 'spatialreg' >= 1.1-* corresponded to 'spdep' >= 1.1-1, in which the model fitting functions were deprecated and passed through to 'spatialreg', but masked those in 'spatialreg'. From versions 1.2-*, the functions have been made defunct in 'spdep'. From version 1.3-6, add Anselin-Kelejian (1997) test to `stsls` for residual spatial autocorrelation doi:10.1177/016001769702000109.
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-22
- ERROR12 OK, 1 ERROR2026-07-21
- OK13 OK2026-06-09
Show 6 earlier changesHide 6 earlier changes
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-26
- NOTE11 OK, 3 NOTE2026-03-22
- WARNING10 OK, 3 NOTE, 1 WARNING2026-03-21
- NOTE13 OK, 1 NOTE2026-03-17
- OK14 OK2026-03-10
Documentation
- Help pages
- 26
- Examples that run
- 92%24 run in a plain check · 2 never run
- Exported functions with examples
- 100%
- Documented parameters
- 90%
- Return-value docs
- 88%
- Help pages citing references
- 85%
Downloads
Repository
- PRs merged (all time)
- 85%
- Median days to close, 50 most recently updated closed issues
- 86
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Issues over time
PRs over time
4 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/r-spatial/spatialreg on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Installing spatialreg adds 28 packages (17 with compiled code, 51 MB of source tarballs). Heaviest: sf 9.3 MB, TH.data 8.2 MB, data.table 5.7 MB.
Show all 31 packagesHide all 31 packages
Code & Tests
People & History
Show 13 more contributorsHide 13 contributors
Show 4 peopleHide 4 people
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 1.4-3Latest
- 1.4-22025-09-06 · diff ↗
- 1.4-12025-09-04 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 1.3-62024-12-02 · diff ↗
- 1.3-52024-08-19 · diff ↗
- 1.3-42024-06-10 · diff ↗
- 1.3-32024-05-31 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 1.3-22024-02-06 · diff ↗
- 1.3-12023-11-23 · diff ↗
- 1.2-92023-05-25 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 1.2-82023-03-01 · diff ↗
- 1.2-62022-10-07 · diff ↗
Show 11 earlier eventsHide 11 earlier events
- 1.2-52022-08-16 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 1.2-32022-04-18 · diff ↗
- 1.2-1
- RR 4.1.0 released · 2021-05-18
- 1.1-82021-05-03 · diff ↗ ·
removed 70 exports
print.stsls, summary.stsls, print.summary.stsls, residuals.stsls, coef.stsls, deviance.stsls, impacts.stsls, residuals.gmsar, deviance.gmsar, coef.gmsar, fitted.gmsar, print.gmsar, summary.gmsar, print.summary.gmsar, impacts.gmsar, LR1.lagmess, coef.lagmess, deviance.lagmess, fitted.lagmess, impacts.lagmess, logLik.lagmess, print.lagmess, print.summary.lagmess, residuals.lagmess, summary.lagmess, print.SFResult, fitted.SFResult, print.ME_res, fitted.ME_res, LR.sarlm and 40 moreadded 6 exports
bptest.Sarlm, LR.Sarlm, LR1.Sarlm, Wald1.Sarlm, LR1.Spautolm, LR1.Lagmess - RR 4.0.0 released · 2020-04-24
- 1.1-52019-12-02 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 1.1-32019-04-01
- RR 3.5.0 released · 2018-04-23
Package metadata
- First published
- 2019-04-01
- Total releases
- 18 / 7 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 3.3
- Download size
- 1.4 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("spatialreg")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.3390/math9111276, 10.18637/jss.v063.i18, 10.1111/gean.12008.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.