Skip to contents

This method does not account for estimated confidence intervals for each unique experiment, and it uses the normal approximation to build confidence intervals. This is suitable for cases where the Central Limit Theorem holds (i.e. 30+ experiments).

Usage

BinomCIMeanNorm(x, n, alpha = 0.05)

Arguments

x

matrix or numeric. First column of the matrix, or the numeric vector, should represent the estimated binomial proportion for each experiment.

n

integer. Number of trials per experiment. If length(n) does not match the number of estimated binomial proportions it is repeated.

alpha

numeric. Probability level for Z-value in normal distribution confidence interval calculation.

Value

matrix containing columns "est", "lwr.ci", "upr.ci"

Examples


library(DescTools)

# example: 3 binomial experiments, 10 trials, confidence level 0.8
x <- DescTools::BinomCI(c(5,6,7), 10, 0.8)

# Inspect input
x
#>     est    lwr.ci    upr.ci
#> x.1 0.5 0.3122044 0.6877956
#> x.2 0.6 0.4013518 0.7704344
#> x.3 0.7 0.4973717 0.8462008

# Calculate mean binomial probability and CI using normal approximation
# NOTE: the estimated CI from BinomCI() are _not_ considered in this method
BinomCIMeanNorm(x, 10)
#>      est    lwr.ci    upr.ci
#> [1,] 0.6 0.4399696 0.7600304

# compare to straight arithmetic average
colMeans(x)
#>       est    lwr.ci    upr.ci 
#> 0.6000000 0.4036427 0.7681436