moranI {DCluster}R Documentation

Compute Moran's I autocorrelation statistic

Description

Compute Moran's I autocorrelation statistic using residuals or SMRs by means of function moran from package spdep.

Usage

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

Arguments

data A dataframe containing the data, as specified in the DClustermanpage.
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

Value

The value of the statistic computed.

References

Moran, P. A. P. (1948). The interpretation os statistical maps. Journal of the Royal Statistical Society, Series B 10, 243-251.

See Also

DCluster, moran, moranI, moranI.boot, MoranI.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) )

moranI.stat(data=sids, listw=col.W, n=length(ncCR85.nb), S0=Szero(col.W) )

moranI.stat(data=sids, applyto="SMR", listw=col.W, n=length(ncCR85.nb), 
        S0=Szero(col.W) )

[Package DCluster version 0.1-5 Index]