surveyplanning (version 0.6)

expsize: Sample size calculation

Description

The function computes minimum sample size for each stratum to achieve defined precision (CV) for the estimates of totals in each stratum. The calculation takes into account expected totals, population variance, expected response rate and design effect in each stratum.

Usage

expsize(Yh, H, s2h, poph, Rh = NULL, deffh = NULL, CVh, dataset = NULL)

Arguments

Value

A data.table is returned by the function, whith variables: H - stratum, variable - the name of variable of interest, estim - total value, deffh - design effect, s2h - population variance $S^2$, CVh - the expected coefficient of variation, Rh - response rate, poph - population size, nh - minimal sample size to achieve defined precision (CV).

See Also

expvar, optsize

Examples

Run this code
data <- data.table(H=1:3, Yh=10*1:3, Yh1=10*4:6,
                   s2h=10*runif(3), s2h2=10*runif(3),
                   CVh=rep(4.9, 3),
                   poph=8*1:3, Rh=rep(1,3),
                   deffh=rep(2,3), deffh2=rep(3,3))

size <- expsize(Yh=c("Yh", "Yh1"), H="H",
                s2h=c("s2h", "s2h2"), poph="poph",
                Rh="Rh", deffh=c("deffh", "deffh2"),
                CVh="CVh", dataset = data)
size

Run the code above in your browser using DataLab