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,
  eligibility_rate = 1,
  eligible_per_unit = 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(). Every row is assessed at the size the result chose, the common n, a domain's quota, or under natural domain sampling its expected yield n * share. Rows with only a floor are dropped, since they have no precision to report.

...

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(), so none can be called name or start with a dot.

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 among eligible ultimate units, in (0, 1]. Used for rows whose resp_rate column is absent or NA, and a non-missing row value overrides it. See the nonresponse section of svyplan-package for what the rate counts.

eligibility_rate

Default share of issued units in scope, in (0, 1]. Used for rows whose eligibility_rate column is absent or NA, and a non-missing row value overrides it. See the nonresponse section of svyplan-package.

eligible_per_unit

Default eligible units per sampled unit, a positive number that can exceed 1. Used for rows whose eligible_per_unit column is absent or NA. Proportion and mean rows. See n_multi().

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. The domains columns come first, so each row can be joined back to its domain.

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). 2 * pnorm(-2) gives the multiplier of 2 that the DHS and MICS manuals use in place of 1.96.

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.

eligible_per_unit

Eligible units per sampled unit for the row's estimate, as in prec_prop() and prec_mean(). Proportion and mean rows. The several-indicators mode of prec_cluster() refuses it.

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.

A domain that takes most of its PSUs

A deff column carries the clustering of a design whose first stage is treated as drawn with replacement, and N corrects only for the units. Nothing here knows how many PSUs a domain holds. A small domain, such as an island district of 16 enumeration areas, can then be given more PSUs than it has, and a sample that takes most of them is assessed as if they were a few among many. n_alloc() and prec_alloc() read N_psu in the frame and, with fpc = "stage", apply the stage-by-stage correction. They size and assess such a domain, as the prec_alloc() examples show.

See also

n_multi() for the inverse, prec_cluster() for a multistage cluster design over the same indicator table, prec_alloc() for a stratified allocation over the whole population and its domains in one call, 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