define_deprivation {mpindex}R Documentation

Define deprivation cutoffs

Description

A deprivation cutoff must be set for each indicator defined in the MPI specifications. This step establishes the first cutoff in the methodology where every person/household (defined as the unit of analysis) can be identified as deprived or non-deprived with respect to each indicator.

For each indicator, 0 will be used to indicate "not deprived", 1 if deprived, and NA if missing or non-response. Additional column containing the product of the value of the indicator obtained and its corresponding weight will also be computed for convenience.

Usage

define_deprivation(
  .data,
  .indicator,
  .cutoff,
  .mpi_specs = getOption("mpi_specs"),
  .collapse = FALSE,
  .set_na_equal_to = 0,
  .collapse_condition = NULL
)

Arguments

.data

A data frame or tibble

.indicator

Name of indicator defined in MPI specs (must exactly match the specs).

.cutoff

A conditional logic that defines the poverty line to determine whether deprived or not.

.mpi_specs

MPI specifications defined in define_mpi_specs.

.collapse

A boolean indicating whether to collapse the data frame or not. This is useful, for instance, if the original data where the .cutoff argument above applies to an individual person but your unit of analysis in household.

.set_na_equal_to

Coerce value from NA to either 0 (not deprived) or 1 (deprived). Default is 0.

.collapse_condition

NOT YET FULLY IMPLEMENTED. ONLY WORKS WITH DEFAULT. A condition when .collapse is set to TRUE. If NULL, max() will be used as default.

Value

A data frame of deprivation value for the indicator (.*_unweighted): 0 for "not deprived", 1 for deprived, and NA for missing and non-response; and product of .*_unweighted and its corresponding weight (.*_weighted).

References

How to Apply the Alkire-Foster Method

See Also

define_mpi_specs

Examples

# Use sample specs file included in the package
specs_file <- system.file(
 "extdata",
 "global-mpi-specs.csv",
 package = "mpindex"
)
specs <- define_mpi_specs(specs_file, .uid = 'uuid')

# Using built-in dataset
df_household |>
  define_deprivation(
    .indicator = drinking_water,
    .cutoff = drinking_water == 2
  )

df_household_roster |>
  define_deprivation(
    .indicator = school_attendance,
    .cutoff = attending_school == 2,
    .collapse = TRUE
  )


[Package mpindex version 0.2.1 Index]