# Example 1
# Select sample
set.seed(12345);
N = 100; # population size
n = 10; # sample size
p = rep(n/N,N); # inclusion probabilities
X = cbind(p,runif(N),runif(N)); # matrix of auxiliary variables
pflight = flightphase(p,X); # flight
indicators = landingphase(p,pflight,X); # landing
# final sample
s = (1:N)[indicators==1];
Run the code above in your browser using DataLab