Skip to contents

Compute the sampling error (SE, MOE, CV) for multiple survey indicators given a sample size. This is the inverse of n_multi().

Usage

prec_multi(targets, ...)

# Default S3 method
prec_multi(
  targets,
  cost = NULL,
  budget = NULL,
  n_psu = NULL,
  joint = FALSE,
  ...
)

# S3 method for class 'svyplan_n'
prec_multi(targets, ...)

# S3 method for class 'svyplan_cluster'
prec_multi(targets, ...)

Arguments

targets

For the default method: data frame with one row per indicator (must contain an n column; see Details). For svyplan_n or svyplan_cluster objects: a result from n_multi().

...

Additional arguments passed to methods.

cost

Numeric vector of per-stage costs. NULL (default) for simple mode; length 2 or 3 for multistage mode.

budget

Total budget (currently unused in precision mode).

n_psu

Fixed stage-1 sample size (currently unused in precision mode).

joint

Logical (currently unused in precision mode).

Value

A svyplan_prec object with a $detail data frame containing per-indicator precision.

Details

The targets data frame supports the following columns:

name

Indicator label (optional).

p

Expected proportion, in (0, 1). One of p or var per row.

var

Population variance. One of p or var per row.

mu

Population mean. Required for CV when var is specified.

n

Sample size (required). For simple mode, a scalar per indicator. For multistage, per-stage sizes can be provided as n, psu_size, ssu_size columns.

alpha

Significance level (default 0.05).

deff

Design effect multiplier (simple mode only, default 1).

N

Population size (simple mode only, default Inf).

resp_rate

Expected response rate (default 1).

delta_psu, delta_ssu

Homogeneity measures (multistage).

rel_var

Unit relvariance. If omitted, derived from p or var/mu.

k_psu, k_ssu

Ratio parameters (multistage, default 1).

Any column not in the recognized set is treated as a domain variable.

See also

n_multi() for the inverse (compute n from precision targets), prec_prop(), prec_mean() for single-indicator precision.

Examples

# Simple mode: precision for three indicators at n = 400
targets <- data.frame(
  name = c("stunting", "vaccination", "anemia"),
  p    = c(0.30, 0.70, 0.10),
  n    = c(400, 400, 400)
)
prec_multi(targets)
#> Multi-indicator sampling precision
#>  name        .se        .moe       .cv       
#>  stunting    0.02291288 0.04490842 0.07637626
#>  vaccination 0.02291288 0.04490842 0.03273268
#>  anemia      0.01500000 0.02939946 0.15000000