Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


PracTools (version 1.6)

nPropMoe: Simple random sample size for a proportion based on margin of error

Description

Calculates a simple random sample size based on a specified margin of error.

Usage

nPropMoe(moe.sw, e, alpha = 0.05, pU, N = Inf)

Value

numeric sample size

Arguments

moe.sw

switch for setting desired margin of error (1 = CI half-width on the proportion; 2 = CI half-width on a proportion divided by pU)

e

desired margin of error; either e=z1α/2V(ps) or e=z1α/2CV(ps)

alpha

1 - (confidence level)

pU

population proportion

N

number of units in finite population

Author

Richard Valliant, Jill A. Dever, Frauke Kreuter

Details

The margin of error can be set as the half-width of a normal approximation confidence interval, e=z1α/2V(ps), or as the half-width of a normal approximation confidence interval divided by the population proportion, e=z1α/2CV(ps). The type of margin of error is selected by the parameter moe.sw where moe.sw=1 sets e=z1α/2V(ps) and moe.sw=2 sets i.e., e=z1α/2V(ps)pU.

References

Valliant, R., Dever, J., Kreuter, F. (2018, chap. 3). Practical Tools for Designing and Weighting Survey Samples, 2nd edition. New York: Springer.

See Also

nCont, nLogOdds, nProp, nWilson

Examples

Run this code
# srs sample size so that half-width of a 95% CI is 0.01
# population is large and population proportion is 0.04
nPropMoe(moe.sw=1, e=0.01, alpha=0.05, pU=0.04, N=Inf)

# srswor sample size for a range of margins of error defined as
# half-width of a 95% CI
nPropMoe(moe.sw=1, e=seq(0.01,0.08,0.01), alpha=0.05, pU=0.5)

# srswor sample size for a range of margins of error defined as
# the proportion that the half-width of a 95% CI is of pU
nPropMoe(moe.sw=2, e=seq(0.05,0.1,0.2), alpha=0.05, pU=0.5)

Run the code above in your browser using DataLab