Define MPI specifications: dimensions, indicators, and weights
Source:R/define-mpi-specs.R
define_mpi_specs.RdUse to define MPI dimensions, indicators and its corresponding
weights using any of the supported file types: .xlsx (Excel),
.json, .csv, or .txt (TSV). You can also set the
poverty cutoff or list of poverty cutoffs.
Arguments
- mpi_specs_file
Path to a
.xlsx,.json,.csv, or.txt(TSV) file. The file must contain columns:Dimension,Indicator,Variable,Weight, and optionallyDescription.- indicators
A data frame of MPI indicators. Alternative to
mpi_specs_filewhen you prefer to define indicators inline.- poverty_cutoffs
Single value or vector of poverty cutoffs (k). All values must be in (0, 1]. Default is
NULLwhich will be automatically set to1/n, wherenis the total number of dimensions.- unit_of_analysis
e.g.
"individuals","households". DefaultNULL.- uid
Column name containing the unique ID (unit of analysis).
- source_of_data
Source of data; used in output footnotes.
- names_separator
- save_as_global_options
- ...
Reserved for forward-compatibility; passing old dotted argument names (e.g.
.uid) triggers a helpful error.
Value
An mpi_specs object. Pass this directly as the
mpi_specs argument in compute_mpi,
define_deprivation, and save_mpi.
Examples
specs_file <- system.file(
"extdata",
"global-mpi-specs.csv",
package = "mpindex"
)
system.file("extdata", package = "mpindex") |> list.files()
#> [1] "global-mpi-specs.csv" "global-mpi-specs.json" "global-mpi-specs.txt"
#> [4] "global-mpi-specs.xlsx"