Skip to content
Prev 17721 / 29559 Next

GWR with some parameters held constant

On Thu, 7 Mar 2013, Corey Sparks wrote:

            
Either of:

col.lm <- lm(crime ~ housing, data=columbus)
columbus$pred_crime <- predict(col.lm)
col.bw <- gwr.sel(pred_crime ~ income, data=columbus,
   coords=cbind(columbus$x, columbus$y))
col.gauss <- gwr(pred_crime ~ income, data=columbus,
   coords=cbind(columbus$x, columbus$y), bandwidth=col.bw)

col.lm <- lm(crime ~ income + housing, data=columbus)
columbus$h27 <- coef(col.lm)[3]*columbus$housing
col.bw <- gwr.sel(crime ~ income + offset(h27), data=columbus,
   coords=cbind(columbus$x, columbus$y))
col.gauss <- gwr(crime ~ income + offset(h27), data=columbus,
   coords=cbind(columbus$x, columbus$y), bandwidth=col.bw)

do something, the first one includes an intercept twice, the second 
relies on the offset term being handled correctly, which unfortunately it 
isn't. Given the doubts about GWR in Paez et al. 2011, I haven't thought 
it worth the trouble to use more time on the package. I don't think the 
gwrr package offers this variant.

Roger