estimateProportionSampleSize

fun estimateProportionSampleSize(desiredHW: Double, pEst: Double = 0.5, level: Double = 0.95): Long

Estimate the sample size for a proportion based on a normal approximation

Return

the estimated sample size

Parameters

desiredHW

the desired half-width (must be bigger than 0)

pEst

an estimate of the proportion (must be between 0 and 1)

level

the confidence level (must be between 0 and 1)