wilsonCI: Wilson (Agresti-Coull) CI for a Binomial Proportion

Description Usage Arguments Value Author(s) References See Also Examples

Description

Calculate the confidence interval for a "small sample" binomial proportion using the Agresti-Coull (1998) method. Useful for small samples where the Wald "large sample" normal test used by binom.test is not appropriate (when n is small or when p is close to 0 or 1).

Usage

1
wilsonCI(x, n, conf.level = 0.95)

Arguments

x

an integer number of successes

n

an integer number of trials

conf.level

the confidence level for interval estimation; defaults to 0.95

Value

Returns an object of type prop.ci, which includes:

x

the number of successes

n

the number of trials

conf.level

the confidence interval level

lower

the lower bound of the confidence interval

upper

the upper bound of the confidence interval

interval

the interval

estimate

the estimated proportion ((x+2)/(n+4))

Author(s)

Kevin M. Middleton (kmm@csusb.edu)

References

Agresti, A. and B.A. Coull. 1998. Approximate is better than "exact" for interval estimation of binomial proportions. The American Statistician 52: 119-126. http://www.jstor.org/stable/2685469

See Also

binom.test

Examples

1
2
3
4
propCI(7, 50)
propCI(7, 50, conf.level = 0.99)
# should be very close to the score interval of prop.test
prop.test(7,50)

abd documentation built on May 2, 2019, 4:46 p.m.