stone.boot | R Documentation |
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.
stone.boot(data, i, ...)
stone.pboot(...)
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. |
Both functions return the value of the statistic.
Stone, R. A. (1988). Investigating of excess environmental risks around putative sources: Statistical problems and a proposed test. Statistics in Medicine 7,649-660.
DCluster, boot, stone.stat
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.