# NOT RUN {
## load data
data(eusilcP)
## simple random sampling
draw(eusilcP[, c("id", "eqIncome")], size = 20)
## group sampling
draw(eusilcP[, c("hid", "id", "eqIncome")],
grouping = "hid", size = 10)
## stratified simple random sampling
draw(eusilcP[, c("id", "region", "eqIncome")],
design = "region", size = c(2, 5, 5, 3, 4, 5, 3, 5, 2))
## stratified group sampling
draw(eusilcP[, c("hid", "id", "region", "eqIncome")],
design = "region", grouping = "hid",
size = c(2, 5, 5, 3, 4, 5, 3, 5, 2))
# }
Run the code above in your browser using DataLab