Skip to contents

Compute aggregate precision for a stratum allocation.

Usage

prec_alloc(x, ...)

# Default S3 method
prec_alloc(
  x,
  n,
  alpha = 0.05,
  deff = 1,
  resp_rate = 1,
  unit_cost = NULL,
  plan = NULL,
  ...
)

# S3 method for class 'svyplan_n'
prec_alloc(x, ...)

Arguments

x

For the default method: a frame data frame with stratum metadata. For svyplan_n objects: an allocation result from n_alloc().

...

Additional arguments passed to methods.

n

Stratum sample sizes, length nrow(x) (default method only).

alpha

Significance level, default 0.05.

deff

Design effect multiplier (> 0).

resp_rate

Expected response rate, in (0, 1]. Default 1.

unit_cost

Optional scalar or length-nrow(x) vector of per-stratum unit costs, overriding x$cost_h.

plan

Optional svyplan() object providing design defaults.

Value

A svyplan_prec object with type = "alloc".

See also

Examples

frame <- data.frame(
  N_h = c(4000, 3000, 3000),
  S_h = c(10, 15, 8),
  mean_h = c(50, 60, 55)
)
res <- n_alloc(frame, n = 600)
prec_alloc(res)
#> Sampling precision for alloc
#> n = 221 n = 248 n = 133
#> se = 0.4305, moe = 0.8438, cv = 0.0079