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(indicators, ...)

# Default S3 method
prec_multi(
  indicators,
  ...,
  domains = NULL,
  prop_method = c("wald", "wilson", "logodds", "beta"),
  resp_rate = 1,
  plan = NULL
)

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

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

Arguments

indicators

For the default method: a data frame where each row is one survey indicator, in the same format as n_multi() but with an additional n column giving the sample size. This lets you answer: "given this sample size, what precision do I get for each indicator?"

At minimum, each row needs:

  • p, var, or the ratio quartet r, cv_num, cv_den and component_cor: what you are measuring (see n_multi()). Exactly one estimand per row.

  • n: the sample size to evaluate.

See the Details section for the full column reference.

For svyplan_n objects: a result from n_multi().

...

Additional arguments passed to methods. Unused arguments are rejected.

domains

Character vector of column names in indicators to treat as domain variables, or NULL (default) for no domains. All names must exist in indicators. Domain columns are preserved in the result for round-trip conversion back to n_multi().

prop_method

Proportion CI method, one of "wald" (default), "wilson", "logodds", or "beta". This is passed to prec_prop() for proportion rows and ignored for mean rows. An optional prop_method column in indicators overrides this default on a per-row basis.

resp_rate

Default expected response rate at the ultimate unit, in (0, 1]. Used for rows whose resp_rate column is absent or NA, and a non-missing row value overrides it.

plan

A svyplan() profile providing default design parameters.

Value

A svyplan_prec object with a $detail data frame containing per-indicator precision: .se, .moe, .rmoe, and .cv. .rmoe is .moe as a fraction of the row's own estimand, p for a proportion, abs(mu) for a mean and abs(r) for a ratio, and NA for a row carrying none of them.

Details

Building the indicators data frame

The indicators data frame uses the same structure as n_multi(), with the addition of a required n column specifying the sample size to evaluate. A minimal example:

indicators <- data.frame(
  name = c("stunting", "vaccination", "anemia"),
  p    = c(0.30, 0.70, 0.10),
  n    = c(400, 400, 400)
)

See n_multi() for a detailed guide on constructing indicator rows (choosing between p and var, setting per-row design effects, etc.).

Column reference

name

Indicator label (optional).

p

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

var

Population variance. One of p, var or r per row.

mu

Population mean. Required for CV output when var is specified, because CV = SE / mean.

r

Anticipated ratio of two totals, marking a ratio row. It requires cv_num, cv_den and component_cor alongside it, and no unit_relvar, which the moments derive. See prec_ratio().

cv_num, cv_den

Coefficients of variation of a ratio row's numerator and denominator, strictly positive.

component_cor

Correlation between a ratio row's numerator and denominator across units, in [-1, 1].

n

Sample size to evaluate (required), with one value per indicator row.

alpha

Significance level (default 0.05).

deff

Design effect multiplier (default 1).

N

Population size (default Inf).

prop_method

Proportion CI method: "wald" (default), "wilson", "logodds", or "beta". Only for rows with p.

df

Degrees of freedom of the variance estimator, typically sampled PSUs minus strata, and available from design_df(). It switches that row's interval quantile from normal to t, under every proportion method and on mean rows alike. NA (the default) applies no adjustment.

resp_rate

Expected response rate at the ultimate unit (default 1). A cluster design spends a rate at stage 1 too, and prec_cluster() names that column resp_rate_psu.

Domain columns are specified via the domains parameter.

prec_multi() delegates proportion rows to prec_prop(), mean rows to prec_mean() and ratio rows to prec_ratio(). Use prop_method or a indicators$prop_method column to choose "wald", "wilson", "logodds" or "beta" for proportion rows. It is ignored elsewhere.

See also

n_multi() for the inverse, prec_cluster() for a multistage cluster design over the same indicator table, and prec_prop() and prec_mean() for single-indicator precision.

Other multi-indicator functions: n_multi()

Examples

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

# Wilson precision for a rare proportion
prec_multi(data.frame(p = 0.05, n = 400), prop_method = "wilson")
#> Multi-indicator sampling precision
#> 
#>  name .se        .moe      .rmoe     .cv      
#>  1    0.01089725 0.0216831 0.4336621 0.2179449