View source: R/besagnewell.stat.R
besagnewell.stat | R Documentation |
besagnewell.stat computes the statistic around a single location. Data passed must be sorted according to distance to central region, which is supposed to be the first row in the dataframe. Notice that the size of the cluster is k+1.
besagnewell.stat(data, k)
data |
A dataframe with the data, as explained in DCluster. |
k |
Cluster size. |
A vector of two elements: the value of the statistic and the size of the cluster (which is equal to the value of the statistic).
Besag, J. and Newell, J.(1991). The detection of clusters in rare diseases. Journal of the Royal Statistical Society A 154, 143-155.
DCluster, besagnewell, besagnewell.boot, besagnewell.pboot
library(spdep)
data(nc.sids)
sids<-data.frame(Observed=nc.sids$SID74)
sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74))
sids<-cbind(sids, x=nc.sids$x, y=nc.sids$y)
besagnewell.stat(sids, k=20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.