cubestratified: Stratified balanced sampling with pooling of landing phases
Description
This is a fast implementation of stratified balanced sampling. To have a fixed sample size, include the inclusion probabilities as a balancing variable in Xbal and make sure the inclusion probabilities sum to a positive integer (within each stratum).
Usage
cubestratified(prob,Xbal,integerStrata)
Value
Returns a vector of length N with sampling indicators.
Arguments
prob
vector of length N with inclusion probabilities
Xbal
matrix of balancing auxiliary variables of N rows and r columns
integerStrata
vector of length N with stratum number
References
Chauvet, G. (2009). Stratified balanced sampling. Survey Methodology, 35, 115-119.
if (FALSE) {
# Example 1N = 10;
n = 5;
p = rep(n/N,N);
strata = c(1,1,2,2,3,3,4,4,5,5);
indicators = cubestratified(p,cbind(p),strata);
s = (1:N)[indicators==1];
}