Agriculture Reference
In-Depth Information
> set.seed(200694)
> X < - as.matrix(cbind(pik,framepop$xc,framepop$yc))
> bal1 < - samplecube(X,pik,comment ¼ TRUE,method ¼ 1)
BEGINNING OF THE FLIGHT PHASE
...
QUALITY OF BALANCING
TOTALS HorvitzThompson_estimators Relative_deviation
pik 100.0000
100.0000
1.406875e-12
2
494.0807
491.0461
-6.141966e-01
3
494.8565
495.9795
2.269404e-01
> sum(bal1)
[1] 100
> framebal < - framepop[bal1 ¼¼ 1,]
> points(framebal$xc,framebal$yc, pch¼1, cex¼2)
In this case, the spatial balance index, SB, is
> spbalance(ds,rep(n/N,N),(1:1000)[bal1¼¼1])
[1] 0.3242424
This high SB value (if compared with the SB values of the designs in the previous
section) demonstrates that balancing the sample on the coordinates is quite different
from the concept of spatially balanced samples (the SB value for GRTS is much
lower).
The algorithm can also use varying
π k s to select balanced
π
ps samples (see
Fig. 7.4 ).
> 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()
> pik2 < - inclusionprobabilities(ypps,n)
> X < - as.matrix(cbind(pik2,framepop$xc,framepop$yc))
> bal2 < - samplecube(X,pik,comment ¼ TRUE,method ¼ 1)
BEGINNING OF THE FLIGHT PHASE
...
QUALITY OF BALANCING
TOTALS HorvitzThompson_estimators Relative_deviation
pik2 100.0000
100.0000
-1.136868e-13
2
494.0807
544.4423
1.019300e+01
3
494.8565
525.1639
6.124477e+
Search WWH ::




Custom Search