[R-sig-Geo] Problem with localG in spdep
Victor Kuperman
vkuperman at yahoo.com
Thu Aug 3 23:21:43 CEST 2017
Dear all,
I am new to using R for analyzing geographic data, so any input would be appreciated. My goal is to obtain the G* (local G) Getis-Ord statistic to a metric that is calculated for every US state and Canadian province (except islands, i.e. Hawaii and Prince Edward Island). The metric is standardized and its value range is [-2, 2]. Using spdep, I created a neighbors list from the US + Canada polygon data, and then generated a binary weight matrix.
state_nb <- poly2nb(region_nb)
weights = nb2listw(state_nb, style="B", zero.policy=F)
Upon examination, both the neighbors and the weights seem to be appropriate to the geographic boundary data. As the next step, I am using a localG() with the metric of interest and the weights computed above.
lG = localG(x = metric, listw = weights, zero.policy=NULL, spChk = F)
The resulting statistic, however, shows a weak negative correlation with the original metric. This outcome is implausible, I think, and I can't quite figure out what may have caused it. Any suggestions are appreciated. If more data is necessary to answer this, I'll be happy to provide it. I am new to this and only just learning the rules.
Thank you!
Victor
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list