if (FALSE) {
data(DubVoter)
bw.a <- bw.gwr(GenEl2004~DiffAdd+LARent+SC1+Unempl+LowEduc+Age18_24
+Age25_44+Age45_64,
data=Dub.voter,approach="AICc",kernel="bisquare",adaptive=TRUE)
bw.a
gwr.res <- gwr.basic(GenEl2004~DiffAdd+LARent+SC1+Unempl+LowEduc+Age18_24
+Age25_44+Age45_64,
data=Dub.voter,bw=bw.a,kernel="bisquare",adaptive=TRUE,F123.test=TRUE)
print(gwr.res)
# Map of the estimated coefficients for LowEduc
names(gwr.res$SDF)
if(require("RColorBrewer"))
{
mypalette<-brewer.pal(6,"Spectral")
X11(width=10,height=12)
spplot(gwr.res$SDF,"LowEduc",key.space = "right",
col.regions=mypalette,at=c(-8,-6,-4,-2,0,2,4),
main="Basic GW regression coefficient estimates for LowEduc")
}
# Robust GW regression and map of the estimated coefficients for LowEduc
rgwr.res <- gwr.robust(GenEl2004~DiffAdd+LARent+SC1+Unempl+LowEduc+Age18_24
+Age25_44+Age45_64, data=Dub.voter,bw=bw.a,kernel="bisquare",
adaptive=TRUE,F123.test=TRUE)
print(rgwr.res)
if(require("RColorBrewer"))
{
X11(width=10,height=12)
spplot(rgwr.res$SDF, "LowEduc", key.space = "right",
col.regions=mypalette,at=c(-8,-6,-4,-2,0,2,4),
main="Robust GW regression coefficient estimates for LowEduc")
}
}
Run the code above in your browser using DataLab