I have some count data (electric vehicle chargers). I'm trying to model its relationship with % of cars that are electric within an area. They show linear correlation.

Normally I would use Poisson model because it is count data. However, both the dependent and independent variables show very strong global spatial autocorrelation with massive z-scores. From my understanding, normal linear regression won't work because of this so I need to use Geographically weighted regression (GWR). This measures regression locally, giving different models for each area.

If autocorrelation is present, is there no way to have an overall regression model for the whole area I'm looking at? I'm unsure what conclusions I can draw from GWR other than regression varies significantly across the whole area- isn't this basically saying there is no relationship between the data unless we significantly narrow down? What's the point of having such a non-general model? I'm for sure ignorant but I'm at a bit of a loss.

enter image description here

1 Answer 1


You want to model count data (electric vehicle chargers) as the response variable and % of electric cars within an area as the explanatory variable. Then probably your response variable will behave as Poisson, but if overdispersed as negative binomial. In this case, it will be good to go with generalized linear mixed-effect models (glmm) or generalized linear models (glm), depending on other settings you may have.

If you have autocorrelation in your data there are some ways to model it, such as autoregressive models, spatial regression models, and again, glmm, glm, etc.

I prefer glmm or glm for your variables and as you can run it in R. In this case, you first use the coordinates to establish the correlation structure between areas using corSpatial function. Then in the model, you specify the fixed and random effects (depending on your case) and the established correlation.

I recommend you to look to 'Bivand, Roger S., Edzer J. Pebesma, Virgilio Gómez-Rubio, and Edzer Jan Pebesma. Applied spatial data analysis with R. Vol. 747248717. New York: Springer, 2008.' Especially chapter 10 Modelling Areal Data.

For the modelling setting, I recommend taking a look at "Dunn, Peter K., and Gordon K. Smyth. Generalized linear models with examples in R. Vol. 53. New York: Springer, 2018."

You have a fascinating topic on your hands!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.