Learn R Programming

conf (version 1.8.2)

binomTest: Confidence Intervals for Binomial Proportions

Description

Generates lower and upper confidence interval limits for a binomial proportion using different types of confidence intervals.

Usage

binomTest(n, x,
           alpha = 0.05,
           intervalType = "Clopper-Pearson")

Arguments

n

sample size

x

number of successes

alpha

significance level for confidence interval

intervalType

type of confidence interval used; either "Clopper-Pearson", "Wald", "Wilson-Score", "Jeffreys", "Agresti-Coull", "Arcsine", or "Blaker"

Author

Hayeon Park (hpark031@gmail.com), Larry Leemis (leemis@math.wm.edu)

Details

Generates a lower and upper confidence interval limit for a binomial proportion using

  • various types of confidence intervals,

  • various sample sizes, and

  • various numbers of successes.

When the binomTest function is called, it returns a two-element vector in which

  • the first element is the lower bound of the confidence interval, and

  • the second element is the upper bound of the confidence interval.

This confidence interval is constructed by calculating lower and upper bounds associated with the confidence interval procedure specified by the intervalType argument. Lower bounds that are negative are set to 0 and upper bounds that are greater than 1 are set to 1.

See Also

Examples

Run this code
  binomTest(10, 6)
  binomTest(100, 30, intervalType = "Agresti-Coull")

Run the code above in your browser using DataLab