gstsls(formula, data = list(), listw, listw2 = NULL, na.action = na.fail,
zero.policy = NULL, pars, control = list(), verbose = NULL, method = "nlminb",
robust = FALSE, legacy = FALSE, W2X = TRUE )
lm()
listw
object created for example by nb2listw
listw
object created for example by nb2listw
, if not given, set to the same spatial weights as the listw argumentna.fail
), can also be na.omit
or na.exclude
with consequences for residuals and fitted values - in these cases the weights list will be subsetted to remove NAs in the data. It may be necessary to GMerrorsar()
to terminate with an errorstsls
stsls
stsls
gmsar
optim
, nlminb
, GMerrorsar
, GMargminImage
data(oldcol)
COL.errW.GM <- gstsls(CRIME ~ INC + HOVAL, data=COL.OLD, nb2listw(COL.nb, style="W"))
summary(COL.errW.GM)
aa <- GMargminImage(COL.errW.GM)
levs <- quantile(aa$z, seq(0, 1, 1/12))
image(aa, breaks=levs, xlab="lambda", ylab="s2")
points(COL.errW.GM$lambda, COL.errW.GM$s2, pch=3, lwd=2)
contour(aa, levels=signif(levs, 4), add=TRUE)
Run the code above in your browser using DataLab