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
Problem with localG in spdep
2 messages · Victor Kuperman, Roger Bivand
Please provide a reproducible example, either with built-in data or downloadable data, and code, adding your sessionInfo() output. Otherwize all else is guesswork. The function reproduces the examples from Getis & Ord, so it's your data or weights. Just because your data don't yield the answer you want, concluding that the function is broken is unwarranted. Roger Bivand Norwegian School of Economics Bergen, Norway Fra: Victor Kuperman via R-sig-Geo Sendt: torsdag 3. august, 23.26 Emne: [R-sig-Geo] Problem with localG in spdep Til: r-sig-geo at r-project.org 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