Last data update: 2014.03.03

R: Generate Bootstrap Replicates of Kulldorff and Nagarwalla's...
kullnagar.bootR Documentation

Generate Bootstrap Replicates of Kulldorff and Nagarwalla's Statistic

Description

Generate bootstrap replicates of Kulldorff and Nagarwalla's statistic, by calling functions boot and kullnagar.stat.

kullnagar.boot is used when using non-parametric bootstrap to estimate the distribution of the statistic.

kullnagar.pboot is used when performing parametric bootstrap.

Usage

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

Arguments

data

A dataframe with the data as explained in DCluster.

i

Permutation created in non-parametric bootstrap.

...

Additional arguments passed to the functions.

Value

Both functions return the value of the statistic.

References

Kulldorff, Martin and Nagarwalla, Neville (1995). Spatial Disease Clusters: Detection and Inference. Statistics in Medicine 14, 799-810.

See Also

DCluster, boot, kullnagar, kullnagar.stat, kn.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, Population=nc.sids$BIR74, x=nc.sids$x, y=nc.sids$y)

niter<-100

#Permutation  model
kn.perboot<-boot(sids, statistic=kullnagar.boot, R=niter, fractpop=.2)
plot(kn.perboot)#Display results

#Multinomial model
kn.mboot<-boot(sids, statistic=kullnagar.pboot, sim="parametric", 
	ran.gen=multinom.sim,  R=niter, fractpop=.2)
plot(kn.mboot)#Display results

#Poisson model
kn.pboot<-boot(sids, statistic=kullnagar.pboot, sim="parametric", 
	ran.gen=poisson.sim,  R=niter, fractpop=.2)
plot(kn.pboot)#Display results

#Poisson-Gamma model
kn.pgboot<-boot(sids, statistic=kullnagar.pboot, sim="parametric", 
	ran.gen=negbin.sim, R=niter, fractpop=.2)
plot(kn.pgboot)#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/kullnagar.boot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: kullnagar.boot
> ### Title: Generate Bootstrap Replicates of Kulldorff and Nagarwalla's
> ###   Statistic
> ### Aliases: kullnagar.boot kullnagar.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, Population=nc.sids$BIR74, x=nc.sids$x, y=nc.sids$y)
> 
> niter<-100
> 
> #Permutation  model
> kn.perboot<-boot(sids, statistic=kullnagar.boot, R=niter, fractpop=.2)
> plot(kn.perboot)#Display results
> 
> #Multinomial model
> kn.mboot<-boot(sids, statistic=kullnagar.pboot, sim="parametric", 
+ 	ran.gen=multinom.sim,  R=niter, fractpop=.2)
> plot(kn.mboot)#Display results
> 
> #Poisson model
> kn.pboot<-boot(sids, statistic=kullnagar.pboot, sim="parametric", 
+ 	ran.gen=poisson.sim,  R=niter, fractpop=.2)
> plot(kn.pboot)#Display results
> 
> #Poisson-Gamma model
> kn.pgboot<-boot(sids, statistic=kullnagar.pboot, sim="parametric", 
+ 	ran.gen=negbin.sim, R=niter, fractpop=.2)
> plot(kn.pgboot)#Display results
> 
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>