r-spatial / spdep

Spatial Dependence: Weighting Schemes and Statistics
https://r-spatial.github.io/spdep/
116 stars 26 forks source link

Addition of two new versions of the Moran scatterplot plus fixing of a minor typo in the documentation for moran.plot. #149

Closed rwesterh closed 2 months ago

rwesterh commented 2 months ago

I have added two new versions of the Moran scatterplot: the Moran drop plot (for visualising p values) and the Moran seismogram (for visual inspection of local critical values/potential spatial weights misspecifications).

rsbivand commented 2 months ago

@rwesterh Thanks! Could I ask whether you considered rather creating these functions as say methods for a fitted "localmoran" object, perhaps like the hotspot methods in R/hotspotmaps.R (perhaps moran.plot itself ought to be a method?)? I think this might reduce some code duplication. In addition, the localmoran object could be enhanced to add columns you need. I see a problem in that the ZIi from the samples in column 4 is not robust to variables that are skewed, as it is based on the mean and var of the samples. This probably means looking at the skewness and kurtosis reported in the object, and warning the user if the p-values from mean and var of the samples diverge from the p-values from ranking the samples. This also impinges on https://github.com/pysal/esda/issues/199, from https://github.com/pysal/esda/issues/199#issuecomment-1544126890. You may also be interested in doi = {10.1080/24694452.2024.2326541} if you have not seen it yet, also maybe doi = {10.1111/gean.12390}. Quite a lot of interesting suggestions coming forward now!