listw for local Moran in spdep
On Mon, 7 Feb 2011, Agustin Lobo wrote:
Hi! I'd like to run localmoran() from spdep on a small grid (matrix). Is there a function to calculate the spatial weights (listw) from the grid (defining 3x3 neighborhoods)?
For a 3x3 neighbourhood on a grid simply defined by numbers of rows and columnd, see ?cell2nb. Otherwise, use dnearneigh() with the threshold set to the length of the diagonal distance between cell centres giving the cell centre coordinates as input.
(BTW: the definition of LISA in the spdep manual is unformatted)
The LaTeX version looks fine! I'll try to repair the regular page. Roger
Thanks Agus
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no