gearyc.stat {DCluster} | R Documentation |
Compute Moran's I autocorrelation statistic using either residuals or SMRs by means of cuntion geary from package spdep.
gearyc.stat(data, applyto="residuals", ...)
data |
A dataframe containing the data, as specified in the DCluster manpage. |
applyto |
A string with the name of the statistic with which calculate Moran's Index. It may be either residulas or SMR. |
... |
Additional arguments needed by function moran from package spdep |
Geary, R. C. (1954). The contiguity ratio and statistical mapping. The Incorporated Statistician 5, 115-145.
DCluster, geary, gearyc, gearyc.boot, gearyc.pboot
library(spdep) data(nc.sids) col.W <- nb2listw(ncCR85.nb, zero.policy=TRUE) sids<-data.frame(Observed=nc.sids$SID74) sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74)) gearyc.stat(data=sids, listw=col.W, n=length(ncCR85.nb), n1=length(ncCR85.nb)-1, S0=Szero(col.W) ) gearyc.stat(data=sids, applyto="SMR", listw=col.W, n=length(ncCR85.nb), n1=length(ncCR85.nb)-1,S0=Szero(col.W) )