View source: R/weighted_poverty.R
run_weighted_poverty_gap_index | R Documentation |
Calculates the Foster–Greer–Thorbecke poverty gap index (FGT1) for a list of datasets. This index measures the intensity of poverty by combining the relative poverty rate with the average income shortfall (as a percentage of the poverty line) among the poor.
run_weighted_poverty_gap_index(
data_list,
var_name,
wgt_name,
times_median = 0.5,
type = c("type_4", "type_2"),
na.rm = TRUE
)
data_list |
A named list of data frames. |
var_name |
A string specifying the variable name (e.g., |
wgt_name |
A string. The name of the weight variable. |
times_median |
A numeric scalar. The multiple of the median used to define the poverty threshold (default is |
type |
A character vector indicating the percentile estimation type (passed to |
na.rm |
Logical. Should missing values be removed before computation? Default is |
This function multiplies the relative poverty rate by the average relative poverty shortfall among the poor, resulting in the FGT1 poverty gap index. The result represents the average poverty gap across the entire population as a fraction of the poverty line.
A named list. Each list element is named by country and contains a named numeric vector, where the names are years and the values are the computed poverty gap indices (bounded between 0 and 1).
## Not run:
library(lissyrtools)
library(purrr)
datasets <- lissyrtools::lissyuse(data = c("de", "es", "uk"), vars = c("dhi"), from = 2016)
datasets <- datasets %>%
map(~ .x %>% filter(!is.na(dhi))) %>%
map(~ .x %>% mutate(new_wgt = hwgt * nhhmem)) %>%
apply_iqr_top_bottom_coding("dhi", "hwgt", type = "type_2") %>%
apply_sqrt_equivalisation("dhi")
# Compute the FGT1 poverty gap index
pgi <- run_weighted_poverty_gap_index(
data_list = datasets,
var_name = "dhi",
wgt_name = "new_wgt"
)
print(pgi)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.