rsamplingpoissonsample-size

Is there an R function to calculate the required sample size using the Clopper-Pearson Confidence Interval?


I need to determine the appropriate sample size to estimate p in a binomial process, using R. I see the package binomSamSize, but I do not see sample size determinations using Clopper-Pearson.


Solution

  • The binomSamSize pkg has a general purpose function binom.ciss, which allows you to use any confidence interval function from the binom pkg for the sample size determination. Hence, you can do Clopper-Pearson sample size determination easily using:

    library(binomSamSize)
    ciss.binom(p0=0.1, d=0.1, alpha=0.05, ci.fun=binom::binom.exact)