Last data update: 2014.03.03

R: Bootstrap Replicates of Potthoff-Whittinghill's Statistic
pottwhitt.bootR Documentation

Bootstrap Replicates of Potthoff-Whittinghill's Statistic

Description

Generate bootstrap replicates of Potthoff-Whittinghill's statistic (function pottwhitt.stat), by means of function boot from the boot library. Notice that these functions should not be used separately but as argument statistic when calling function boot.

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

pottwhitt.pboot is used when performing a parametric bootstrap.

Usage

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

Arguments

data

A dataframe containing the data, as specified in the DCluster manual page.

i

Permutation generated by the bootstrap procedure

...

Additional arguments passed when performing a bootstrap.

Value

Both functions return the value of the statistic.

References

Potthoff, R. F. and Whittinghill, M.(1966). Testing for Homogeneity: I. The Binomial and Multinomial Distributions. Biometrika 53, 167-182.

Potthoff, R. F. and Whittinghill, M.(1966). Testing for Homogeneity: The Poisson Distribution. Biometrika 53, 183-190.

See Also

DCluster, pottwhitt, pottwhitt.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


#Permutation model
pw.boot<-boot(sids, statistic=pottwhitt.boot, R=niter)
plot(pw.boot)#Plot results


#Multinomial model
pw.mboot<-boot(sids, statistic=pottwhitt.pboot, sim="parametric", ran.gen=multinom.sim,  R=niter)
plot(pw.mboot)#Plot results

#Poisson model
pw.pboot<-boot(sids, statistic=pottwhitt.pboot, sim="parametric", ran.gen=poisson.sim,  R=niter)
plot(pw.pboot)#Plot results

#Poisson-Gamma model
pw.pgboot<-boot(sids, statistic=pottwhitt.pboot, sim="parametric", ran.gen=negbin.sim, R=niter)
plot(pw.pgboot)#Plot 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/pottwhitt.boot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: pottwhitt.boot
> ### Title: Bootstrap Replicates of Potthoff-Whittinghill's Statistic
> ### Aliases: pottwhitt.boot pottwhitt.pboot
> ### Keywords: htest
> 
> ### ** 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
> 
> 
> #Permutation model
> pw.boot<-boot(sids, statistic=pottwhitt.boot, R=niter)
> plot(pw.boot)#Plot results
> 
> 
> #Multinomial model
> pw.mboot<-boot(sids, statistic=pottwhitt.pboot, sim="parametric", ran.gen=multinom.sim,  R=niter)
> plot(pw.mboot)#Plot results
> 
> #Poisson model
> pw.pboot<-boot(sids, statistic=pottwhitt.pboot, sim="parametric", ran.gen=poisson.sim,  R=niter)
> plot(pw.pboot)#Plot results
> 
> #Poisson-Gamma model
> pw.pgboot<-boot(sids, statistic=pottwhitt.pboot, sim="parametric", ran.gen=negbin.sim, R=niter)
> plot(pw.pgboot)#Plot results
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>