binom_ci: Confidence Intervals for Binomial Probabilities

Description Usage Arguments Author(s) References Examples

View source: R/tbr_binom.R

Description

An implementation of the binconf function in Frank Harrell's Hmisc package. Produces 1-alpha confidence intervals for binomial probabilities.

Usage

1
2
3
4
5
6
7
binom_ci(
  x,
  n,
  alpha = 0.05,
  method = c("wilson", "exact", "asymptotic"),
  return.df = FALSE
)

Arguments

x

vector containing the number of "successes" for binomial variates.

n

vector containing the numbers of corresponding observations.

alpha

probability of a type I error, so confidence coefficient = 1-alpha.

method

character string specifying which method to use. The "exact" method uses the F distribution to compute exact (based on the binomial cdf) intervals; the "wilson" interval is score-test-based; and the "asymptotic" is the text-book, asymptotic normal interval. Following Agresti and Coull, the Wilson interval is to be preferred and so is the default.

return.df

logical flag to indicate that a data frame rather than a matrix be returned.

Author(s)

Frank Harrell, modified by Michael Schramm

References

A. Agresti and B.A. Coull, Approximate is better than "exact" for interval estimation of binomial proportions, American Statistician, 52:119–126, 1998.

R.G. Newcombe, Logit confidence intervals and the inverse sinh transformation, American Statistician, 55:200–202, 2001.

L.D. Brown, T.T. Cai and A. DasGupta, Interval estimation for a binomial proportion (with discussion), Statistical Science, 16:101–133, 2001.

Examples

1
binom_ci(46,50,method="wilson")

tbrf documentation built on April 14, 2020, 7:10 p.m.