umpu.binom: UMPU Test for the Binomial Distribution

Description Usage Arguments Details Value Examples

View source: R/umpu.binom.R

Description

Calculate the uniformly most powerful unbiased (UMPU) two-tailed test for the binomial distribution.

Usage

1
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

1
2
3
4
5
6
    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
  

when p is strictly between zero and one.

Value

a vector of values of the critical function.

Examples

1
2
library(ump)
umpu.binom(0:10, 10, 0.6, 0.1)

ump documentation built on May 29, 2017, 2:48 p.m.