multBinom: compute p-values, CI for binomial proportions

View source: R/multBinom.R

multBinomR Documentation

compute p-values, CI for binomial proportions

Description

A wrapper for several frequentist tests for binomial proportions, it provides consistent outputs regardless of test method.

Usage

multBinom(dat, prob0, n, testv = c("binom.test", "accept", "chisq", "wald"))

Arguments

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

Value

dataframe same length as dat with p-value estimates, upper and lower confidence limits, and the name of the test used

Examples


# 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")


dushoff/checkPlots documentation built on Jan. 9, 2025, 11:10 a.m.