Learn R Programming

sampling (version 0.1)

fastflightcube: Fast flight phase

Description

Execute the fast flight phase of the cube method (algorithm of Chauvet and Till�, 2004, 2005). The data are sorted following the argument order. The units with inclusion probabilities equal to 0 and 1 are tolerated.

Usage

fastflightcube(X,pik,order=1,comment=TRUE)

Arguments

X
matrix of auxiliary variables on which the sample must be balanced.
pik
vector of inclusion probabilities.
order
1, the data are sorted randomly, 2, the data are sorted in decreasing order, 3, the order of the data remains unchanged.
comment
a comment is written during the execution if comment is equal to TRUE.

encoding

latin1

References

Chauvet, G. and Till�, Y. (2004). A fast algorithm of balanced sampling. Submitted for publication. Chauvet, G. and Till�, Y. (2005). New SAS macros for balanced sampling. In INSEE, editor, Journ�es de M�thodologie Statistique, Paris. Deville, J.-C. and Till�, Y. (2004). Efficient balanced sampling: the cube method. Biometrika, 91, 893-912. Deville, J.-C. and Till�, Y. (2005). Variance approximation under balanced sampling. Journal of Statistical Planning and Inference, 128/2:411--425.

See Also

samplecube

Examples

Run this code
# Matrix of balancing variables
X=cbind(c(1,1,1,1,1,1,1,1,1),c(1,2,3,4,5,6,7,8,9))
# Vector of inclusion probabilities.
# The sample has the size equal to 3.
pik=c(1/3,1/3,1/3,1/3,1/3,1/3,1/3,1/3,1/3)
# pikstar is almost a balanced sample and is ready for the landing phase
pikstar=fastflightcube(X,pik,order=1,comment=TRUE)

Run the code above in your browser using DataLab