Description Usage Arguments Value References Examples
Calculates sample size to estimate a total from a stratified random sampling design.
1 2  CalculateStratifiedSampleSize(strata = NULL, x = NULL,
conf.level = 0.95, error = 0.1)

strata 

x 

conf.level 
the confidence level required. It must be 
error 
the maximum relative difference between the estimate and the unknown population value. It must be 
numeric sample size rounded up to nearest integer.
Levy P and Lemeshow S (2008). Sampling of populations: methods and applications, Fourth edition. John Wiley and Sons, Inc.
http://oswaldosantos.github.io/capm
1 2 3 4 5 6 7 8 9 10 11 12  # Using a pilot sample from a population with 10000 sampling units.
strata < rep(c("rural", "urban"), c(100, 9900))
pilot < data.frame(c(rpois(5, 1.3), rpois(45, 0.8)),
rep(c("rural", "urban"), c(5, 45)))
CalculateStratifiedSampleSize(strata, pilot)
# Using expected mean and variance for a population with
# 10000 sampling units.
str_n < c(rural = 100, urban = 9900)
str_mean < c(rural = 1.4, urban = 0.98)
str_var < c(rural = 1.48, urban = 1.02)
CalculateStratifiedSampleSize(cbind(str_n, str_mean, str_var))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.