# Load data with PSU identifiers and sizes.
data(psu.ssu)
# Load data with sample data.
data(survey.data)
## Specify a two-stage cluster design that included 20 PSU.
DesignSurvey(sample = survey.data, psu.ssu = psu.ssu,
psu.col = 2, ssu.col = 1, psu.2cd = 20)
## Assuming that survey.sampling is a simple design.
DesignSurvey(sample = survey.data, N = 144600)
## Assuming that survey.sampling is a stratified design.
# Hypothetical strata
strat <- survey.data
strat$strat <- 'Urban'
strat$strat[round(runif(5, 1, nrow(strat)))] <- 'Rural'
strat$strat.size <- 144000
strat$strat.size[strat$strat == 'Rural'] <- 600
DesignSurvey(strat, N = 'strat.size', strata = 'strat')
Run the code above in your browser using DataLab