Skip to contents

Compute a two- or three-stage cluster allocation that satisfies precision requirements for several survey indicators. Domain-level planning and a shared budget across domains are supported.

Usage

n_multi_cluster(targets, ...)

# Default S3 method
n_multi_cluster(
  targets,
  ...,
  stage_cost = NULL,
  domains = NULL,
  budget = NULL,
  n_psu = NULL,
  psu_size = NULL,
  ssu_size = NULL,
  joint = FALSE,
  min_n = NULL,
  fixed_cost = 0,
  plan = NULL
)

# S3 method for class 'svyplan_prec'
n_multi_cluster(targets, ...)

Arguments

targets

For the default method, a non-empty data frame with one row per indicator. Each row requires p or var, a cv or moe target, and delta_psu. Three-stage designs also require delta_ssu. For the svyplan_prec method, a result from prec_multi_cluster().

...

Additional arguments passed to methods. Unused arguments are rejected.

stage_cost

Numeric vector of per-stage costs with length 2 or 3.

domains

Optional character vector naming domain columns in targets. The function solves each domain independently unless joint is TRUE in budget mode.

budget

Optional total budget. Supply precision targets or a budget, according to the target schema described in Details.

n_psu

Optional fixed stage-1 sample size.

psu_size

Optional fixed stage-2 sample size per PSU.

ssu_size

Optional fixed stage-3 sample size per SSU. This is valid only for three-stage designs.

joint

If TRUE, split one budget across domains to minimize the worst precision ratio. This applies only when domains and budget are supplied.

min_n

Optional positive minimum total sample size per domain. In joint budget mode it is a constraint. In independent domain mode, domains below the floor produce a warning.

fixed_cost

Non-negative fixed overhead cost. The default is 0.

plan

Optional svyplan() profile providing stage_cost and other applicable defaults.

Value

A svyplan_cluster object. The output class does not depend on which optional arguments are supplied.

Details

Margin-of-error targets are converted to CV before optimization. For each candidate allocation, the required stage-1 size is the maximum across all indicators. The solver minimizes total cost for precision targets or the worst precision ratio under a fixed budget.

Homogeneity values numerically close to 0 or 1 are rejected because they make the analytical cluster optimum degenerate. The result includes an integer $operational allocation that preserves the applicable precision or budget constraint. See n_multi() for shared indicator columns and n_cluster() for the cluster cost model.

See also

n_multi() for simple designs and prec_multi_cluster() for the inverse calculation.

Examples

targets <- data.frame(
  name = c("stunting", "anemia"),
  p = c(0.30, 0.10),
  cv = c(0.10, 0.15),
  delta_psu = c(0.02, 0.05)
)
n_multi_cluster(targets, stage_cost = c(500, 50))
#> Multi-indicator optimal allocation (2-stage)
#> field design: n_psu = 52 | psu_size = 12 -> total n = 624
#> worst cv = 0.1495, cost = 57200 (binding: anemia)
#> continuous optimum: n_psu = 47.56811 | psu_size = 13.78404 (cv = 0.1500, cost = 56568)
#> ---
#>  name     .n       .cv_target .cv_achieved .binding
#>  stunting 292.9922 0.10       0.0668               
#>  anemia   655.6809 0.15       0.1500       *