Agriculture Reference
In-Depth Information
> set.seed(200694)
> pps < - UPtille(probinc)
> table(pps)
pps
01
900 100
> pps < - round(pps) # Sometimes is needed to have exactly 0,1
> 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()
> framepps < - framepop[pps ¼¼ 1,]
> points(framepps$xc,framepps$yc, pch ¼ 1, cex ¼ 2))
The survey package can be applied in a similar way to the SRS package to
produce HT estimates from sample data selected using
ps, with some particular
attention to variance estimation. The sampling algorithms to select
π
π
ps are rarely
measurable, because the
π kl s are often unknown, difficult, or impossible to com-
pute. Furthermore, even if they are available, if n is too large the double sum in the
HT variance estimator (Eq. (1.27) of Sect. 1.2 ) becomes computationally intensive.
It is also inconceivable to provide these probabilities in released data sets. The set of
joint inclusion probabilities is a series of n ( n
1)/2 values that could be so huge that
the storage and retrieval tasks are prohibitive (Berger and Till ´ 2009 ). For these
reasons, approximations using the Matrix package are typically required, as
indicated in the pps option of the svydesign function, which defines the design
features. Another simplistic but practical possibility is to treat the sample as if it was
selected using replacement Poisson drawings, by specifying the probs option
instead of fpc (which indicates a without replacement sample).
> library(Matrix)
> # Brewer approximation
> dpps < - svydesign(id ¼ ~1,data ¼ framepps,
+ fpc ¼ ~framepps$probinc,pps ¼ "brewer")
> epps < - svytotal(~yobs+as.factor(q1obs),dpps)
> epps
total
SE
yobs
86151.05 18809.826
as.factor(q1obs)1
291.00
141.948
as.factor(q1obs)2
345.40
186.903
as.factor(q1obs)3
246.13
76.119
Search WWH ::




Custom Search