Published on Data Blog

Estimating global poverty in R and Stata

This page in:

The World Bank’s global poverty measures published through the PovcalNet website can now be accessed directly from within R and Stata. The R package povcalnetR and the Stata command povcalnet offer the same functionality as the website, namely the estimation of poverty at any poverty line for individual countries, groups of countries, or entire regions. Accessing PovcalNet directly from within R and Stata is a major improvement to the usability of the tool; for example PovcalNet results can be directly merged with any other R/Stata dataset. In this blog, we show how the commands can be downloaded and illustrate their use with an example. We will illustrate the use of the commands with a series of blog posts over the next few weeks. A more detailed description with more examples can be found in the github pages (R and Stata), as well as Castaneda et al. (2019) for the Stata command. We encourage users to send us comments and suggestions, and to report any bugs in the github issues pages (R and Stata).

PovcalNet reports the World Bank’s official global, regional and country-level poverty estimates, as well as a range of inequality statistics. It is managed jointly by the Data and Research Groups within the World Bank's Development Economics Division, and draws heavily upon a strong collaboration with the Poverty and Equity Global Practice, which is responsible for gathering and harmonizing the underlying household survey data. The website is based on a web API, which was documented in more detail as part of the September 2018 PovcalNet update (see Zhao, 2018). This means that every query to the PovcalNet website (e.g. estimate the poverty headcount ratio at $2 per day in Bangladesh in 2016) generates a URL that returns the results in a machine-readable format. The R and Stata packages query the PovcalNet API and read the results directly into R/Stata.

The R package povcalnetR can be installed from github with

install.packages(c("devtools", "httr"))

devtools::install_github("worldbank/povcalnetR")

and will soon be available in CRAN.

The Stata povcalnet command can be installed from SSC by typing:

ssc install povcalnet

The development version, which includes the latest updates and features, can be downloaded from github by using the github Stata command (developed by E. F. Haghish):

net install github, from ("https://haghish.github.io/github/")

github install worldbank/povcalnet

It is important to understand that PovcalNet reports estimates for two types of years: the survey year, which is the year for which the welfare variable was collected, and the reference year, which is the year for which global poverty estimates are produced. The reference year estimates make additional assumptions to align household surveys, that may be conducted at infrequent intervals, to a common year for which poverty can be estimated for as many countries around the world as possible. Currently, the available reference years are 1981, 1984, 1987, 1990, 1993, 1996, 1999, 2002, 2005, 2008, 2010, 2011, 2012, 2013 and 2015. Inequality estimates are only available for the survey-years.

The next line of code queries the global and regional estimates of extreme poverty at the international poverty line of $1.9 per day for all the reference years:

R: df <- povcalnetR::povcalnet_wb()

Stata: povcalnet wb, clear

With a few additional lines of code (R and Stata), the changing geographic distribution of extreme poverty can be easily graphed. In 2015, Sub-Saharan Africa accounted for more than half of the global poor, and together with South Asia for more than 85 percent. It is clear that the reduction in global poverty was driven by rapid progress in East Asia. In recent years, the number of poor has also fallen steadily in South Asia. This stands in sharp contrast with Sub-Saharan Africa, where the total number of poor people has actually been increasing over time. As discussed in this report, this shift in the geography of global poverty from high-growth (East Asia and recently South Asia) to low-growth (Sub-Saharan Africa) regions also implies a likely slowdown in the future reduction of global poverty (see this blog for projections beyond 2015 to 2030).


Authors

R. Andres Castaneda Aguilar

Economist, Development Data Group, World Bank

Christoph Lakner

Program Manager, Development Data Group, World Bank

Espen Beer Prydz

Economist, Development Data Group

Join the Conversation

The content of this field is kept private and will not be shown publicly
Remaining characters: 1000