Skip to contents

Classifies poverty and extreme poverty using per-capita household income and explicit poverty-line parameters. In strict mode, poverty lines are resolved from the poverty-line registry. In manual mode, both poverty lines must be provided explicitly together with a source note.

Usage

enemdu_build_poverty_flags(
  data,
  period = NULL,
  income_var = "ingtot_pc",
  poverty_line = NULL,
  extreme_poverty_line = NULL,
  poverty_lines = enemdu_poverty_line_registry(),
  mode = c("strict", "manual", "diagnostic_only"),
  line_source = NULL,
  poverty_var = "pobre",
  extreme_poverty_var = "expobre",
  add_line_vars = TRUE,
  overwrite = FALSE
)

Arguments

data

A data frame.

period

Period identifier used to resolve poverty lines in strict mode.

income_var

Name of the income per capita variable. Defaults to "ingtot_pc".

poverty_line

Manual poverty line. Required in manual mode.

extreme_poverty_line

Manual extreme poverty line. Required in manual mode.

poverty_lines

Poverty-line registry. Defaults to package registry.

mode

One of "strict", "manual" or "diagnostic_only".

line_source

Source note required in manual mode.

poverty_var

Output poverty flag variable. Defaults to "pobre".

extreme_poverty_var

Output extreme poverty flag variable. Defaults to "expobre".

add_line_vars

Logical. If TRUE, adds linea_pobreza and linea_pobreza_extrema to the data.

overwrite

Logical. If TRUE, overwrites existing output variables.

Value

A data frame with poverty flags, or the unchanged data with a diagnostic attribute when mode = "diagnostic_only".

Details

This function deliberately refuses to derive poverty indicators from implicit or non-auditable poverty lines.