R/tango.stat.R

Defines functions tango.stat

Documented in tango.stat

tango.stat<-function(data, listw, zero.policy=FALSE)
{
	p<-scale(data$Expected, center=FALSE, scale=sum(data$Expected))
	r<-scale(data$Observed, center=FALSE, scale=sum(data$Observed))

	rp<-r-p
	T<-lag.listw(listw, rp, zero.policy = zero.policy)
	T<-t(rp)%*%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.