Multi step GM/IV estimation of a linear Cliff and Ord -type of model of the form: $$y=\lambda W y + X \beta + u $$ $$u=\rho W u + e$$ with $$e ~ N(0,\sigma^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.
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","Rectangular"),
bandwidth = "variable" , step1.c = FALSE,
control = list(), Durbin = FALSE)
A list object of class sphet
Generalized Spatial two stage least squares coefficient estimates of \(\delta\) and GM estimator for \(\rho\).
variance-covariance matrix of the estimated coefficients
GS2SLS residuals variance
GS2SLS residuals
difference between GS2SLS residuals and response variable
the call used to create this object
the model matrix of data
'gs2slshac'
a description of the model to be fit
an object of class data.frame. An optional data frame containing the variables in the model
an object of class listw
, matrix
, or Matrix
an object of class listw
, matrix
, or Matrix
specified only when sarar
is true
additional endogenous variables. Default NULL
. If not NULL
should be specified
as a formula with no dependent variable (endog = ~ x1 + x2). Note the ~ before the expression.
external instruments. Default NULL
. If not NULL
should be specified
as a formula with no dependent variable (instruments = ~ x1 + x2). Note the ~ before the expression.
should the external instruments be spatially lagged?
The initial value for \(\rho\). It can be either numeric (default is 0.2) or
set to 'SAR'
, in which case the optimization will start from the estimated coefficient of a regression of the 2SLS
residuals over their spatial lag (i.e. a spatial AR model)
one of lag
, error
, sarar
, ivhac
, or ols
.
If HAC is TRUE, model should be one of ivhac
, or ols
.
default FALSE: if TRUE uses the methods developed for heteroskedasticity
print optimization details
a function which indicates what should happen when the data contains missing values. See lm for details.
perform the HAC estimator of Kelejian and Prucha, 2007.
an object of class distance
created for example by read.gwt2dist
The object contains the specification of the distance measure
to be employed in the estimation of the VC matrix. See Details.
One of c("Epanechnikov","Triangular","Bisquare","Parzen", "QS","TH","Rectangular")
.
The type of Kernel to be used. default = "Epanechnikov"
See Details.
"variable" (default) - or numeric when a fixed bandwidth is specified by the user.
Should step 1.c from Arraiz et al. 2012 be performed?
A list of control arguments. See nlminb
Should (some of) the regressors be lagged? Default FALSE. If not FALSE
should be specified
as a formula with no dependent variable (Durbin = ~ x1 + x2) or set to TRUE
. See details.
Gianfranco Piras gpiras@mac.com
The procedure consists of two steps alternating GM and IV estimators. Each step consists of sub-steps. In step one \(\delta = [\beta',\lambda]'\) is estimated by 2SLS. The 2SLS residuals are first employed to obtain an consistent GM estimator of \(\rho\).
In step two, the spatial Cochrane-Orcutt 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 \(\rho\).
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) = 1-z^2\)
'Triangular'
: \(K(z) = 1-z\)
'Bisquare'
: \(K(z) = (1-z^2)^2\)
'Parzen'
: \(K(z) = 1-6z^2+6 |z|^3\) if \(z \leq 0.5\) and
\( K(z) = 2(1-|z|)^3\) if \(0.5 < z \leq 1\)
'TH'
(Tukey - Hanning): \( K(z) = \frac{1+ \cos(\pi z)}{2}\)
'Rectangular'
: \( K(z) = 1\)
'QS'
(Quadratic Spectral): \(K(z) = \frac{25}{12\pi^2z^2}
(\frac{\sin(6\pi z)/5)}{6\pi z/5} - \cos(6\pi z)/5)\)).
If the kernel type is not one of the six implemented, the function will terminate with an error message.
Arraiz, I. and Drukker, M.D. and Kelejian, H.H. and Prucha, I.R. (2010) A spatial Cliff-Ord-type 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 Two-step 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), 1-21. tools:::Rd_expr_doi("10.18637/jss.v035.i01").
Roger Bivand, Gianfranco Piras (2015). Comparing Implementations of Estimation Methods for Spatial Econometrics. Journal of Statistical Software, 63(18), 1-36. tools:::Rd_expr_doi("10.18637/jss.v063.i18").
stslshac
data(columbus, package="spdep")
listw <- spdep::nb2listw(col.gal.nb)
res <- spreg(CRIME ~ HOVAL + INC, data = columbus , listw = listw,
het = TRUE, verbose = FALSE, model = "sarar")
summary(res)
Effects <- impacts(res, listw = listw, R = 1000)
Run the code above in your browser using DataLab