R/moranI.stat.R

Defines functions moranI.stat

Documented in moranI.stat

moranI.stat<-function(data, applyto="SMR", ...)
{
	if(applyto != "SMR")
	{
		Z<- data$Observed - data$Expected
	}
	else
	{
		Z<- data$Observed/data$Expected 
		Z[!is.finite(Z)]<-0
	}

	return(spdep::moran(x=Z,...)$I)
}

Try the DCluster package in your browser

Any scripts or data that you put into this service are public.

DCluster documentation built on May 2, 2019, 6:10 p.m.