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