Agriculture Reference
In-Depth Information
+ var_yobs2¼tapply(framepop$yobs2,framepop$q1obs,var),
+ var_yobs3 ¼ tapply(framepop$yobs3,framepop$q1obs,var),
+ num_units ¼ tapply(framepop$yobs,framepop$q1obs,length)))
> b1 < -cbind(strata ¼ row.names(b1),b1)
> b1 < -cbind(b1, c ¼ rep(1,3), n ¼ rep(5,3), n_2 ¼ rep(0.0001,3))
The data frame b1 contains the strata statistics. For each stratum, we need the
variances of each variable of interest (i.e., var_yobs, var_yobs2,
var_yobs3), calculated using the function tapply, the size of the population
(num_units), the cost k h (c), the absolute minimum sample size (n), and the
minimum sample size relative to the population size (n_2). Note that in this
procedure, the allocation is constrained by both the absolute minimum sample
size (n) and the minimum relative sample size (n_2).
> b2 < -as.data.frame(cbind(CV ¼ rep(0.015,3),
+
tot¼colSums(framepop[,4:6])))
> bth(b1,b2)
strata numBethel numBethel2
1
1
64
64
2
2
74
74
3
3
71
71
The data frame b2 contains the variable statistics represented by the totals of
each variable (tot), and the requested upper bounds ( c v ) for the coefficients of
variation (CV). The function bth returns a data frame containing the allocated
sample size for each stratum (numBethel), and the additional sample size that
respects the minimum fixed in b1 (numBethel2). Note that if we request that the
coefficient of variation for each variable should not exceed 1.5 %, the multivariate
problem returns a solution equal to that returned by the univariate problem for the
variable var_yobs. This may happen if it is much more difficult to respect the
constraint on var_yobs than the constraints on the other variables.
We may try to reduce the upper bounds for var_yobs2 and var_yobs3 to
1 %, modifying the data frame b2.
> b2 < -as.data.frame(cbind(CV ¼ c(0.015,0.01,0.01),
+
tot ¼ colSums(framepop[,4:6])))
> b3 < - bth(b1,b2)
> b3
strata numBethel numBethel2
1
1
98
98
2
2
97
97
3
3
86
86
Search WWH ::




Custom Search