R/jeffrey.R

jeffrey <- function(x, n, conf.level = 0.95)
{
    .Deprecated("jeffreys")
    a <- 1 - conf.level
    
    ll <- if (x == 0) 0 else qbeta(a / 2, x + 0.5, n - x + 0.5)  
    ul <- if (x == n) 1 else qbeta(1 - a / 2, x + 0.5, n - x + 0.5)

    res <- c("lower" = ll, "prop" = x / n, "upper" = ul)
    return(res)
}

Try the biostatUZH package in your browser

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

biostatUZH documentation built on May 2, 2019, 6:06 p.m.