Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📊 wb: add series connecting estimates and projections of poverty from World Bank #3709

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ definitions:
Estimates are based on household surveys or extrapolated up until the year of the data release using GDP growth estimates and forecasts. For more details about the methodology, please refer to the [World Bank PIP documentation](https://datanalytics.worldbank.org/PIP-Methodology/lineupestimates.html#nowcasts).
<% elif scenario == "Current forecast + historical growth" %>
This data is a projection of the estimates based on GDP growth projections from the World Bank's Global Economic Prospects and the the Macro Poverty Outlook, together with IMF's World Economic Outlook, in the period 2025-2029. For the period 2030-2050, the data is projected using the average annual historical GDP per capita growth over 2010-2019.
<% elif scenario == "Historical + current forecast + historical growth" %>
This data combines data based on household surveys or extrapolated up until the year of the data release using GDP growth estimates and forecasts, with projections based on GDP growth projections from the World Bank's Global Economic Prospects and the the Macro Poverty Outlook, together with IMF's World Economic Outlook, in the period 2025-2029. For the period 2030-2050, the data is projected using the average annual historical GDP per capita growth over 2010-2019.
<% elif scenario == "2% growth" %>
This data is a projection of the estimates based on a scenario of 2% average GDP per capita growth, while keeping income inequality constant.
<% elif scenario == "2% growth + Gini reduction 1%" %>
Expand All @@ -48,7 +50,7 @@ definitions:
<%- endif -%>

isprojection_by_scenario: |-
<% if scenario == "Historical" %>
<% if scenario == "Historical" or scenario == "Historical + current forecast + historical growth" %>
false
<% else %>
true
Expand Down
16 changes: 16 additions & 0 deletions etl/steps/data/garden/wb/2024-12-03/poverty_projections.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ def connect_estimates_with_projections(tb: Table) -> Table:

tb = tb.copy()

# Save tb_historical and tb_current_forecast, by filtering scenario in historical and current_forecast
tb_historical = tb[tb["scenario"] == "historical"].copy().reset_index(drop=True)
tb_current_forecast = tb[tb["scenario"] == "current_forecast"].copy().reset_index(drop=True)

# Make table wider, by using scenario as columns
tb = tb.pivot(index=["country", "year", "povertyline"], columns="scenario", values=INDICATOR_COLUMNS)

Expand All @@ -116,4 +120,16 @@ def connect_estimates_with_projections(tb: Table) -> Table:
for indicator in INDICATOR_COLUMNS:
tb[indicator] = tb[indicator].copy_metadata(tb["country"])

# Combine historical and current_forecast, by concatenating tb_historical and tb_current_forecast
tb_connected = pr.concat([tb_historical, tb_current_forecast], ignore_index=True)

# Rename scenario column to "Historical + current forecast + historical growth"
tb_connected["scenario"] = "Historical + current forecast + historical growth"

# Keep only the columns in INDEX_COLUMNS and INDICATOR_COLUMNS
tb_connected = tb_connected[INDEX_COLUMNS + INDICATOR_COLUMNS]

# Concatenate tb and tb_connected
tb = pr.concat([tb, tb_connected], ignore_index=True)

return tb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ meta:
producer: Lakner et al.
citation_full: |-
Lakner, C., Genoni, M. E., Stemmler, H., Yonzan, N., & Tetteh Baah, S. K. (2024). Reproducibility package for Poverty, Prosperity and Planet Report 2024. World Bank. https://doi.org/10.60572/KGE4-CX54
attribution: Lakner et al. (2024). Reproducibility package for Poverty, Prosperity and Planet Report 2024

# Files
url_main: https://reproducibility.worldbank.org/index.php/catalog/189/
Expand Down
Loading