clopper.pearson.ci: Clopper-Pearson Confidence Interval

Description Usage Arguments Details Value References Examples

View source: R/clopper.pearson.ci.R

Description

Computing upper, lower or two-sided Clopper-Pearson confidence limits for a given confidence level.

Usage

1
clopper.pearson.ci(k, n, alpha = 0.1, CI = "upper")

Arguments

k

number of failures/successes.

n

number of trials.

alpha

significance level for the (1-alpha)* 100% confidence level (default alpha=0.1).

CI

indicates the kind of the confidence interval, options: "upper" (default), "lower", "two.sided".

Details

Computes the confidence limits for the p of a binomial distribution. Confidence intervals are obtained by the definition of Clopper and Pearson.

Value

A data frame containing the kind of the confidence interval, upper and lower limits and the used significance level alpha.

References

D.Kurz, H.Lewitschnig, J.Pilz, Decision-Theoretical Model for Failures which are Tackled by Countermeasures, IEEE Transactions on Reliability, Vol. 63, No. 2, June 2014.

C.J.Clopper and E.S. Pearson, The use of confidence or fiducial limits illustrated in the case of the binomial, Biometrika, vol. 26, 404-413, 1934.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
clopper.pearson.ci(5,100000,alpha=0.05)
# Confidence.Interval = upper
# Lower.limit = 0
# Upper.limit = 0.0001051275
# alpha = 0.05

clopper.pearson.ci(5,100000,CI="two.sided")
# Confidence.Interval =  two.sided
# Lower.limit = 1.97017e-05
# Upper.limit = 0.0001051275
# alpha = 0.1

Example output

 Confidence.Interval Lower.limit  Upper.limit alpha
               upper           0 0.0001051275  0.05
 Confidence.Interval Lower.limit  Upper.limit alpha
           two.sided 1.97017e-05 0.0001051275   0.1

GenBinomApps documentation built on May 29, 2017, 3:58 p.m.