Skip to contents

Determine where to cut a continuous stratification variable to form optimal strata. Supports four methods: cumulative root frequency (Dalenius-Hodges), geometric progression, Lavallée-Hidiroglou iterative, and Kozak random search.

Usage

strata_bound(
  x,
  n_strata,
  n = NULL,
  cv = NULL,
  method = c("lh", "cumrootf", "geo", "kozak"),
  alloc = c("neyman", "optimal", "proportional", "power"),
  power_q = 0.5,
  unit_cost = NULL,
  certain = NULL,
  n_class = NULL,
  max_iter = 200L,
  n_restart = NULL
)

Arguments

x

Numeric vector: finite stratification variable values. Must not contain missing values.

n_strata

Required integer: number of strata (including take-all if certain is specified). Must be >= 2.

n

Target total sample size, supplied as a whole number. Specify at most one of n or cv. Required for methods "lh" and "kozak".

cv

Target coefficient of variation (relative standard error). For example, cv = 0.05 means the standard error of the estimated population total or mean should be at most 5 percent of the estimate. Specify at most one of n or cv. Required for methods "lh" and "kozak".

method

Stratification method: "cumrootf" (Dalenius-Hodges), "geo" (geometric), "lh" (Lavallée-Hidiroglou), or "kozak" (random search). Default "lh".

alloc

Allocation rule: "proportional", "neyman", "optimal", or "power" (Bankier compromise). Default "neyman". See Details.

power_q

Bankier power parameter, used only when alloc = "power". Numeric scalar in \([0, 1]\). At power_q = 1 the allocation equals Neyman. At power_q = 0 it yields near-equal subnational CVs. Default 0.5.

unit_cost

Per-stratum unit costs, ordered from lowest to highest stratum. Scalar (equal costs) or vector of length n_strata. Default NULL (equal unit costs, \(c_h = 1\) for all strata), in which case "optimal" and "neyman" coincide.

certain

Take-all threshold. Units with x >= certain form a census stratum.

n_class

Positive whole number of histogram bins for "cumrootf". Default NULL (Freedman-Diaconis rule).

max_iter

Positive whole number of maximum iterations for "lh" and "kozak". Default 200.

n_restart

Positive whole number of random restarts for "kozak". Default NULL (= 10 * n_strata).

Value

A svyplan_strata object with components:

boundaries

Numeric vector of cutpoints (length n_strata - 1).

n_strata

Number of strata.

n

Total sample size.

cv

