Accessing the World Bank’s estimates of poverty and inequality
The pip Stata client (wrapper)
Installation
SSC
ssc install pip
Github
net install github, from("https://haghish.github.io/github/") github install worldbank/pip
Installation
SSC
ssc install pip
Github
net install github, from("https://haghish.github.io/github/") github install worldbank/pip, version(0.9.5.9003)
Country-level estimates
/* To query poverty at $2.15-a-day poverty line for all countries in all survey years*/pip, clear country(all) year(all) povline(2.15)* Default pip, clear
Variables
Country-level estimates
/* To query poverty at \$2.15-a-day poverty line for Morocco in 2013 */pip, country(mar) year(2013) clear
Country-level estimates
/* For extrapolated and interpolated data that underpin the global and regional poverty numbers, use `fillgaps` option */pip, country(mar) year(2019) clear fillgaps
Global and regional poverty estimates
pip wb, clear
Global and regional poverty estimates
pip wb, clear/* Query a particular region or global values with `region()` */pip wb, clear region(wld)pip wb, clear region(lac)
Poverty lines
/*Query poverty at other thresholds*/pip, country(mar) year(2019) clear///fillgaps povline(6.85)
# Number of poor by regiondf <- pipr::get_wb() |>filter(year >1989& year <2019) |>mutate(pop_in_poverty =round(pop_in_poverty /1000000, 0),headcount =round(headcount, 3) )regions <- df |>filter(!region_code %in%c("WLD", "AFE", "AFW")) |>mutate(region_name =fct_relevel(region_name,c("Other high Income","Europe and Central Asia","Middle East and North Africa","Latin America and the Caribbean","East Asia and Pacific","South Asia","Sub-Saharan Africa" )) )world <- df |>filter(region_code =="WLD")gr2 <-ggplot(regions, aes(y = pop_in_poverty, x = year, fill = region_name)) +geom_area() +scale_y_continuous(limits =c(0, 2000),breaks =c(0, 500, 1000, 1500, 2000) ) +scale_fill_tableau(palette ="Tableau 10") +labs(title ="Number of poor by region",y ="Number of poor (million)",x ="" ) +theme_classic() +theme(legend.position ="bottom" ) +geom_line(data = world, size =rel(1.5), alpha =.5, linetype ="longdash")