Description Usage Arguments Value References See Also Examples
View source: R/besagnewell.stat.R
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.
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
1 2 3 4 5 6 7 8 9 | 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)
|
Loading required package: boot
Loading required package: spdep
Loading required package: sp
Loading required package: Matrix
Loading required package: MASS
value size
6 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.