binom.sim.RdSimulates binomial data for testing confidence interval coverage.
binom.sim(M = 200, n = 100, p = 0.5, conf.level = 0.95, methods = "all", ...)Number of simulations to create.
Vector of number of independent trials in the binomial experiment.
Probability of success under the null hypothesis.
The level used in computing the confidence interval.
The method used to compute power.
Additional arguments to pass to binom.confint
M binomial observations are created using rbinom(M, n,
p). The average number of times a confidence interval covers
p is returned.
The estimated coverage based on which method is requested.
binom.sim(p = 0.95, method = "lrt")
#> mean lower upper width
#> lrt 0.925 0.8830696 0.9561327 0.08526419