report icon indicating copy to clipboard operation
report copied to clipboard

Include report for geographically weighted regression (as an explanatory tool)

Open nikosGeography opened this issue 3 years ago • 2 comments

A good idea might be the creation of report for geographically weighted regression (GWR) model. It is a widely used local regression analysis (mostly utilized as an explanatory tool but it can be used for other purposes like disaggregation of spatial data). Also, as an extra feature, a good idea would be to include if someone used fixed or adaptive kernel bandwidth.

How could we do it?

nikosGeography avatar Feb 12 '22 01:02 nikosGeography

Can you give a reproducible example of such a model?

bwiernik avatar Feb 12 '22 02:02 bwiernik

Yes. This example can be found here. They are using a fixed kernel size and they apply GWR to a raster dataset.

library(gstat)
library(spgwr)

data(meuse)
coordinates(meuse) <- c("x", "y") 
meuse$ffreq <- factor(meuse$ffreq)
data(meuse.grid)
coordinates(meuse.grid) <- c("x", "y")
meuse.grid$ffreq <- factor(meuse.grid$ffreq)
gridded(meuse.grid) <- TRUE
spplot(meuse.grid, "soil",  col.regions=topo.colors)

xx <- gwr(cadmium ~ dist, meuse, bandwidth = 228, hatmatrix=TRUE)
xx
x <- gwr(cadmium ~ dist, meuse, bandwidth = 228, fit.points = meuse.grid, predict=TRUE, se.fit=TRUE, fittedGWRobject=xx)
x
spplot(x$SDF, "pred", col.regions= terrain.colors )
spplot(x$SDF, "pred.se",col.regions=rainbow)

For a more detailed example, I would recommend this article where they are using polygon symbols but they investigate both fixed and adaptive kernel, they assessing the statistical significance of their findings and they explain why they used GWR in the first place.

nikosGeography avatar Feb 12 '22 10:02 nikosGeography