Coefficient of variation achieved by the integer allocation in $strata$n (the continuous optimum's cv is kept in params$cv_continuous, and the requested target, if any, in params$cv_target).

strata

Data frame with per-stratum summaries.

method

Algorithm used.

alloc

Allocation method name (character).

params

List of additional parameters.

converged

Logical (for iterative methods).

Details

Choosing a method

The four methods differ in approach and use case:

  • cumrootf: Dalenius-Hodges (1959) cumulative root frequency rule. Non-iterative, does not require n or cv. Best for a quick first look at reasonable boundary positions.

  • geo: Gunning-Horgan (2004) geometric progression. Non-iterative, requires x > 0. Works well for right-skewed positive variables (e.g. income, revenue) where a log-scale spacing is natural.

  • lh (default): Lavallée-Hidiroglou (1988) iterative coordinate-wise optimization. Requires n or cv. The recommended choice when you know the sample size or target CV: it directly minimizes the objective and is fast even on large frames.

  • kozak: Kozak (2004) random search, escapes local minima. Requires n or cv. Use for highly skewed or multimodal data where "lh" may get trapped in a local optimum. Slower but more robust.

In summary, use "lh" by default. Switch to "kozak" if the distribution is difficult, or fall back to "cumrootf" or "geo" when you do not yet have n or cv.

Allocation is controlled by the alloc parameter. Four methods are available:

  • proportional: \(n_h \propto N_h\).

  • neyman: \(n_h \propto N_h S_h\). Minimizes the national CV when unit costs are equal.

  • optimal: \(n_h \propto N_h S_h / \sqrt{c_h}\). Accounts for differential unit costs.

  • power: Bankier (1988) compromise, \(n_h \propto S_h N_h^{power\_q}\). The parameter power_q controls the trade-off between national precision (power_q = 1, equivalent to Neyman) and near-equal subnational CVs (power_q = 0).

Stratum allocations are rounded to integers using the ORIC method (Cont and Heidari, 2015), which preserves sum(n) = n while minimizing rounding distortion.

References

Dalenius, T. and Hodges, J. L. (1959). Minimum variance stratification. Journal of the American Statistical Association, 54(285), 88–101.

Lavallée, P. and Hidiroglou, M. (1988). On the stratification of skewed populations. Survey Methodology, 14(1), 33–43.

Kozak, M. (2004). Optimal stratification using random search method in agricultural surveys. Statistics in Transition, 6(5), 797–806.

Gunning, P. and Horgan, J. M. (2004). A new algorithm for the construction of stratum boundaries in skewed populations. Survey Methodology, 30(2), 159–166.

Wesolowski, J., Wieczorkowski, R. and Wojciak, W. (2021). Optimality of the recursive Neyman allocation. Journal of Survey Statistics and Methodology, 10(5), 1263–1275.

Bankier, M. D. (1988). Power allocations: determining sample sizes for subnational areas. The American Statistician, 42(3), 174–177.

Cont, R. and Heidari, M. (2015). Optimal rounding under integer constraints. arXiv preprint arXiv:1501.00014.

See also

predict.svyplan_strata to assign new data to strata, n_alloc() to distribute a sample across an existing set of strata.

Examples

set.seed(867)
x <- rlnorm(500, meanlog = 6, sdlog = 1.5)

# Dalenius-Hodges (non-iterative)
strata_bound(x, n_strata = 4, method = "cumrootf", n = 100)
#> Strata boundaries (Dalenius-Hodges, 4 strata)
#> Boundaries: 600.0, 1800.0, 4600.0
#> n = 100, cv = 0.0207
#> Allocation: neyman
#> ---
#>  stratum lower       upper    N   share sd     n 
#>  1          8.634646   600.00 299 0.598 150.6  25
#>  2        600.000000  1800.00 116 0.232 339.6  21
#>  3       1800.000000  4600.00  54 0.108 774.1  23
#>  4       4600.000000 30184.69  31 0.062 6786.6 31

# LH (default, iterative)
strata_bound(x, n_strata = 4, n = 100)
#> Strata boundaries (Lavallée-Hidiroglou, 4 strata)
#> Boundaries: 428.4, 1221.9, 2641.1
#> n = 100, cv = 0.0168
#> Allocation: neyman
#> Converged: yes
#> ---
#>  stratum lower       upper      N   share sd     n 
#>  1          8.634646   428.4132 263 0.526 113.6  17
#>  2        428.413182  1221.9011 124 0.248 207.0  15
#>  3       1221.901053  2641.0782  58 0.116 382.0  13
#>  4       2641.078174 30184.6939  55 0.110 6077.6 55

# Bankier power allocation (compromise between national and subnational CVs)
strata_bound(x, n_strata = 4, n = 100, alloc = "power", power_q = 0.5)
#> Strata boundaries (Lavallée-Hidiroglou, 4 strata)
#> Boundaries: 396.9, 1176.8, 2661.2
#> n = 100, cv = 0.0176
#> Allocation: power (power_q = 0.50)
#> Converged: yes
#> ---
#>  stratum lower       upper      N   share sd     n 
#>  1          8.634646   396.9266 255 0.510 107.5  11
#>  2        396.926627  1176.7649 130 0.260 207.4  15
#>  3       1176.764852  2661.1946  60 0.120 392.9  19
#>  4       2661.194576 30184.6939  55 0.110 6077.6 55

# With take-all stratum
strata_bound(x, n_strata = 3, n = 80, certain = quantile(x, 0.95))
#> Strata boundaries (Lavallée-Hidiroglou, 3 strata)
#> Boundaries: 1070.6, 5502.7
#> n = 80, cv = 0.0403
#> Allocation: neyman
#> Converged: yes
#> ---
#>  stratum lower       upper     N   share sd     n 
#>  1          8.634646  1070.625 378 0.756 276.0  27
#>  2       1070.624834  5502.702  97 0.194 1118.9 28
#>  3       5502.702010 30184.694  25 0.050 7057.1 25