bptest
function in package "lmtest", modified to use objects returned by spatial simultaneous autoregressive models.bptest.sarlm(object, varformula=NULL, studentize = TRUE, data=list())
"sarlm"
from errorsarlm()
or lagsarlm()
.TRUE
Koenker's studentized
version of the test statistic will be used."htest"
containing the following components:It is also technically possible to make heteroskedasticity corrections to standard error estimates by using the sarlm
objects - using functions in the lmtest and sandwich packages.
W. Kr�mer & H. Sonnberger (1986), The Linear Regression Model under Test. Heidelberg: Physica.
L. Anselin (1988) Spatial econometrics: methods and models. Dordrecht: Kluwer, pp. 121--122.
errorsarlm
, lagsarlm
example(columbus)
error.col <- errorsarlm(CRIME ~ HOVAL + INC, data=columbus,
nb2listw(col.gal.nb))
bptest.sarlm(error.col)
bptest.sarlm(error.col, studentize=FALSE)
if (require(lmtest) && require(sandwich)) {
coeftest(error.col$lm.target, vcov=vcovHC(error.col$lm.target,
type="HC0"), df=Inf)
}
Run the code above in your browser using DataLab