Agriculture Reference
In-Depth Information
Fig. 6.6 Sample selected with a two-stage design
> set.seed(200694)
> tst < - mstage(framepop,stage ¼ c("cluster",""),
+ varnames ¼ list("strataid2"),size ¼ list(25,rep(4,25)),
+ method ¼ c("srswor"))
> tstd < - getdata(framepop,tst)
> plot(framepop$xc,framepop$yc, axes ¼ F,cex ¼ 0.5,
+ pch ¼ 19,xlim ¼ c(0,1),ylim ¼ c(0,1))
> for (i in seq(0.1,0.9,0.1))
+{
+
abline(h ¼ i,lty ¼ 2,lwd ¼ 2)
+
abline(v ¼ i,lty ¼ 2,lwd ¼ 2)
+}
> box()
> codpsu < - unique(tstd[[2]]$strataid2)
> for (i in 1:length(codpsu))
+{
+
ybl < - (codpsu %% 10)/10
xbl < - (codpsu %/% 10)/10
+
+
rect(xbl,ybl,xbl+0.1,ybl+0.1,lwd ¼ 1,col ¼ gray(0.9))
Search WWH ::




Custom Search