multBinom | R Documentation |
A wrapper for several frequentist tests for binomial proportions, it provides consistent outputs regardless of test method.
multBinom(dat, prob0, n, testv = c("binom.test", "accept", "chisq", "wald"))
dat |
integer vector, observed number of successes |
prob0 |
scalar; true probability of success |
n |
scalar, number of trials |
testv |
character, which binomial test to use for estimating CI and p |
dataframe same length as dat
with p-value estimates, upper and lower
confidence limits, and the name of the test used
# set parameters
p_true <- 0.7
n_trials <- 10
n_samples <- 10
# generate data
mydat <- rbinom(n_samples, n_trials, p_true)
# run tests
multBinom(mydat, p_true, n_trials, testv = "binom.test")
multBinom(mydat, p_true, n_trials, testv = "wald")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.