stsls {spdep} | R Documentation |
The function fits a spatial lag model by two stage least squares, with the option of adjusting the results for heteroskedasticity.
stsls(formula, data = list(), listw, zero.policy = NULL, na.action = na.fail, robust = FALSE, HC=NULL, legacy=FALSE, W2X = TRUE)
formula |
a symbolic description of the model to be fit. The details
of model specification are given for |
data |
an optional data frame containing the variables in the model. By default the variables are taken from the environment which the function is called. |
listw |
a |
zero.policy |
default NULL, use global option value; if TRUE assign zero to the lagged value of zones without
neighbours, if FALSE (default) assign NA - causing |
na.action |
a function (default |
robust |
default FALSE, if TRUE, apply a heteroskedasticity correction to the coefficients covariances |
HC |
default NULL, if |
legacy |
the argument chooses between two implementations of the robustness correction: default FALSE - use the estimate of Omega only in the White consistent estimator of the variance-covariance matrix, if TRUE, use the original implementation which runs a GLS using the estimate of Omega, and yields different coefficient estimates as well - see example below |
W2X |
default TRUE, if FALSE only WX are used as instruments in the spatial two stage least squares; until release 0.4-60, only WX were used - see example below |
The fitting implementation fits a spatial lag model:
y = rho W y + X beta + e
by using spatially lagged X variables as instruments for the spatially lagged dependent variable.
an object of class "stsls" containing:
coefficients |
coefficient estimates |
var |
coefficient covariance matrix |
sse |
sum of squared errors |
residuals |
model residuals |
df |
degrees of freedom |
Luc Anselin, Gianfranco Piras and Roger Bivand
Kelejian, H.H. and I.R. Prucha (1998). A generalized spatial two stage least squares procedure for estimating a spatial autoregressive model with autoregressive disturbances. Journal of Real Estate Finance and Economics 17, 99-121.
data(oldcol) COL.lag.eig <- lagsarlm(CRIME ~ INC + HOVAL, data=COL.OLD, nb2listw(COL.nb)) summary(COL.lag.eig, correlation=TRUE) COL.lag.stsls <- stsls(CRIME ~ INC + HOVAL, data=COL.OLD, nb2listw(COL.nb)) summary(COL.lag.stsls, correlation=TRUE) COL.lag.stslsW <- stsls(CRIME ~ INC + HOVAL, data=COL.OLD, nb2listw(COL.nb), W2X=FALSE) summary(COL.lag.stslsW, correlation=TRUE) COL.lag.stslsR <- stsls(CRIME ~ INC + HOVAL, data=COL.OLD, nb2listw(COL.nb), robust=TRUE, W2X=FALSE) summary(COL.lag.stslsR, correlation=TRUE) COL.lag.stslsRl <- stsls(CRIME ~ INC + HOVAL, data=COL.OLD, nb2listw(COL.nb), robust=TRUE, legacy=TRUE, W2X=FALSE) summary(COL.lag.stslsRl, correlation=TRUE) data(boston) gp2a <- stsls(log(CMEDV) ~ CRIM + ZN + INDUS + CHAS + I(NOX^2) + I(RM^2) + AGE + log(DIS) + log(RAD) + TAX + PTRATIO + B + log(LSTAT), data=boston.c, nb2listw(boston.soi)) summary(gp2a)