# Make inclusion probabilities for a population with units
# of different size
x <- c(1:10, 100)
(pi <- inclusion_prob(x, 5))
# The last unit is sufficiently large to be included in all
# samples with two or more units
becomes_ta(x)
# Use the inclusion probabilities to calculate the variance of the
# sample size for Poisson sampling
sum(pi * (1 - pi))
Run the code above in your browser using DataLab