Skip to contents

Computes adjusted Wald (Agresi-Coull), Wilson, and exact confidence intervals for a population proportion. The Wilson confidence interval uses a continuity correction.

Usage

ci.prop(alpha, f, n)

Arguments

alpha

alpha level for 1-alpha confidence

f

number of participants who have the attribute

n

sample size

Value

Returns a 2-row matrix. The columns of row 1 are:

  • Estimate - adjusted estimate of proportion

  • SE - standard error of adjusted estimate

  • LL - lower limit of the adjusted Wald confidence interval

  • UL - upper limit of the adjusted Wald confidence interval

The columns of row 2 are:

  • Estimate - ML estimate of proportion

  • SE - standard error of ML estimate

  • LL - lower limit of the Wilson confidence interval

  • UL - upper limit of the Wilson confidence interval

The columns of row 3 are:

  • Estimate - ML estimate of proportion

  • SE - standard error of ML estimate

  • LL - lower limit of the exact confidence interval

  • UL - upper limit of the exact confidence interval

References

Agresti A, Coull BA (1998). “Approximate is better than 'exact' for interval estimation of binomial proportions.” The American Statistician, 52(2), 119–126. ISSN 0003-1305, doi:10.1080/00031305.1998.10480550 .

Examples

ci.prop(.05, 12, 100)
#>                 Estimate         SE         LL        UL
#> Adjusted Wald  0.1346154 0.03346842 0.06901848 0.2002123
#> Wilson with cc 0.1200000 0.03249615 0.06625153 0.2039772
#> Exact          0.1200000 0.03249615 0.06356890 0.2002357

# Should return:
#                  Estimate         SE         LL        UL
# Adjusted Wald   0.1346154 0.03346842 0.06901848 0.2002123
# Wilson with cc  0.1200000 0.03249615 0.06625153 0.2039772
# Exact           0.1200000 0.03249615 0.06356890 0.2002357