Last data update: 2014.03.03

R: Generate Boostrap Replicates of Stone's Statistic
stone.bootR Documentation

Generate Boostrap Replicates of Stone's Statistic

Description

Generate bootstrap replicates of Stone's statictic, by means of function boot from boot package. Notice that these functions should not be used separately but as argument statistic when calling function boot.

stone.boot is used when performing a non-parametric bootstrap.

stone.pboot is used when performing a parametric bootstrap.

Usage

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

Arguments

data

A dataframe with all the data, as explained in the DCluster manual page.

i

Permutation created in non-parametric bootstrap.

...

Additional arguments passed to the functions.

Value

Both functions return the value of the statistic.

References

Stone, R. A. (1988). Investigating of excess environmental risks around putative sources: Statistical problems and a proposed test. Statistics in Medicine 7,649-660.

See Also

DCluster, boot, stone.stat

Examples

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

#All Tests are performed around county 78.


#Permutation  model
st.perboot<-boot(sids, statistic=stone.boot, R=niter, region=78)
plot(st.perboot)#Display results

#Multinomial model
st.mboot<-boot(sids, statistic=stone.pboot, sim="parametric",
  ran.gen=multinom.sim,  R=niter, region=78)
plot(st.mboot)#Display results

#Poisson model
st.pboot<-boot(sids, statistic=stone.pboot, sim="parametric",
  ran.gen=poisson.sim,  R=niter, region=78)
plot(st.pboot)#Display results

#Poisson-Gamma model
st.pgboot<-boot(sids, statistic=stone.pboot, sim="parametric",
  ran.gen=negbin.sim, R=niter, region=78)
plot(st.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/stone.boot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: stone.boot
> ### Title: Generate Boostrap Replicates of Stone's Statistic
> ### Aliases: stone.boot stone.pboot
> ### Keywords: spatial
> 
> ### ** Examples
> 
> 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
> 
> #All Tests are performed around county 78.
> 
> 
> #Permutation  model
> st.perboot<-boot(sids, statistic=stone.boot, R=niter, region=78)
> plot(st.perboot)#Display results
> 
> #Multinomial model
> st.mboot<-boot(sids, statistic=stone.pboot, sim="parametric",
+   ran.gen=multinom.sim,  R=niter, region=78)
> plot(st.mboot)#Display results
> 
> #Poisson model
> st.pboot<-boot(sids, statistic=stone.pboot, sim="parametric",
+   ran.gen=poisson.sim,  R=niter, region=78)
> plot(st.pboot)#Display results
> 
> #Poisson-Gamma model
> st.pgboot<-boot(sids, statistic=stone.pboot, sim="parametric",
+   ran.gen=negbin.sim, R=niter, region=78)
> plot(st.pgboot)#Display results
> 
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>