# Make a population with units of different size
x <- c(rep(1:9, each = 3), 100, 100, 100)
# ... and 10 strata
s <- rep(letters[1:10], each = 3)
# Should get about 7 to 8 strata in a sample on average
expected_coverage(x, 15, s)
Run the code above in your browser using DataLab