[R] How to do "moran's I test"?

Roger Bivand Roger.Bivand at nhh.no
Tue Feb 6 20:01:24 CET 2007


On Tue, 6 Feb 2007, Jian Zhang wrote:

> I want to do "moran's I test" in R language. I try to use "gearymoran" in
> Package "ade4","moran" in Package "spdep", and Moran.I in Package "ape". But
> I do not know how to do it because data format is different.

Please consider posting on the R-sig-geo mailing list. If you are an 
ecologist, you may find the off-CRAN ncf package by Ottar Bjørnstad more 
intuitive - see the correlog function:

http://asi23.ent.psu.edu/onb1/software.html

> 
> My data:
> 
>     x        y       dbh   
> 
>   111.03    10.7       7
> 
>   118.11    0.28     1.2
> 
>   165.36    0.36     8.4
> 
>    282.9     0.3     7.5
> 
>   303.29   13.32    12.2
> 
>   319.28    3.88     6.2
> 
>      447       9       6
> 
>    445.5    18.3    13.8
> 
>    445.5    12.1     7.1
> 
>   467.64     1.2     4.7
> 
>    485.4    14.1     4.4
> 
>     2.98   23.95    11.7
> 
>       15   35.78    23.5
> 
>   130.21    23.6    14.1
> 
>    213.5   23.22    21.5
> 
>   233.57   28.76    35.4
> 
>    482.3    20.5       6
> 
>    69.73   45.21     7.5
> 
>     69.8   50.49    10.2
> 
>    76.65    45.5    21.5 
> 
>  
> 
> "x","y" are spatial coordinate;
> 
> "dbh" is variable
> 
> I want to test the spatial autocorrelation of "dbh" in different distances
> by "x" and "y".
> 
>  
> 
> Thanks,
> 
>                                 Jian Zhang
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 

-- 
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



More information about the R-help mailing list