Spatial persistence tooling, in one place¶
spatial-spur is the shared documentation hub for the SPUR and SCPC package
family across Python, R, and Stata.
This site documents the Becker, Boll and Voth (2026) implementation of the spatial unit root procedure introduced in Müller and Watson (2024).
spur-skills
Install the shared skills that help agents navigate the ecosystem.
RspuR
R-side docs for SPUR diagnostics and related workflow guidance.
Pythonspur-python
Python docs for running SPUR in a modern workflow.
Stataspur-stata
Stata docs for the original SPUR workflow and parity-oriented usage.
RscpcR
R docs for SCPC inference, model support, and result interpretation.
Pythonscpc-python
Python docs for SCPC workflows alongside the broader SPUR toolchain.
Quick start¶
To get started, just point your favorite coding-agent at the spur-skills installation instructions:
codex --dangerously-bypass-approvals-and-sandbox "Install spur-skills by following https://github.com/spatial-spur/spur-skills#install, then inspect the spatial-analysis skill and provide the user with a very short two-section overview: 1) how to apply the spur procedure using the spur() Python wrapper as minimal example, 2) an itemized list of what the applied tests actually do. focus on clarity and brevity"
claude --dangerously-skip-permissions "Install spur-skills by following https://github.com/spatial-spur/spur-skills#install, then inspect the spatial-analysis skill and provide the user with a very short two-section overview: 1) how to apply the spur procedure using the spur() Python wrapper as minimal example, 2) an itemized list of what the applied tests actually do. focus on clarity and brevity"
spur-skills give your agent all relevant context on the ecosystem. After installation, ask your agent anything spur-related and it should know where to find the answer.
Spatial unit roots¶
Mueller-Watson (MW) (2024) show that in many empirical settings, the decay rate of spatial dependence is so slow
that standard techniques like HAC error corrections do not suffice to prevent spurious regression results. Drawing
on time-series econometrics, they call such settings spatial unit roots and propose and develop the spatial equivalent
to an I(0) and I(1) unit-root tests and first-differencing transformations as solutions.
Consider the interactive example below, where we simulate, for a constant set of randomly drawn locations, two indendent spatial processes, y and x, with varying decay rates of spatial dependence. We plot the locations and realised values in the top panel, where darker colors suggest larger values. For each draw, we then run a simple regression of \(y_i = \alpha + \beta x_i + \epsilon_i\) in two variants:
- using vanilla OLS with Conley standard errors;
- applying MW's spatial differencing technique and SCPC inference
and plot the estimated \(\hat{\beta}\) (left) and the associated p-value (right) in the bottom panel.
Clearly, in this example, as the decay-rate of spatial dependence decreases, vanilla OLS and Conley errors (red line) begin to spuriously estimate a negative relationship between x and y. In contrast, the SPUR & SCPC procedure (blue line) correctly estimates an insignificant coefficient close to the true \(\beta\) (zero) throughout.
The spur-scpc ecosystem¶
The spur/scpc ecosystem of packages provide a simple, homogenous interface to these methods by translating all the tests Mueller-Watson developed to Stata, R, and Python.
- The SPUR packages provide the unit-root diagnostics, residual tests, half-life procedure, and spatial transformations.
- The SCPC packages provide the inference layer developed in Müller and Watson (2022, 2023).
The core SPUR functions all packages implement are:
I(0)test: tests the null that the variable isI(0).I(1)test: tests the null that the variable isI(1).I(0) residualtest: applies theI(0)test to fitted regression residuals.I(1) residualtest: applies theI(1)test to fitted regression residuals.spurtransform: applies the spatial transformation used to remove the low-frequency component.spurhalflife: reports confidence sets for the spatial half-life.
SCPC is a single post-estimation function:
scpc(): applies a post-estimation correction to a fitted model
References¶
- Becker, Sascha O., P. David Boll, and Hans-Joachim Voth (2026). “Testing and Correcting for Spatial Unit Roots in Regression Analysis.” Stata Journal, forthcoming.
- Müller, Ulrich K., and Mark W. Watson (2024). “Spatial Unit Roots and Spurious Regression.” Econometrica 92(5): 1661–1695.
- Müller, Ulrich. K., and Mark W. Watson (2023), Spatial Correlation Robust Inference in Linear Regression, Journal of Business & Economic Statistics.