Department of Statistical Sciences, University of Cape Town
1 Modelling Lattice Data
Exploratory spatial data analysis is often a preliminary step to more formal modelling approaches. In spatial lattice data, the goal is often to explain variation in a variable observed for each areal unit using other variables recorded for those same areal units.
In this lecture, the focus moves from exploratory spatial dependence to spatial regression models in a simple cross-sectional setting.
The key question is:
what happens to regression modelling when observations are spatially dependent?
1.1 Spatial Regression Models
Our starting point is the ordinary linear regression model. For each lattice observation or areal unit \(i=1,\ldots,N\), let
where \(y\) is an \((N\times 1)\) vector of observations, \(X\) is an \((N\times F)\) matrix of explanatory variables, \(\beta\) is the vector of regression coefficients, and \(\varepsilon\) is the error vector.
Thus the errors are assumed to be independent and identically distributed, with constant variance and no correlation across observations.
The assumption of independent observations greatly simplifies the model. However, for areal data this is often unrealistic because neighbouring areas may influence one another or may share omitted spatially structured variables.
1.1.1 Columbus dataset
We begin with the Columbus data and model crime as a function of income and housing value using OLS:
Global Moran I for regression residuals
data:
model: lm(formula = CRIME ~ INC + HOVAL, data = columbus)
weights: dnbTresh1.listw
Moran I statistic standard deviate = 3.0562, p-value = 0.001121
alternative hypothesis: greater
sample estimates:
Observed Moran I Expectation Variance
0.266348450 -0.032344498 0.009551988
1.2 Spatial Models
Spatial regression models introduce spatial dependence explicitly into the regression framework.
The main specifications in this lecture are:
spatial lag / spatial autoregressive models;
spatial error models;
combined spatial lag and spatial error models;
diagnostic tests that help choose between them.
1.2.1 General Spatial Autoregressive (Lag) Models
A general spatial autoregressive model for cross-sectional lattice data can be written as a SARAR or spatial lag-error model:
\[
y = \rho W_1^s y + Z\beta + u,
\]
\[
u = \lambda W_2^s u + \varepsilon,
\]
with
\[
\varepsilon \sim N(0,\sigma^2 I).
\]
Here:
\(y\) is the dependent variable;
\(Z\) is the matrix of explanatory variables which can include the lagged explanatory variables as well, \(Z=[X,W_3^sX]\);
\(W_1\) is the spatial weights matrix for the lagged dependent variable;
\(W_2\) is the spatial weights matrix for the error process;
\(\rho\) is the spatial autoregressive lag coefficient \(| \rho|<1\);
\(\lambda\) is the spatial autoregressive error coefficient \(|\lambda|<1\);
\(u\) is the spatially structured disturbance;
\(\varepsilon\) is the innovation error term.
The model can also be written as:
\[
(I-\rho W_1)y = X\beta + u,
\]
and
\[
(I-\lambda W_2)u = \varepsilon.
\]
Special models are obtained by imposing restrictions such as \(\rho=0\), \(\lambda=0\), or removing \(X\beta\).
1.2.2 Special Forms of Spatial Autoregressive (Lag) Models
From the general form, we obtain several special cases.
1.2.2.1 First-order spatial autoregressive model
If there are no explanatory variables and no spatial error process:
\[
y = \rho W_1^sy + \varepsilon.
\]
This model explains variation in \(y\) through neighbouring values of \(y\) and \(\epsilon \sim N(0,\sigma^2 I_N)\).
1.2.2.2 Spatial lag model / SAR model
If explanatory variables are included but the error term is not spatially autocorrelated:
\[
y = \rho W_1^sy + X\beta + \varepsilon.
\]
\(\epsilon \sim N(0,\sigma^2 I_N)\)
1.2.2.3 Spatial error model
If spatial dependence enters through the disturbances:
\[
y = X\beta + u,
\]
\[
u = \lambda W^s_2u + \varepsilon.
\]
1.2.2.4 Spatial lag-error model / SARAR model
If both processes are present:
\[
y = \rho W_1^sy + X\beta + u,
\]
\[
u = \lambda W_2^su + \varepsilon.
\]
Moran’s \(I\) for the OLS residuals may indicate spatial dependence, but by itself it does not tell us whether the dependence should be modelled as a spatial lag, a spatial error process, or both.
1.3 Problems with OLS
OLS is problematic when the true model contains spatial dependence.
The consequences depend on where the spatial dependence appears:
if the dependent variable is spatially lagged, the spatial lag \(Wy\) is endogenous;
if the error term is spatially autocorrelated, the OLS coefficients may be inefficient and the usual standard errors are invalid;
if the spatial process is misspecified, coefficient estimates and inference can be biased or inconsistent.
This motivates special estimation procedures such as maximum likelihood and instrumental variables.
1.3.1 First Order Spatial Lag Model with OLS
Consider the simplest first-order spatial lag model without explanatory variables:
\[
y = \rho W^sy + \varepsilon.
\]
The SAR specification uses neighbouring values of \(y\) to account for spatial dependence.
The spatially lagged variable is
\[
W^sy,
\]
which is usually interpreted as a weighted average of neighbouring values when \(W\) is row-standardised.
If \(y\) is mean standardised, the model focuses on deviations from the overall mean.
For the simple model
\[
y=\rho Wy+\varepsilon,
\]
OLS treats \(Wy\) as an explanatory variable. The OLS estimator of \(\rho\) is
The problem is that \(Wy\) is not exogenous. Because \(y\) itself is generated through a spatial feedback process, \(Wy\) is correlated with the error structure.
1.3.2 First Order Spatial Autoregressive Model with OLS
For OLS to be consistent, the explanatory variable must be asymptotically uncorrelated with the error term. In the simple spatial lag model this requires a condition of the form
This is a quadratic form in the error terms, and it is not generally equal to zero.
Consequently, the OLS estimator is biased and inconsistent for the spatial lag parameter.
1.4 Maximum Likelihood Estimation
Because OLS is inappropriate for models with spatial dependence, maximum likelihood estimation becomes a natural alternative.
Maximum likelihood estimates the model parameters by choosing the values that make the observed vector \(y\) most likely under the assumed spatial data-generating process.
The likelihood must account for two important transformations:
the transformation from \(y\) to the spatially filtered response \((I-\rho W)y\);
the transformation from the spatially structured disturbance \(u\) to the innovation \((I-\lambda W)u\).
These transformations introduce Jacobian terms into the likelihood.
Here \(v\) is the transformed, standardised residual vector implied by the spatial model.
The maximum likelihood estimator chooses the values of the parameters, including \(\rho\), \(\lambda\), \(\beta\), and variance parameters, that maximise this log-likelihood.
Ref: Anselin, p. 63; see also Anselin et al. (1996).
1.4.3 Calculation of the Jacobian Term
There are several ways to calculate the Jacobian term, especially the log determinant
\[
\log|I-\rho W|.
\]
1.4.3.1 Exact approaches
eigenvalues, Ord (1975), used in R with method = "eigen";
LU decomposition, method = "LU";
Cholesky decomposition, method = "Matrix";
sparse Cholesky decomposition, method = "spam".
1.4.3.2 Approximate approaches
Chebyshev approximation, Pace and LeSage (2004), method = "Chebyshev";
Monte Carlo approximation, Barry and Pace (1999), method = "MC".
Exact methods should agree up to numerical precision. Approximate methods should give similar values when the approximation is sufficiently accurate.
1.5 Hypothesis Tests Based on the ML Principles
Maximum likelihood estimation naturally leads to several hypothesis-testing frameworks.
1.5.1 Wald test
Tests restrictions using the estimated parameter and its estimated variance.
1.5.2 Likelihood ratio test
Compares the maximised likelihoods of a restricted and an unrestricted model.
1.5.3 Lagrange multiplier test
Evaluates whether adding a spatial parameter would improve the model, using estimates from the restricted model, usually OLS.
1.6 Example: Columbus Dataset
The Columbus data frame has 49 rows and 22 columns.
The main variables used here are:
CRIME: residential burglaries and vehicle thefts per thousand households in the neighbourhood;
1.10 Lagrange Multiplier Test Statistics for Spatial Autocorrelation
Burridge (1980) and Anselin (1988) developed Lagrange Multiplier tests for spatial dependence.
The null hypothesis for both basic tests is the OLS model:
\[
H_0:\rho=0,\quad \lambda=0.
\]
The alternatives are:
spatial lag dependence;
spatial error dependence.
The LM test statistics are asymptotically distributed as chi-square random variables under the null.
If both the basic LM lag and LM error tests are significant, this does not by itself identify which model should be used. The two tests are not isolated from one another. Anselin et al. (1996) therefore proposed robust versions of these tests.
The robust test that remains significant indicates which spatial alternative is more strongly supported after accounting for the other possibility.
There is also a joint test for spatial dependence.
The SARMA statistic combines evidence from lag and error alternatives. It can be constructed as a sum of LM components and is compared to a chi-square distribution with two degrees of freedom:
\[
\text{SARMA} \sim \chi^2_2.
\]
The joint test asks whether some spatial dependence is present, but it does not by itself tell us whether the preferred specification is spatial lag, spatial error, or both.
The lecture uses the lm.LMtests() function to perform the LM diagnostics.
The simple LM error and simple LM lag tests are both significant. However, among the robust tests, the robust lag test is significant while the robust error test is not. This points to a spatial lag specification.