| bin.ci {NCStats} | R Documentation |
Uses one of three methods to compute a confidence interval for the probability of success in a binomial distribution.
bin.ci(x,n,conf.level=0.95,type=c("wilson","exact","asymptotic","all"))
x |
A number representing the number of observed successes. |
n |
A number representing the sample size. |
conf.level |
A number indicating the level of confidence to use for constructing confidence intervals (default is 0.95). |
type |
A string that identifies the type of method to use for the calculations. See details. |
This function will compute confidence interval for three possible methods chosen with the type argument.
type="wilson"type="exact"type="asymptotic"type="AC2"Note that Agresti and Coull (2000) suggest that the Wilson interval is the preferred method.
A 1x2 matrix containing the lower and upper confidence interval bounds.
Derek H. Ogle, dogle@northland.edu. However, this is primarily a wrapper function for binconf in the Hmisc package (this implementation uses arguments, specificially conf.level, that more closely match other functions).
Agresti, A. and B.A. Coull. 1998. Approximate is better than “exact” for interval estimation of binomial proportions. American Statistician, 52:119-126.
binconf in Hmisc, bin.conf.int in epitools, and binom.conf.interval in UCS.
bin.ci(7,20,type="wilson") bin.ci(7,20,type="exact") bin.ci(7,20,type="all")