Description Usage Arguments Value References See Also Examples
Generate bootstrap replicates of the Pearson's Chi-square statistic (function achisq.stat), 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.
achisq.boot is used when performing a non-parametric bootstrap.
achisq.pboot is used when performing a parametric bootstrap.
1 2 | achisq.boot(data, i, ...)
achisq.pboot(...)
|
data |
A dataframe containing the data, as specified in DCluster manpage. |
i |
Permutation generated by the non-parametric bootstrap procedure. |
... |
Additional arguments passed when performing a bootstrap. |
Both functions return the value of the statistic.
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.
DCluster, boot, achisq, achisq.stat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 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))
niter<-100
#Permutation model
chq.perboot<-boot(sids, statistic=achisq.boot, R=niter)
plot(chq.perboot)#Display results
#Multinomial model
chq.mboot<-boot(sids, statistic=achisq.pboot, sim="parametric", ran.gen=multinom.sim, R=niter)
plot(chq.mboot)#Display results
#Poisson model
chq.pboot<-boot(sids, statistic=achisq.pboot, sim="parametric", ran.gen=poisson.sim, R=niter)
plot(chq.pboot)#Display results
#Poisson-Gamma model
chq.pgboot<-boot(sids, statistic=achisq.pboot, sim="parametric", ran.gen=negbin.sim, R=niter)
plot(chq.pgboot)#Display results
|
Loading required package: boot
Loading required package: spdep
Loading required package: sp
Loading required package: Matrix
Loading required package: MASS
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.