Calculate the uniformly most powerful unbiased (UMPU) two-tailed test
for the binomial distribution.
Usage
umpu.binom(x, n, p, alpha, maxiter = 10, tol = 1e-9)
Arguments
x
binomial observations.
n
number of observations.
p
the success probability under the null hypothesis.
alpha
the significance level.
maxiter
the maximum number of iterations allowed.
tol
tolerance used in testing floating point numbers.
Details
At most one of x, p, and alpha is allowed to be
a vector. Evaluates the critical function for the UMPU two-tailed
test for the binomial distribution, which satisfies the following
x <- seq(0, n)
phix <- umpu.binom(x, n, p, alpha)
px <- dbinom(x, n, p)
sum(phix * px) == alpha
sum(x * phix * px) == n * p * alpha