The function returns Leung et al. (2000) three moment approximation for Moran's I, for a gwr object calculated with argument hatmatrix=TRUE. This implementation should not be regarded as authoritative, as it involves assumptions about implied methods and about estimated degrees of freedom.

gwr.morantest(x, lw, zero.policy = FALSE)

Arguments

x

a gwr object returned by gwr() with argument hatmatrix=TRUE

lw

a listw object created for example by nb2listw in the spdep package

zero.policy

if TRUE assign zero to the lagged value of zones without neighbours, if FALSE (default) assign NA

Value

a “htest” object with the results of testing the GWR residuals

References

Leung Y, Mei C-L, Zhang W-X 2000 Testing for spatial autocorrelation among the residuals of the geographically weighted regression, Environment and Planning A, 32, 871-890.

Author

Roger Bivand

Examples

if (suppressWarnings(require(spData)) && suppressWarnings(require(spdep))) {
  data(columbus, package="spData")
  bw <- gwr.sel(CRIME ~ INC + HOVAL, data=columbus, coords=coords)
  col0 <- gwr(CRIME ~ INC + HOVAL, data=columbus, coords=coords,
    bandwidth=bw, hatmatrix=TRUE)
  gwr.morantest(col0, nb2listw(col.gal.nb))
}
#> Loading required package: spdep
#> Bandwidth: 2.220031 CV score: 7473.853 
#> Bandwidth: 3.588499 CV score: 7479.637 
#> Bandwidth: 1.374271 CV score: 7404.175 
#> Bandwidth: 0.8515626 CV score: 7389.293 
#> Bandwidth: 0.7515898 CV score: 7280.867 
#> Bandwidth: 0.4667245 CV score: 6319.861 
#> Bandwidth: 0.290668 CV score: 7474.967 
#> Bandwidth: 0.5755334 CV score: 6754.626 
#> Bandwidth: 0.3994769 CV score: 6197.735 
#> Bandwidth: 0.3597549 CV score: 6320.012 
#> Bandwidth: 0.4132551 CV score: 6200.674 
#> Bandwidth: 0.4028088 CV score: 6196.867 
#> Bandwidth: 0.4040147 CV score: 6196.817 
#> Bandwidth: 0.4038422 CV score: 6196.816 
#> Bandwidth: 0.4038829 CV score: 6196.816 
#> Bandwidth: 0.4038015 CV score: 6196.816 
#> Bandwidth: 0.4038422 CV score: 6196.816 
#> 
#> 	Leung et al. 2000 three moment approximation for Moran's I
#> 
#> data:  GWR residuals
#> statistic = 4.1271, df = 17.519, p-value = 0.0004307
#> sample estimates:
#>          I 
#> 0.02043468 
#>