R/binom.approx.R

"binom.approx" <-
  function(x, n, conf.level = 0.95) {
    Z <- qnorm(0.5*(1 + conf.level))
    SE.R <- sqrt(x * (n - x) / (n^3))
    R.lci <- x/n - Z*SE.R
    R.uci <- x/n + Z*SE.R
    data.frame(x = x,
               n = n,
               proportion = x/n,
               lower = R.lci,
               upper = R.uci,
               conf.level = conf.level
               )  
}

Try the epitools package in your browser

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

epitools documentation built on March 26, 2020, 9:14 p.m.