# NOT RUN {
if (require(rgdal, quietly=TRUE)) {
example(columbus)
error.col <- errorsarlm(CRIME ~ HOVAL + INC, data=columbus,
nb2listw(col.gal.nb))
bptest.sarlm(error.col)
bptest.sarlm(error.col, studentize=FALSE)
# }
# NOT RUN {
lm.target <- lm(error.col$tary ~ error.col$tarX - 1)
if (require(lmtest) && require(sandwich)) {
coeftest(lm.target, vcov=vcovHC(lm.target, type="HC0"), df=Inf)
}
# }
# NOT RUN {
}
# }
Run the code above in your browser using DataLab