Skip to contents

Builds knbi, nbi, and xnbi from final NBI component variables that already exist in the data. This function does not reconstruct NBI from raw questionnaire variables.

Usage

enemdu_build_nbi_flags(
  data,
  component_vars = c("comp1", "comp2", "comp3", "comp4", "comp5"),
  nbi_count_var = "knbi",
  nbi_var = "nbi",
  extreme_nbi_var = "xnbi",
  overwrite = FALSE,
  strict_binary = TRUE
)

Arguments

data

A data frame.

component_vars

Final NBI component variables. Defaults to comp1 through comp5.

nbi_count_var

Output variable for the count of observed NBI deprivations.

nbi_var

Output NBI poverty flag.

extreme_nbi_var

Output extreme NBI poverty flag.

overwrite

Logical. If TRUE, overwrite existing output variables.

strict_binary

Logical. If TRUE, require all non-missing component values to be binary 0/1.

Value

A data frame with NBI flags and an nbi_flag_policy attribute.