cubestratified: Stratified balanced sampling with pooling of landing phases

Description Usage Arguments Value References Examples

View source: R/RcppExports.R

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

1
cubestratified(prob,Xbal,integerStrata)	

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

Value

Returns a vector of length N with sampling indicators.

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# Example 1
N = 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];

## End(Not run)

jlisic/BalancedSampling documentation built on May 19, 2019, 12:46 p.m.