Last data update: 2014.03.03

R: Generate Boostrap Replicates of Besag and Newell's Statistic
besagnewell.bootR Documentation

Generate Boostrap Replicates of Besag and Newell's Statistic

Description

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.

Usage

besagnewell.boot(data, i, ...)
besagnewell.pboot(...)

Arguments

data

A dataframe with the data, as explained in DCluster.

i

Permutation generated by the non-parametric bootstrap.

...

Additional arguments needed.

Value

Both functions return the value of the statistic.

References

Besag, J. and Newell, J.(1991). The detection of clusters in rare diseases. Journal of the Royal Statistical Society A 154, 143-155.

See Also

DCluster, boot, besagnewell, besagnewell.stat, bn.iscluster

Examples

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

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DCluster)
Loading required package: boot
Loading required package: spdep
Loading required package: sp
Loading required package: Matrix
Loading required package: MASS
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DCluster/besagnewell.boot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: besagnewell.boot
> ### Title: Generate Boostrap Replicates of Besag and Newell's Statistic
> ### Aliases: besagnewell.boot besagnewell.pboot
> ### Keywords: spatial
> 
> ### ** Examples
> 
> 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
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>