R/acceptbin.R

Defines functions acceptbin

Documented in acceptbin

acceptbin <-
function(x, n, p){

  p1 = 1 - pbinom(x - 1, n, p)
  p2 = pbinom(x, n, p)
  a1 = p1 + pbinom(qbinom(p1, n, p) - 1, n, p)
  a2 = p2 + 1 - pbinom(qbinom(1 - p2, n, p), n, p)
  return(min(a1,a2))
}

Try the PropCIs package in your browser

Any scripts or data that you put into this service are public.

PropCIs documentation built on Feb. 23, 2018, 5:02 p.m.