R/whittermore.stat.R

Defines functions whittermore.stat

Documented in whittermore.stat

whittermore.stat<-function(data, listw, zero.policy=FALSE)
{
	n<-length(data$Observed)
	r<-scale(data$Observed, center=FALSE, scale=sum(data$Observed) )

	T<-lag.listw(listw, r, zero.policy = zero.policy)
	T<-(n/(n-1))*(t(r)%*%T)

	return(T)
}

Try the DCluster package in your browser

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

DCluster documentation built on Sept. 3, 2023, 5:07 p.m.