Skip to contents

Estimates a weighted mean using ENEMDU design variables and returns a stable analytical output with precision metrics. The function uses survey::svymean() internally and connects the result with the package precision-decision rules.

Usage

enemdu_survey_mean(
  data,
  value,
  group_vars = NULL,
  ids = "upm",
  strata = "estrato",
  weight = "fexp",
  survey_type = NULL,
  indicator_id = NULL,
  measure = NULL,
  na_rm = TRUE,
  conf_level = 0.95,
  lonely_psu = "adjust",
  sample_n_min = 60
)

Arguments

data

A data frame.

value

Numeric variable to estimate.

group_vars

Optional grouping variables. If supplied, estimates are computed separately for each observed group.

ids

Primary sampling unit variable. Defaults to "upm".

strata

Strata variable. Defaults to "estrato".

weight

Expansion factor variable. Defaults to "fexp".

survey_type

Optional ENEMDU survey type. If omitted, uses the survey_type attribute when available.

indicator_id

Optional stable indicator identifier.

measure

Optional human-readable measure name.

na_rm

Logical. If TRUE, missing values in value are excluded.

conf_level

Confidence level for confidence intervals.

lonely_psu

Option passed to survey.lonely.psu.

sample_n_min

Minimum unweighted sample size for preliminary quality flag.

Value

A tibble with survey mean estimates and precision metadata.