Estimate a survey proportion using ENEMDU complex survey design
Source:R/survey_estimators.R
enemdu_survey_proportion.RdEstimates a weighted proportion for a binary 0/1 variable using ENEMDU design variables. This function is appropriate for variables such as poverty flags once they have been built from validated inputs.
Usage
enemdu_survey_proportion(
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,
strict_binary = TRUE
)Arguments
- data
A data frame.
- value
Binary 0/1 variable.
- group_vars
Optional grouping variables.
- 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.
- indicator_id
Optional stable indicator identifier.
- measure
Optional human-readable measure name.
- na_rm
Logical. If
TRUE, missing values invalueare 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.
- strict_binary
Logical. If
TRUE, errors when non-missing values other than 0 or 1 are found.