if (FALSE) {
N = 1000L; # size of the population
prob = runif(N, 0.1, 0.3); # Inclusion probabilities
x = matrix(rnorm(3*N), ncol = 3L); # N * 3 matrix of auxiliary variables
s = lcps(prob, x); # sample indices
}
Run the code above in your browser using DataLab