Problem with localG in spdep

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with localG in spdep

R-sig-geo mailing list
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]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with localG in spdep

Roger Bivand
Administrator
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: [hidden email]


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

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway
Loading...