Compromise allocation for several study variables within a budget
Source:R/compromise.R
compromise_allocation.RdWith one budget and several study variables, each variable has its own
optimum allocation (n_h proportional to N_h S_h / sqrt(c_h), Cochran
1977, Section 5.5) and the optima disagree: the allocation that is best
for a concentrated variable starves the strata where a spread variable
lives. This function finds an allocation that gives up a little on each,
and reports what each variable gives up as its relative loss: the
variance of its estimated total under the compromise divided by its
variance under its own optimum for the same budget (1.3 reads "30 percent
more variance than this variable could have had").
Arguments
- strata
Data frame with columns
size,cost, optionallystratum, and one standard-deviation column per study variable. Thecostof a unit can come from the routing (routed_unit_cost()by stratum).- sd
Names of the standard-deviation columns, one per variable.
- budget
Total cost allowed (
sum cost * n); withcost = 1it is the total sample size.- criterion
"minimax","weighted"or"average".- weights
Weights of the variables for
"weighted"and"average", in the order ofsd(equal by default).- totals
Optional population totals of the variables, to report the coefficients of variation.
- x
A
fieldopt_compromise_allocation.- ...
Unused.
Value
The strata with a column n, of class
fieldopt_compromise_allocation, with attributes cost, budget,
criterion, attained (variance of each total), optimum (its
variance under the variable's own optimum allocation), loss
(attained / optimum), weights (those given, or the multipliers of
the minimax solution), individual (a matrix with the optimum
allocation of each variable alone), cv (when totals are given),
gap (relative duality gap of the minimax solution before rounding)
and bounded. tidy() gives the strata with the allocation each
variable would have had; glance() one row per variable.
Details
Three criteria are offered. "minimax" minimises the largest loss, so no
variable is sacrificed; the variables whose loss is below the maximum get
a zero weight in the result. "weighted" minimises the weighted sum of
the losses (Chatterjee 1967; Cochran 1977, Section 5A.4), and trades a
larger loss on some variables for a smaller total. "average" averages
the optimum allocations of the variables (Cochran 1977, Section 5A.3).
Every stratum keeps at least two units and at most its size, and the
sizes are rounded so that the cost stays within the budget.
multivariate_allocation() answers the other question: the minimum cost
that meets a variance target for every variable. Use it when the targets
are given and the budget is open; use this one when the budget is given.
References
Cochran, W. G. (1977). Sampling Techniques, 3rd ed., Sections 5A.3-5A.4. Wiley. Chatterjee, S. (1967). A note on optimum allocation. Scandinavian Actuarial Journal, 1967, 40-44. doi:10.1080/03461238.1967.10406206 . Yates, F. (1960). Sampling Methods for Censuses and Surveys, 3rd ed. Griffin.
Examples
strata <- data.frame(
stratum = c("high", "mid", "low"), size = c(300, 800, 2000),
cost = c(250, 180, 150), sd_corn = c(40, 25, 3), sd_cattle = c(4, 10, 30)
)
a <- compromise_allocation(strata, sd = c("sd_corn", "sd_cattle"), budget = 60000)
a
#>
#> ── Compromise allocation (minimax) ─────────────────────────────────────────────
#> n = 347 for a cost of 59980 (budget 60000); largest loss 63.9% above a
#> variable's own optimum.
#> sd_corn: variance 6084000, 1.639 times its optimum 3711000.
#> sd_cattle: variance 17050000, 1.628 times its optimum 10470000.
#> # A tibble: 3 × 4
#> stratum size cost n
#> <chr> <dbl> <dbl> <int>
#> 1 high 300 250 49
#> 2 mid 800 180 101
#> 3 low 2000 150 197
glance(compromise_allocation(strata,
sd = c("sd_corn", "sd_cattle"), budget = 60000,
criterion = "weighted", weights = c(3, 1)
))
#> # A tibble: 2 × 8
#> variable optimum attained loss weight n cost criterion
#> <chr> <dbl> <dbl> <dbl> <dbl> <int> <dbl> <chr>
#> 1 sd_corn 3711081. 4735990. 1.28 0.75 333 60000 weighted
#> 2 sd_cattle 10474909. 23477643. 2.24 0.25 333 60000 weighted