gearyc.stat {DCluster}R Documentation

Compute Moran's I autocorrelation statistic

Description

Compute Moran's I autocorrelation statistic using either residuals or SMRs by means of cuntion geary from package spdep.

Usage

gearyc.stat(data, applyto="residuals", ...)

Arguments

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

References

Geary, R. C. (1954). The contiguity ratio and statistical mapping. The Incorporated Statistician 5, 115-145.

See Also

DCluster, geary, gearyc, gearyc.boot, gearyc.pboot

Examples

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


[Package DCluster version 0.1-5 Index]