
![]()
Where r is spatial dependence parameter and W is a n´ n standardized spatial weight matrix (where n is the number of observations). Spatial weight matrix, W, tells us whether any pair of observations are neighbor. If, for example, house i and house j are neighbor then, wij = 1 and zero otherwise. Whether or not any pair of houses are neighbor is based on whether or not they are located in neighboring area. Two areas are considered neighbor when they share common borders (contiguity) or when their distance to each other is below certain level.[1].
Spatial weight matrix is usually standardized, such that every row of the matrix is summed to 1. This enable us to interpret spatial lag term in spatial model as simply a spatially-weighted average of neighboring house prices, for example,
![]()
where observation 2, 3, 6 are neighbors of observation 1. Spatial lag model more or less resemble the autoregressive (AR) model in time-series econometrics. However, unlike the AR model, OLS estimation in the presence of spatial dependence will be inconsistent, because of the endogeneity problem. Spatial lag model will be estimated using maximum likelihood estimation.[2]
Spatial error model take the following form;
![]()
![]()
Where u now is i.i.d error term, and l is spatial error parameter. Spatial error model resembles more or less the moving average (MA) model in time series econometrics, in which error of certain observations is affected by errors of other observation. OLS estimation of spatial error model will be inefficient[3] because it violate the assumption of independence among disturbance term.
Note
[1] In constructing the spatial weight matrix, first, we determined, based on common border, which of the 43 sub-districts are neighbor. Secondly, we assume that houses located in the same sub-district and in the neighboring sub-districts are neighbors. However, it turns out, that it is computationally cumbersome to create the continuity weight-matrix this way (it need a bit of programming or require specific software such as spacestat or GeoDa). STATA on the other hand can conveniently construct spatial weight matrix based on certain distance. We used this method, alternatively, i.e. use distance as criteria to be neighbor. The choice of distance band is constructed such that it represent as close as possible to that based on contiguity. Several different bands are constructed, but does not affect the result.
[2] see Anselin 1988, for detail MLE method in spatial econometric model
Spatial Econometrics Book by James P. Le Sage.
To install spatial econometrics tool for your STATA: type "net install sg162.pkg" or search "spatreg" in help menu and follow instruction.
Matlab Toolbox by James P. Le Sage.
Download my spatial hedonic paper which includes:
paper, dataset, and all STATA do files.
Luc Anselin Website: the 'guru' of spatial econometrics.
GeoDa, the most popular software for spatial econometrics analysis. You can download the softwares, tutorials, and others useful stuffs.