Agriculture Reference
In-Depth Information
Fig. 10.1 Histograms of the weight corrections using the GREG (
left
) and the Logit distance with
bounds (0, 100) (
right
)
Figure
10.1
shows the histograms of the weight corrections using GREG and the
Logit distance with bounds (0,100).
>
totpop
<
- c('(Intercept)'¼nrow(framepop), xc¼sum(framepop
$
xc),
+yc¼sum(framepop
$
yc), xc2¼sum(framepop
$
xc2),yc2¼sum(framepop
$
yc2))
>
dsrsg
<
- calibrate(dsrs,~xc+yc+xc2+yc2, totpop)
>
estg
<
- svytotal(~yobs, dsrsg, deff
¼
TRUE)
>
estg
total SE DEff
yobs 91617.20 395.15 0.0397
>
diff
<
- weights(dsrsg)/weights(dsrs)
>
summary(diff)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.7523 0.9188 1.0380 1.0000 1.0920 1.1290
>
set.seed(160964)
>
ypps
<
- exp(yobs/10)
>
probinc
<
- inclusionprobabilities(ypps,n)
>
framepop
<
- cbind(framepop,probinc)
>
pps
<
- UPtille(probinc)
>
pps
<
- round(pps)
>
framepps
<
- framepop[pps ¼¼1,]
>
dpps
<
- svydesign(id¼~1,data¼framepps,
+ fpc¼~framepps
$
probinc,pps¼"brewer")
>
dppsg
<
- calibrate(dpps,~xc+yc+xc2+yc2, totpop)
>
estg
<
- svytotal(~yobs, dppsg, deff¼TRUE)
>
estg
Search WWH ::
Custom Search