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