[R-sig-Geo] Morans I Correlogram help

Roger Bivand Roger.Bivand at nhh.no
Thu Jun 9 18:24:23 CEST 2011


On Thu, 9 Jun 2011, Sadz A wrote:

> Hi, 
>
> I am trying to get a moransI correlogram in R with either library (Ape) or 
> library (spdep). 
> I already have a Mantel correlogram (attached word.doc) but I really want to do 
> the 'same' for MoransI, unfortunately nothing I try is working. 
>
> The data I am using is X, Y location data (minicipXY.txt) and density 
> (RDdensityChange.txt), both of which I have attached. 
>
> If anyone knows how I can get my data to give me a MoransI correlogram graph and 
> associated stats, I would greatly appreciate any help or advice you have to 
> offer.

Try this:

xy <- read.table("municipXY.txt", header=TRUE)
dens <- read.table("RDdensityChange.txt", header=TRUE)
library(pgirmess)
corr <- correlog(xy, dens$change)
plot(corr)
corr

Hope this helps,

Roger


>
> Thank you 
> S.

-- 
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-sig-Geo mailing list