estimate Proportion Sample Size
fun estimateProportionSampleSize(desiredHW: Double, pEst: Double = 0.5, level: Double = 0.95): Long(source)
Estimate the sample size for a proportion based on a normal approximation: the smallest whole n with z(1-alpha/2)*sqrt(p(1-p)/n) <= desiredHW, and never less than 1.
Return
the estimated sample size
Parameters
desired HW
the desired half-width (must be bigger than 0)
p Est
an estimate of the proportion (must be between 0 and 1)
level
the confidence level (must be between 0 and 1)