wilson.ci: Confidence Intervals for Proportions

wilson.ciR Documentation

Confidence Intervals for Proportions

Description

Alternatives to prop.test and binom.test.

Usage

wilson.ci(x, n = 100, conf.level = 0.95)

Arguments

x

number of 'successes'

n

number of trials

conf.level

confidence level

Details

wald.ci produces Wald confidence intervals. wilson.ci produces Wilson confidence intervals (also called “plus-4” confidence intervals) which are Wald intervals computed from data formed by adding 2 successes and 2 failures. The Wilson confidence intervals have better coverage rates for small samples.

Value

Lower and upper bounds of a two-sided confidence interval.

Author(s)

Randall Pruim

References

A. Agresti and B. A. Coull, Approximate is better then ‘exact’ for interval estimation of binomial proportions, American Statistician 52 (1998), 119–126.

Examples


prop.test(12,30)
prop.test(12,30, correct=FALSE)
wald.ci(12,30)
wilson.ci(12,30)
wald.ci(12+2,30+4)


fastR2 documentation built on Nov. 9, 2023, 9:06 a.m.