Description Usage Arguments Details Value Author(s) References See Also Examples

Compute a simple random sample size using either a target coefficient of variation, *CV_0*, or target variance, *V_0*, for an estimated mean.

1 |

`CV0` |
target value of coefficient of variation of |

`V0` |
target value of variance of |

`S2` |
unit (population) variance |

`ybarU` |
population mean of target variable |

`N` |
number of units in finite population |

`CVpop` |
unit (population) coefficient of variation |

If *CV_0* is the desired target, then the unit CV, `CVpop`

,
or the population mean and variance, `ybarU`

and `S2`

, must also be provided.
If *V_0* is the constrained value, then `S2`

must be also be included in the function call.

numeric sample size

Richard Valliant, Jill A. Dever, Frauke Kreuter

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

`nLogOdds`

, `nProp`

, `nPropMoe`

, `nWilson`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
nCont(CV0=0.05, CVpop=2)
nCont(CV0=0.05, CVpop=2, N=500)
nCont(CV0=0.10/1.645, CVpop=1)
# Compute sample size for a ratio estimator in smho98 population
# Identify large units to select with certainty first
data(smho98)
cert <- smho98[,"BEDS"] > 2000
tmp <- smho98[!cert, ]
tmp <- tmp[tmp[, "BEDS"] > 0, ]
x <- tmp[,"BEDS"]
y <- tmp[, "EXPTOTAL"]
m <- lm(y ~ 0 + x, weights = 1/x)
ybarU <- mean(y)
S2R <- sum(m$residuals^2/(length(x)-1))
nCont(CV0=0.15, S2=S2R, ybarU=ybarU)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.