1\name{besagnewell} 2 3\alias{besagnewell} 4 5\title{Besag and Newell's Statistic for Spatial Clustering} 6 7\description{ 8Besag & Newell's statistic looks for clusters of size \emph{k}, i. e., where 9the number of observed cases is \emph{k}. At every area where a case has 10appeared, the number of neighbouring regions needed to reach $k$ cases is 11calculated. If this number is too small, that is, too many observed cases in 12just a few regions with low expected cases, then it is marked as a cluster. 13} 14 15 16\seealso{ 17DCluster, besagnewell.stat, besagnewell.boot, besagnewell.pboot, bn.iscluster 18} 19 20\references{ 21Besag, J. and Newell, J.(1991). The detection of clusters in rare diseases. 22Journal of the Royal Statistical Society A 154, 143-155. 23} 24 25\examples{ 26#B&N must use the centroids as grid. 27#The size of teh cluster is 20. 28#100 bootstrap simulations are performed 29#Poisson is the model used in the bootstrap simulations to generate the 30#observations. 31#Signifiance level is 0'05, even though multiple tests are made. 32 33library(boot) 34library(spdep) 35 36data(nc.sids) 37 38sids<-data.frame(Observed=nc.sids$SID74) 39sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74)) 40sids<-cbind(sids, x=nc.sids$x, y=nc.sids$y) 41 42bnresults<-opgam(sids, thegrid=sids[,c("x","y")], alpha=.05, 43 iscluster=bn.iscluster, set.idxorder=TRUE, k=20, model="poisson", 44 R=100, mle=calculate.mle(sids) ) 45 46#Plot all the centroids 47plot(sids$x, sids$y) 48 49#Plot signifiant centroids in red 50points(bnresults$x, bnresults$y, col="red", pch=19) 51} 52 53\keyword{spatial} 54