Computes the sample size required to test a single population proportion with desired power in a 1-group design. Set the proportion planning value to .5 for a conservatively large sample size. The value of the effect size (expected population proportion minus hypothesized value) need not be based on the proportion planning value.
size.test.prop1(alpha, pow, p, es)
alpha level for hypothesis test
desired power
planning value of proportion
planning value of proportion minus null hypothesis value
Returns the required sample size
size.test.prop1(.05, .9, .5, .2)
#> Sample size
#> [1,] 66
# Should return:
# Sample size
# [1,] 66