How to compute Moran's I with spdep in r?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to compute Moran's I with spdep in r?

Ashley L
I want to compute Moran's I with spdep in r using nearest-neighbour distances. I have computed Moran's I with ape using inverse distance weights but this isn't quite what I need to do.

I am trying to find if abundance data from sample plots within the same field are spatially autocorrelated.

Any help with code would be greatly appreciated as I'm at a bit of a loss.

An example of my data is as follows:


        Plot Field Site Grazing Longitude Latitude Abundance
IU1 IU1 JG I U 54.08931986 -2.012612581 151
IU2 IU2 JG I U 54.09094111 -2.015728871 55
IU3 IU3 JG I U 54.09008641 -2.015444623 174
MU1 MU1 BW M U 54.13777542 -2.314619382 142
MU2 MU2 BW M U 54.13921293 -2.318617344 191
MU3 MU3 BW M U 54.16877747 -2.321143587 296
GU1 GU1 RA G U 54.48859024 -2.542410413 18
GU2 GU2 RA G U 54.48959605 -2.543914636 21
GU3 GU3 RA G U 54.49201584 -2.544132113 16
IC1 IC1 HB I C 54.1115036 -2.069717248 477
IC2 IC2 HB I C 54.11447525 -2.067709605 412
IC3 IC3 HB I C 54.11361186 -2.065055211 246
MC1 MC1 LF M C 54.16004944 -2.325294813 212
MC2 MC2 LF M C 54.15713437 -2.364231825 359
MC3 MC3 LF M C 54.15199916 -2.321888526 125
GC1 GC1 CF G C 54.48360062 -2.536673625 179
GC2 GC2 CF G C 54.47825877 -2.537648678 204
GC3 GC3 CF G C 54.48162842 -2.536595543 327
IS1 IS1 UO I S 54.10816129 -2.065183202 172
IS2 IS2 UO I S 54.10597229 -2.059510668 223
IS3 IS3 UO I S 54.11033567 -2.051659226 374
MS1 MS1 HO M S 54.16153653 -2.335701625 387
MS2 MS2 HO M S 54.16375287 -2.332431873 562
MS3 MS3 HO M S 54.16036542 -2.284805814 362
GS1 GS1 GP G S 54.61083984 -2.550787489 97.234375
GS2 GS2 GP G S 54.49303691 -2.548659643 170.65625
GS3 GS3 GP G S 54.49409803 -2.548395356 87.3125