# balstrat: Balanced Stratification In StratifiedSampling: Different Methods for Stratified Sampling

## Description

Select a stratified balanced sample. The function is similar to `balancedstratification` of the package sampling.

## Usage

 `1` ```balstrat(X, strata, pik) ```

## Arguments

 `X` A matrix of size (N x p) of auxiliary variables on which the sample must be balanced. `strata` A vector of integers that specifies the stratification. `pik` A vector of inclusion probabilities.

## Details

The function implements the method proposed by Chauvet (2009). Firstly, a flight phase is performed on each strata. Secondly, a flight phase is applied on the whole population by aggregating the strata. Finally, a landing phase is applied by suppression of variables.

## Value

A vector with elements equal to 0 or 1. The value 1 indicates that the unit is selected while the value 0 is for rejected units.

## Author(s)

Raphaël Jauslin raphael.jauslin@unine.ch

## References

Chauvet, G. (2009). Stratified balanced sampling. Survey Methodology, 35:115-119.

`ffphase`,`landingRM`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16``` ```N <- 100 n <- 10 p <- 4 X <- matrix(rgamma(N*p,4,25),ncol = p) strata <- as.matrix(rep(1:n,each = N/n)) pik <- rep(n/N,N) s <- balstrat(X,strata,pik) t(X/pik)%*%s t(X/pik)%*%pik Xcat <- disj(strata) t(Xcat)%*%s t(Xcat)%*%pik ```