Skip to content

Commit

Permalink
💄 modify metadata as suggested by author
Browse files Browse the repository at this point in the history
  • Loading branch information
paarriagadap committed Sep 16, 2024
1 parent 19b0e3b commit eb92870
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ definitions:
description_key_international_dollars: &description_key_international_dollars |-
The data is measured in international-$ at 2021 prices - this adjusts for inflation and for differences in the cost of living between countries.

description_from_producer_healthy_diet: &description_from_producer_healthy_diet |-
The Cost of a Healthy Diet indicator provides a globally standardized metric to monitor food environments, measuring a population’s access to sufficient food for an active and healthy life. For this metric, access to healthy diets is measured using the least expensive locally available items in sufficient quantities to meet national governments’ food-based dietary guidelines. For global monitoring, commonalities among those guidelines are represented by a Healthy Diet Basket, specifying a target number and quantity of eleven items balanced across six nutritionally defined food groups. The items selected in each country to meet the global Healthy Diet Basket standard generally also achieve nutrient adequacy, at a similar cost to meeting an individual country’s own national dietary guidelines.

_Limitations and exceptions_

Item prices for the global Cost of a Healthy Diet indicator are reported by each national statistical organization through the International Comparison Program, intending to show the country’s annual average cost for commonly consumed foods being sold in multiple countries. Food item availability and price at any one time and place could differ from this average. Also, prices are reported in local currency units, and then adjusted for inflation over time and price levels across countries using national Consumer Price Indexes and Purchasing Power Parity exchange rates that may not exactly match currency values used in any one time and place.

_Statistical concept and methodology_

The Cost of a Healthy Diet is a new kind of price index developed by the Food Prices for Nutrition project, based on matching item descriptions to food composition data then selecting the lowest cost options to meet dietary requirements. The initial methods were first published as a background paper for the UN agencies’ State of Food Security and Nutrition in the World Report 2020 and revised for the 2022 and 2024 editions of that same report.

dataset:
update_period_days: 365
description: |-
Expand Down Expand Up @@ -123,6 +134,8 @@ tables:
Cost of purchasing the least expensive locally available foods to meet requirements for energy and food-based dietary guidelines, for a representative person within energy balance at 2,330 kcal/day. This data is adjusted for inflation and for differences in the cost of living between countries.
description_key:
- *description_healthy_diet
description_from_producer: *description_from_producer_healthy_diet

cost_of_a_healthy_diet_relative_to_the_cost_of_sufficient_energy_from_starchy_staples:
title: Cost of a healthy diet relative to the cost of sufficient energy from starchy staples
unit: "%"
Expand Down
35 changes: 35 additions & 0 deletions etl/steps/data/garden/wb/2024-09-09/food_prices_for_nutrition.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Load a meadow dataset and create a garden dataset."""

from typing import List

from owid.catalog import Table

from etl.data_helpers import geo
Expand All @@ -21,6 +23,9 @@
# Base year for CPI corrections.
CPI_BASE_YEAR = 2021

# Alternative attribution for share and number who cannot afford a healthy diet.
ATTRIBUTION_CANNOT_AFFORD = "FAO and World Bank (2024), using data and methods from Bai et al. (2024)"


def adapt_units(tb: Table, tb_wdi: Table) -> Table:
# Change units from million people to people.
Expand Down Expand Up @@ -53,6 +58,16 @@ def adapt_units(tb: Table, tb_wdi: Table) -> Table:
return tb


def change_attribution(tb: Table, columns: List[str], attribution_text: str) -> Table:
"""
Change attribution for some indicators as suggested by authors.
"""
for col in columns:
tb[col].m.origins[0].attribution = attribution_text

return tb


def run(dest_dir: str) -> None:
#
# Load inputs.
Expand Down Expand Up @@ -89,6 +104,26 @@ def run(dest_dir: str) -> None:
# Adapt units and correct for inflation.
tb = adapt_units(tb=tb, tb_wdi=tb_wdi)

# Change attributions for share and number of people who cannot afford a healthy diet.
tb = change_attribution(
tb=tb,
columns=[
"people_who_cannot_afford_a_healthy_diet",
"percent_of_the_population_who_cannot_afford_a_healthy_diet",
],
attribution_text=ATTRIBUTION_CANNOT_AFFORD,
)

# Remove attributions for cost_of_an_energy_sufficient_diet and cost_of_a_nutrient_adequate_diet
tb = change_attribution(
tb=tb,
columns=[
"cost_of_an_energy_sufficient_diet",
"cost_of_a_nutrient_adequate_diet",
],
attribution_text=None,
)

# Set an appropriate index and sort conveniently.
tb = tb.format()

Expand Down
4 changes: 3 additions & 1 deletion snapshots/wb/2024-09-09/food_prices_for_nutrition.csv.dvc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ meta:
- Secretariat of the Pacific Community: Statistics and Demography Programme.

citation_full: |-
World Bank, adapted from Herforth, A., Venkat, A., Bai, Y., Costlow, L., Holleman, C. & Masters, W.A. (2022). Methods and options to monitor globally the cost and affordability of a healthy diet. Background paper for The State of Food Security and Nutrition in the World 2022. Rome, FAO.
- The World Bank (2024), Food Prices for Nutrition database, version 3.0, updated 24 July 2024. Washington, DC: The World Bank. https://doi.org/10.57966/41AN-KY81
- FAO (2024), Cost and Affordability of a Healthy Diet database, updated 24 July 2024. Rome, FAO. https://www.fao.org/faostat/en/#data/CAHD
attribution: FAO and World Bank (2024), using data and methods from Herforth et al. (2022)
version_producer: '3.0'
url_main: https://databank.worldbank.org/source/food-prices-for-nutrition
date_accessed: '2024-09-09'
Expand Down

0 comments on commit eb92870

Please sign in to comment.