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,
stage_cost = NULL,
budget = NULL,
n_psu = NULL,
joint = FALSE,
prop_method = "wald",
plan = NULL,
...
)
# 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
ncolumn; see Details). Forsvyplan_norsvyplan_clusterobjects: a result fromn_multi().- ...
Additional arguments passed to methods.
- stage_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).
- prop_method
Proportion CI method for simple mode, one of
"wald"(default),"wilson", or"logodds". This is passed toprec_prop()for proportion rows and ignored for mean rows and multistage mode. An optionalprop_methodcolumn intargetsoverrides this default on a per-row basis.- plan
A
svyplan()profile providing default design parameters.
Details
The targets data frame supports the following columns:
nameIndicator label (optional).
pExpected proportion, in (0, 1). One of
porvarper row.varPopulation variance. One of
porvarper row.muPopulation mean. Required for CV when
varis specified.nSample size (required). For simple mode, a scalar per indicator. For multistage, per-stage sizes can be provided as
n,psu_size,ssu_sizecolumns.alphaSignificance level (default 0.05).
deffDesign effect multiplier (simple mode only, default 1).
NPopulation size (simple mode only, default Inf).
prop_methodOptional proportion method for simple mode, one of
"wald","wilson", or"logodds". Only used for rows withp; ignored for mean rows and multistage mode.resp_rateExpected response rate (default 1).
delta_psu,delta_ssuHomogeneity measures (multistage).
rel_varUnit relvariance. If omitted, derived from
porvar/mu.k_psu,k_ssuRatio parameters (multistage, default 1).
Any column not in the recognized set is treated as a domain variable.
In simple mode, prec_multi() delegates proportion rows to prec_prop()
and mean rows to prec_mean(). Use prop_method or a
targets$prop_method column to choose "wald", "wilson", or
"logodds" for proportion rows.
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
# 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 .cv
#> 1 0.01106301 0.0216831 0.2212602