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))
}
Run the code above in your browser using DataLab