Introducing wdi_deflate, a Stata package for converting monetary variables — such as consumption, income, or expenditure from household surveys — to purchasing power parity (PPP) international dollars, nominal US dollars, or constant local currency units (LCUs) using World Bank World Development Indicator (WDI) data.
Thanks to Kit Baum, wdi_deflate is available from SSC for Stata version 15 and higher. To install, type: ssc install wdi_deflate.
The module downloads PPP conversion factors, Consumer Price Index (CPI), and official exchange rates from the WDI and applies them in a single command. Seven conversion paths are supported, including LCU→PPP, LCU→USD, CPI deflation, and rebasing across ICP rounds. It handles both cross-sectional and panel data.
Here's a quick illustration. Suppose you have household consumption and income data in local currency for Ethiopia and Tanzania, collected in different years, and you want to convert to 2021 PPP international dollars:
Code:
clear input str3 iso3 int year double consumption double income "ETH" 2018 15000 22000 "TZA" 2019 850000 1200000 end wdi_deflate consumption income, country(iso3) from(year) to(2021) list
For reproducible research, you can save a deflator snapshot and reference it in subsequent conversions.
Code:
clear wdi_deflate build, saving(deflator.dta) countries(ETH TZA) clear input str3 iso3 int year double consumption "ETH" 2018 15000 "TZA" 2019 850000 end wdi_deflate consumption, country(iso3) from(year) to(2021) using(deflator.dta) list
For more details, type help wdi_deflate after installation. Feedback and suggestions are welcome.
