Learn R Programming

spdep (version 0.3-8)

bptest.sarlm: Breusch-Pagan test for spatial models

Description

Performs the Breusch-Pagan test for heteroskedasticity on the least squares fit of the spatial models taking the spatial coefficients rho or lambda into account. This function is a copy of the bptest function in package "lmtest", modified to use objects returned by spatial simultaneous autoregressive models.

Usage

bptest.sarlm(object, studentize = TRUE)

Arguments

object
An object of class "sarlm" from errorsarlm() or lagsarlm().
studentize
logical. If set to TRUE Koenker's studentized version of the test statistic will be used.

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the test statistic.
  • p.valuethe p-value of the test.
  • parameterdegrees of freedom.
  • methoda character string indicating what type of test was performed.

Details

Asymptotically this corresponds to the test given by Anselin (1988), but is not exactly the same. The studentized version is more conservative and perhaps to be prefered. The residuals, and for spatial error models the RHS variables, are adjusted for the spatial coefficient, as suggested bt Luc Anselin (personal communication).

References

T.S. Breusch & A.R. Pagan (1979), A Simple Test for Heteroscedasticity and Random Coefficient Variation. Econometrica 47, 1287--1294

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.

See Also

errorsarlm, lagsarlm

Examples

Run this code
data(columbus)
error.col <- errorsarlm(CRIME ~ HOVAL + INC, data=columbus,
 nb2listw(col.gal.nb))
bptest.sarlm(error.col)
bptest.sarlm(error.col, studentize=FALSE)

Run the code above in your browser using DataLab