R/CP.lower.R

#' @export

CP.lower <-
function (x, n, a = 0.05)
{
    #       FUNCTION COMPUTES EXACT CONFIDENCE INTERVAL FOR
    #       BINOMIAL PROBABILITY BY INVERSION OF THE EXACT TEST.
    #
    #       REQUIRED ARGUMENTS:
    #       x - observed value (scalar)
    #       n - number of trials
    #
    if (x > 0 & x < n) {lower <- stats::qbeta(a,x,n-x+1)}
    if (x == 0) {lower <- 0}
    if (x == n) {lower <- a^(1/n)}
    lower
}

Try the CLAST package in your browser

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

CLAST documentation built on April 8, 2022, 9:06 a.m.