Multi step GM/IV estimation of a linear Cliff and Ord type of model of the form:
y=λ W y + X β + u
u=ρ W u + e
with
e ~ N(0,σ^2_i)
The model allows for spatial lag in the dependent variable and disturbances. The innovations in the disturbance process are assumed heteroskedastic of an unknown form.
1 2 3 4 5 6  spreg(formula, data=list(), listw, listw2=NULL, endog = NULL, instruments= NULL,
lag.instr = FALSE, initial.value=0.2,
model = c("sarar", "lag", "error", "ivhac", "ols"), het = FALSE, verbose=FALSE,
na.action = na.fail, HAC = FALSE,
distance = NULL, type=c("Epanechnikov","Triangular","Bisquare","Parzen", "QS","TH"),
bandwidth="variable" , step1.c = FALSE, control = list())

formula 
a description of the model to be fit 
data 
an object of class data.frame. An optional data frame containing the variables in the model. 
listw 
an object of class 
listw2 
an object of class 
endog 
additional endogenous variables. Default 
instruments 
external instruments. Default 
lag.instr 
should the external instruments be spatially lagged? 
initial.value 
The initial value for ρ. It can be either numeric (default is 0.2) or
set to 
model 
one of 
het 
default FALSE: if TRUE uses the methods developed for heteroskedasticity 
verbose 
print optimization details 
na.action 
a function which indicates what should happen when the data contains missing values. See lm for details. 
HAC 
perform the HAC estimator of Kelejian and Prucha, 2007. 
distance 
an object of class 
type 
One of 
bandwidth 
"variable" (default)  or numeric when a fixed bandwidth is specified by the user. 
step1.c 
Should step 1.c from Arraiz et al. 2012 be performed? 
control 
A list of control arguments. See nlminb 
The procedure consists of two steps alternating GM and IV estimators. Each step consists of substeps. In step one δ = [β',λ]' is estimated by 2SLS. The 2SLS residuals are first employed to obtain an consistent GM estimator of ρ.
In step two, the spatial CochraneOrcutt transformed model is estimated by 2SLS. This corresponds to a GS2SLS procedure. The GS2SLS residuals are used to obtain a consistent and efficient GM estimator for ρ.
The initial value for the optimization in step 1b is taken to be initial.value
.
The initial value for the optimization of step 2b is the optimal parameter of step 1b.
Internally, the object of class listw
is transformed into a Matrix
using the function listw2dgCMatrix.
For the HAC estimator (Kelejian and Prucha, 2007), there are four possibilities:
A model with only Wy
A model with Wy and additional endogenous
Only additional endogenous (with no Wy)
No additional endogenous variables
Furthermore, the default sets the bandwith for each observation to the maximum distance for that observation (i.e. the max of each element of the list of distances).
Six different kernel functions are implemented:
'Epanechnikov'
: K(z) = 1z^2
'Triangular'
: K(z) = 1z
'Bisquare'
: K(z) = (1z^2)^2
'Parzen'
: K(z) = 16z^2+6 z^3 if z ≤q 0.5 and
K(z) = 2(1z)^3 if 0.5 < z ≤q 1
'TH'
(Tukey  Hanning): K(z) = \frac{1+ \cos(π z)}{2}
'QS'
(Quadratic Spectral): K(z) = \frac{25}{12π^2z^2}
(\frac{\sin(6π z)/5)}{6π z/5}  \cos(6π z)/5)).
If the kernel type is not one of the six implemented, the function will terminate with an error message. The spatial two stage least square estimator is based on the matrix of instruments H=[X,WX,W^2X^2].
A list object of class sphet
coefficients 
Generalized Spatial two stage least squares coefficient estimates of δ and GM estimator for ρ. 
var 
variancecovariance matrix of the estimated coefficients 
s2 
GS2SLS residuals variance 
residuals 
GS2SLS residuals 
yhat 
difference between GS2SLS residuals and response variable 
call 
the call used to create this object 
model 
the model matrix of data 
method 

Gianfranco Piras gpiras@mac.com
Arraiz, I. and Drukker, M.D. and Kelejian, H.H. and Prucha, I.R. (2010) A spatial CliffOrdtype Model with Heteroskedastic Innovations: Small and Large Sample Results, Journal of Regional Sciences, 50, pages 592–614.
Drukker, D.M. and Egger, P. and Prucha, I.R. (2013) On Twostep Estimation of a Spatial Auto regressive Model with Autoregressive Disturbances and Endogenous Regressors, Econometric Review, 32, pages 686–733.
Kelejian, H.H. and Prucha, I.R. (2010) Specification and Estimation of Spatial Autoregressive Models with Autoregressive and Heteroskedastic Disturbances, Journal of Econometrics, 157, pages 53–67.
Kelejian, H.H. and Prucha, I.R. (1999) A Generalized Moments Estimator for the Autoregressive Parameter in a Spatial Model, International Economic Review, 40, pages 509–533.
Kelejian, H.H. and Prucha, I.R. (1998) A Generalized Spatial Two Stage Least Square Procedure for Estimating a Spatial Autoregressive Model with Autoregressive Disturbances, Journal of Real Estate Finance and Economics, 17, pages 99–121.
Gianfranco Piras (2010). sphet: Spatial Models with Heteroskedastic Innovations in R. Journal of Statistical Software, 35(1), 121. http://www.jstatsoft.org/v35/i01/.
Roger Bivand, Gianfranco Piras (2015). Comparing Implementations of Estimation Methods for Spatial Econometrics. Journal of Statistical Software, 63(18), 136. http://www.jstatsoft.org/v63/i18/.
1 2 3 4 5 
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.