View source: R/besagnewell.boot.R
besagnewell.boot | R Documentation |
Generate boostrap replicates of Besag and Newell's statistic, by means of function boot from boot library. Notice that these functions should not be used separately but as argument statistic when calling function boot.
besagnewell.boot is used when performing a non-parametric bootstrap.
When sampling models are Multinomial or Poisson it is quite straightforwad to obtain the actual p-value as shown in the examples. When Permutation or Negative Binomial are used, simulation must be used to estimate significance.
besagnewell.boot(data, i, ...)
besagnewell.pboot(...)
data |
A dataframe with the data, as explained in DCluster. |
i |
Permutation generated by the non-parametric bootstrap. |
... |
Additional arguments needed. |
Both functions return 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, boot, besagnewell, besagnewell.stat, bn.iscluster
library(boot)
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)
niter<-100
#Permutation model
besn.perboot<-boot(sids, statistic=besagnewell.boot, R=niter, k=20)
plot(besn.perboot)#Display results
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.