Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nContMoe

Compute a simple random sample size for an estimated mean of a continuous variable based on margin of error


Description

Compute a simple random sample size using a margin of error specified as the half-width of a normal approximation confidence interval or the half-width relative to the population mean.

Usage

nContMoe(moe.sw, e, alpha=0.05, CVpop=NULL, S2=NULL, ybarU=NULL, N=Inf)

Arguments

moe.sw

switch for setting desired margin of error (1 = CI half-width on the mean; 2 = CI half-width on the mean divided by \bar{y}_U)

e

desired margin of error; either e=z_{1-α/2}√{V(\bar{y}_s)} or e=z_{1-α/2}CV(\bar{y}_s)

alpha

1 - (confidence level)

CVpop

unit (population) coefficient of variation

S2

population variance of the target variable

ybarU

population mean of target variable

N

number of units in finite population

Details

If moe.sw=1, then S2 must be provided. If moe.sw=2, then either (i) CVpop or (ii) S2 and ybarU must be provided.

Value

numeric sample size

Author(s)

Richard Valliant, Jill A. Dever, Frauke Kreuter

References

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

See Also

Examples

nContMoe(moe.sw=1, e=0.05, alpha=0.05, S2=2)
nContMoe(moe.sw=1, e=0.05, alpha=0.05, S2=2, N=200)
nContMoe(moe.sw=2, e=0.05, alpha=0.05, CVpop=2)
nContMoe(moe.sw=2, e=0.05, alpha=0.05, CVpop=2, N=200)
nContMoe(moe.sw=2, e=0.05, alpha=0.05, S2=4, ybarU=2)

PracTools

Tools for Designing and Weighting Survey Samples

v1.2.2
GPL (>= 2)
Authors
Richard Valliant, Jill A. Dever, Frauke Kreuter
Initial release
2020-07-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.