Agriculture Reference
In-Depth Information
problem consists of solving a linear program that does not depend on the population
size, but only depends on the number of balancing variables. Then, the computa-
tional burden is acceptable (Till ´ 2006 , Sect. 8.6.3).
After a preliminary version developed in SAS, the algorithm was implemented
in the sampling package. In particular, the appropriate R function is
samplecube, even though the two phases of the cube method can be executed
separately through the functions landingcube and fastflightcube. In this
example, we considered the same artificial population used in the previous sections.
Note that we used the geographical coordinates of the units as covariates. The
selected sample is shown in Fig. 7.3 .
> library(sampling)
> n < - 100
> N < - 1000
> set.seed(200694)
> par(mar¼c(1,1,1,1), xaxs¼"i",yaxs¼"i")
> plot(framepop$xc,framepop$yc, axes¼F,cex¼0.5,pch¼19,
+ xlim¼c(0,1),ylim¼c(0,1))
> box()
> set.seed(200694)
> pik < - rep(n/N,N)
> X < - as.matrix(cbind(framepop$xc,framepop$yc))
> bal < - samplecube(X,pik,comment¼TRUE,method¼1)
BEGINNING OF THE FLIGHT PHASE
The matrix of balanced variable has 2 variables and 1000 units
The size of the inclusion probability vector is 1000
The sum of the inclusion probability vector is 100
The inclusion probability vector has 1000 non-integer elements
Step 1
BEGINNING OF THE LANDING PHASE
At the end of the flight phase, there remain 2 non integer probabilities
The sum of these probabilities is 0.6969337
This sum is non-integer
The linear program will consider 3 possible samples
The mean cost is 0.0003727694
The smallest cost is 0.0001680449
The largest cost is 0.0006208612
The cost of the selected sample is 0.0006208612
QUALITY OF BALANCING
TOTALS HorvitzThompson_estimators Relative_deviation
1 494.0807
492.2161
-0.3773813
2 494.8565
496.1754
0.2665137
> sum(bal)
[1] 105
Search WWH ::




Custom Search