Description Usage Arguments Value References Examples
Flight phase for the local cube method. 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. This is a simplified (optimized for speed) implementation of the flight phase of the local cube method (doubly balanced sampling). Euclidean distance is used in the Xspread
space.
1 | lcubeflightphase(prob,Xspread,Xbal)
|
prob |
vector of length N with inclusion probabilities |
Xspread |
matrix of (standardized) auxiliary variables of N rows and q columns |
Xbal |
matrix of balancing auxiliary variables of N rows and r columns |
Returns a vector of length N with new probabilities, where at most r are non-integer.
Grafstr<c3><b6>m, A. and Till<c3><a9>, Y. (2013). Doubly balanced spatial sampling with spreading and restitution of auxiliary totals. Environmetrics, 24(2), 120-131.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# Example 1
# Select sample
set.seed(12345);
N = 100; # population size
n = 10; # sample size
p = rep(n/N,N); # inclusion probabilities
X = cbind(runif(N),runif(N)); # matrix of auxiliary variables
pflight = lcubeflightphase(p,X,cbind(p,X));
# check balance
colSums(X)
colSums(X/p*pflight)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.