binom.sim: Simulates confidence intervals for binomial data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/binom.sim.R

Description

Simulates binomial data for testing confidence interval coverage.

Usage

1
binom.sim(M = 200, n = 100, p = 0.5, conf.level = 0.95, methods = "all",  ...)

Arguments

M

Number of simulations to create.

n

Vector of number of independent trials in the binomial experiment.

p

Probability of success under the null hypothesis.

conf.level

The level used in computing the confidence interval.

methods

The method used to compute power.

...

Additional arguments to pass to binom.confint

Details

M binomial observations are created using rbinom(M, n, p). The average number of times a confidence interval covers p is returned.

Value

The estimated coverage based on which method is requested.

Author(s)

Sundar Dorai-Raj (sdorairaj@gmail.com)

See Also

binom.confint, binom.bayes, binom.logit, binom.probit, binom.coverage

Examples

1
binom.sim(p = 0.95, method = "lrt")

Example output

    mean     lower     upper      width
lrt 0.91 0.8651434 0.9444351 0.08458835

binom documentation built on May 2, 2019, 5:16 p.m.

Related to binom.sim in binom...