Builds or uses NBI flags derived from final component variables and estimates NBI poverty and extreme NBI poverty with the package survey-design-aware indicator estimator.
Usage
enemdu_kpi_nbi(
data,
group_vars = NULL,
component_vars = c("comp1", "comp2", "comp3", "comp4", "comp5"),
nbi_count_var = "knbi",
nbi_var = "nbi",
extreme_nbi_var = "xnbi",
registry = enemdu_indicator_registry(),
official_validation_status = "not_officially_validated",
official_validation_note = NULL,
build_flags = TRUE,
overwrite = FALSE,
...
)Arguments
- data
A data frame.
- group_vars
Optional grouping variables.
- component_vars
Final NBI component variables.
- nbi_count_var
NBI deprivation-count variable.
- nbi_var
NBI poverty flag.
- extreme_nbi_var
Extreme NBI poverty flag.
- registry
Indicator registry used by
enemdu_indicator_estimate(). NBI contract rows are added in memory when they are absent.- official_validation_status
Official validation status label.
- official_validation_note
Note explaining the official validation status. If
NULL, a conservative default note is used.- build_flags
Logical. If
TRUE, build NBI flags before estimation.- overwrite
Logical. If
TRUE, overwrite existing NBI output variables whenbuild_flags = TRUE.- ...
Additional arguments passed to
enemdu_indicator_estimate().
Details
This function does not reconstruct NBI from raw questionnaire variables and does not claim official validation.
Examples
data <- tibble::tibble(
idhogar = paste0("h", 1:4),
hsize = rep(1L, 4),
upm = 1:4,
estrato = c(1, 1, 2, 2),
fexp = rep(1, 4),
comp1 = c(0, 1, 1, 0),
comp2 = c(0, 0, 1, 0),
comp3 = c(0, 0, 0, 0),
comp4 = c(0, 0, 0, 0),
comp5 = c(0, 0, 0, 0)
)
enemdu_kpi_nbi(data, survey_type = "anual", sample_n_min = 1)
#> # A tibble: 2 × 46
#> indicator_id indicator_label indicator_group unit analysis_level universe
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 pobreza_nbi Incidencia de … nbi perc… household_rep… persona…
#> 2 pobreza_extrema… Incidencia de … nbi perc… household_rep… persona…
#> # ℹ 40 more variables: registry_weight <chr>, estimation_weight <chr>,
#> # registry_value_var <chr>, created_count_value <lgl>,
#> # registry_method_note <chr>, measure <chr>, statistic <chr>,
#> # estimator_type <chr>, survey_type <chr>, design_domains <chr>,
#> # estimate <dbl>, standard_error <dbl>, cv <dbl>, ci_lower <dbl>,
#> # ci_upper <dbl>, unweighted_n <int>, weighted_n <dbl>, deff <dbl>,
#> # effective_n <dbl>, degrees_freedom <dbl>, decision <chr>, …