easystats / report

:scroll: :tada: Automated reporting of objects in R
https://easystats.github.io/report/
Other
696 stars 69 forks source link

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

Open nikosGeography opened 2 years ago

nikosGeography commented 2 years ago

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?

bwiernik commented 2 years ago

Can you give a reproducible example of such a model?

nikosGeography commented 2 years ago

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.