GDP & GDPPCPPP from IMF World Economic Outlook & WDI
Summary
The IMF World Economic Outlook and WDI hold valuable information about countries' GDP, PPP, etc. Therefore IFs contains that information and uses that information to calculate other indicators.
Data Collected From Sources
- GDP at current prices in local currency (GDP_current_LCU)
- GDP deflator for each year (GDP_deflator_year)
- GDP deflator for your base year (e.g., GDP_deflator_base for 2021)
- Exchange rate for your base year (Exchange_Rate_base; local currency per USD)
- PPP conversion factor for your base year (PPP_conversion_base; local currency per international dollar)
- Population (for each year; can be millions or actual number)
Calculation
In the calculation of constant GDP MER at constant price (such as tables GDP2021 and GDP2017), the formal process is to
- Get GDP at local currency unit- GDP_current_LCU
- Use GDP deflator to calculate GDP_constant_LCU. Here, you will need to pick a base year. We were using 2017 but are now moving to 2021. Thus, the result would be GDP at constant 2021 LCU.
- GDP_constant_LCU_base = GDP_current_LCU × (GDP_deflator_base / GDP_deflator_year)
- Use the market exchange rate to calculate GDP_constant_USD. Here, you will need the market exchange rate in 2021.
- GDP_constant_USD_base = GDP_constant_LCU_base / Exchange_Rate_base
To calculate GDP PPP at constant price, the formal process is exactly the same, except for step 3 in which instead of using market exchange rate, we apply PPP conversion rate.
- Same as step 1 above.
- Same as step 2 above.
- Use the PPP conversion rate to calculate GDP_PPP_constant_USD. Here, you will need the PPP conversion rate in 2021.
- GDP_PPP_constant_base = GDP_constant_LCU_base / PPP_conversion_base
We can use a shortcuts because each country's GDP at constant price in a selected year equals to that country's GDP at current price in the same year.
- Take a country's GDP at current USD in year 2021 and treat it as its GDP at constant $2021 in year 2021.
- GDP_constant_USD_2021 = GDP_current_USD_2021
- Calculate GDP growth rates measured at constant price.
- Because GDP growth rates measured at constant price remain the same despite of the base year chosen, i.e., a country's GDP growth rates would be the same across table GDP2011, GDP2017, and GDP2021.
- GDP_constant_USD_year = GDP_current_USD_base × (Growth Rate)
- Because GDP growth rates measured at constant price remain the same despite of the base year chosen, i.e., a country's GDP growth rates would be the same across table GDP2011, GDP2017, and GDP2021.
- Apply the growth rates to that country's GDP at current USD in 2021 to calculate other years' GDP.
This short cut also works for calculating GDP PPP at constant price.
- We already calculated GDP MER at constant USD in 2021 for each country for all years above.
- Use the ratio between a country's 2021's market exchange rate and its 2021's PPP conversion factor: you can use the following equation: GDP MER at constant $2021 / price ratio to get GDP PPP. Then GDP PPP / Population gets GDP PC PPP.
- GDP_PPP_constant_year = GDP_constant_USD_year / (Exchange_Rate_base / PPP_conversion_base)
- GDP_PC_PPP_constant_year = GDP_PPP_constant_year / Population_year
Related Wiki Pages
Tables In IFs
| Variable | Table | Group | SubGroup | Definition | Units | Years | UsedInPreprocessor | UsedInPreprocessorFileName |
| GDP2011 | SeriesGDP2011 | Economy | Aggregate | IMF 2025 October Release, projection to 2027; WDI 2025 October version, values up to 2024 | Bil 2011$ | 1960-2027 | 0 | |
| GDP2011PCPPP | SeriesGDP2011PCPPP | Economic, Favorites | GDP per Capita | WDI 2025 October version, values up to 2024 | 2011 PPP$ | 1960-2024 | 1 | Economy |
| GDP2017 | SeriesGDP2017 | Economy | Aggregate | IMF 2025 October Release, projection to 2027; WDI 2025 October version, values up to 2024 | Bil 2017$ | 1960-2027 | 0 | |
| GDP2017PCPPP | SeriesGDP2017PCPPP | Economic, Favorites | GDP per Capita | WDI 2025 October version, values up to 2024 | 2017 PPP$ | 1960-2024 | 1 | Economy |
| GDP2021 | SeriesGDP2021 | Economy | Aggregate | IMF 2025 October Release, projection to 2027; WDI 2025 October version, values up to 2024 | Bil 2021$ | 1960-2027 | 0 | |
| GDP2021PCPPP | SeriesGDP2021PCPPP | Economic, Favorites | GDP per Capita | WDI 2025 October version, values up to 2024 | 2021 PPP$ | 1960-2024 | 1 | Economy |
Most recent update was in November of 2025.
Data Pulling Instructions
If you would like a script to pull navigate to https://github.com/n1shamin/GDP-and-GDPPCPPP-IMF-and-WB. This does not do the special cases.
GDP
1. Download data
- GDP (current US$): https://data.worldbank.org/indicator/NY.GDP.MKTP.CD
- GDP growth (annual %): https://data.worldbank.org/indicator/NY.GDP.MKTP.KD.ZG
- IMF: entire dataset https://www.imf.org/en/Publications/SPROLLS/world-economic-outlook-databases#sort=%40imfdate%20descending
- Click the most recent WEO database, eg, World Economic Outlook Database, October 2024.
- Select "Entire Dataset"
- Click "By Countires", it will automatically download the entire data. The download file will be in .xls format. Open the file with Excel and Save as .xlsx for future use.
- We will only use WEO Subject Code in (NGDP_RPCH, NGDPD). NGDP_RPCH is the percent change of GDP, and NGDPD is GDP in current US$ in Billions).
- IFsHistSeries: SeriesGDP2011 and SeriesGDP2017, in current US$ in Billions. We will use 2011 as the example in this instruction.
2. Calculate Growth_Rate from SeriesGDP2011. (Growth_Rate in 2011 = (GDP in 2011 - GDP in 2010)/GDP in 2010; The growth_rate need to *100 as percent value.)
3. Change all the data we downloaded and calculated to the format of [Country, Year, VAL]
- GDP (current US$): Country, Year, wb_curr
- GDP growth (annual %): Country, Year, wb_growth
- IMF_ NGDP_RPCH: Country, Year, imf_growth
- IMF_ NGDPD: Country, Year, imf_curr (Note1)
- SeriesGDP2011: Country, Year, ifs_gdp (Note1)
- Growth_Rate: Country, Year, ifs_growth
Note1: imf_curr and ifs_gdp need to be * 1000000000 due to the Billions Unit.
4. Create a new value, GDP_curr, primarily using wb_curr.
- If there is a null in wb_curr, then use imf_curr to fill the null.
- If there is a null in both wb_curr and imf_curr, then use ifs_gdp to fill the null.
5. Create a new value, Growth, primarily using wb_growth
- If there is a null in wb_growth, then use imf_growth to fill the null.
- If there is a null in both wb_growth and imf_growth, then use ifs_growth to fill the null.
- After filling nulls, use forward fill to fill the rest of nulls.
6. Create a new value, GDP_new,
- The base year is 2011 since we use GDP2011 from the IFsHist. It will change to 2017 when we use GDP2017.
- Fill the base year value in GDP_curr to GDP_new for each country.
- After this step, every country will only have 1 value in GDP_new for the base year, e.g. 2011.
7. Fill the rest of the years for GDP_new using Growth and GDP_curr:
- For the years before the base year, 2011, we will calculate the value from 2010 to 1960. E.g. GDP_new in 2010 = GDP_new in 2011*100 / (Growth in 2011 + 100). The year will be rolling for the rest of the calculation.
- For the years from the base year to year_end(Note2), 2011, we will calculate the value from 2012 to 2026. E.g. GDP_new in 2012 = GDP_new in 2011*(100 + Growth in 2012) / 100. The year will be rolling for the rest of the calculation.
Note2: year_end is 2 years from now.
8. GDP_new is the new value for GDP2011. Need to be /1000000000 and be rounded to 5 decimals.
GDPPCPPP
1. Download Data
- GDP per capita (current LCU): https://data.worldbank.org/indicator/NY.GDP.PCAP.CN
- GDP deflator (base year varies by country): https://data.worldbank.org/indicator/NY.GDP.DEFL.ZS
- PPP conversion factor, GDP (LCU per international $): https://data.worldbank.org/indicator/PA.NUS.PPP
- GDP per capita growth (annual %): https://data.worldbank.org/indicator/NY.GDP.PCAP.KD.ZG
- IFsHistSeries: SeriesGDP2011PCPPP and SeriesGDP2017PCPPP. We will use 2011 as the example in this instruction.
2. Calculate PCPPP_Growth_Rate from SeriesGDP2011PCPPP. (PCPPP_Growth_Rate in 2011 = (PCPPP in 2011 - PCPPP in 2010)/PCPPP in 2010; The growth_rate need to *100 as percent value.)
3. Change all the data we downloaded and calculated to the format of [Country, Year, VAL]
- GDP per capita (current LCU): Country, Year, wb_curr
- GDP deflator (base year varies by country): Country, Year, wb_deflat
- PPP conversion factor, GDP (LCU per international $): Country, Year, wb_ppp_cov
- GDP per capita growth (annual %): Country, Year, wb_growth
- SeriesGDP2011PCPPP: Country, Year, ifs_pcppp
- PCPPP_Growth_Rate: Country, Year, ifs_pcppp_growth
4. Create a new value, pc_growth, primarily using wb_growth.
- If there is a null in wb_growth, then use ifs_pcppp_growth to fill the null.
5. Create a new value, 2011_deflat (if use SeriesGDP2017PCPPP, then the new value is 2017_deflat)
- The base year is 2011 since we use GDP2011PCPPP from the IFsHist. It will change to 2017 when we use GDP2017PCPPP.
- Fill the base year value in wb_deflat in 2011_deflat for each country.
- After this step, every country will only have 1 value in 2011_deflat for the base year, e.g. 2011.
- If there is null value for wb_deflat in the base year, then you can leave the 2011_deflat null.
6. Create a new value, 2011_ppp_cov (if use SeriesGDP2017PCPPP, then the new value is 2017_ppp_cov)
- Fill the base year value in wb_ppp_cov in 2011_ppp_cov for each country.
- After this step, every country will only have 1 value in 2011_ppp_cov for the base year, e.g. 2011.
7. Create a new table using [Country, Year, wb_curr] and [Country, Year, wb_deflat]
- Find the most recent year for each country as well as the wb_curr and wb_deflat in that most recent year.
8. Merge the new table with 2011_deflat and 2011_ppp_cov only using Country.
- The output table would be
- Country
- Year (the most recent year for the country)
- wb_curr (the wb_curr in the most recent year for the country)
- wb_deflat (the wb_deflat in the most recent year for the country)
- 2011_deflat (the deflator in the base year, 2011)
- 2011_ppp_cov (the ppp_cov in the base year, 2011)
- Calculate a new value, 2011_const_pcppp (if use SeriesGDP2017PCPPP, then the new value is 2017_const_pcppp) using the formula below.
- 2011_const_pcppp = (wb_curr * (2011_deflat/wb_deflat))/2011_ppp_cov
9. There will be countries having 0 or null values for 2011_const_pcppp. We will use the value in ifs_pcppp in the most recent year for these missing countries to fill 2011_const_pcppp. (In this case, the most recent year will change to the most recent year for ifs_pcppp.) Thus, all 188 countries should have a 2011_const_pcppp for its most recent year.
10. Now we have 2011_const_pcppp in the most recent year for each country. We will calculate the 2011_const_pcppp for the rest of the year.
- year_end = 2022 (The most recent year in GDP per capita (current LCU) from WDI).
- Starting from the most recent year to the earliest year. E.g. The most recent year in Afghanistan is 2021, 2021 – 1960, for 2020
- 2011_const_pcppp in 2020 = 100* 2011_const_pcppp in 2021 / (100 + pc_growth in 2021)
- Starting from the most recent year to the year_end. E.g. The most recent year in Afghanistan is 2021, 2021 – 2022, for 2022
- 2011_const_pcppp in 2022 = 2011_const_pcppp in 2021 * (100 + pc_growth in 2022)/100
11. The 2011_const_pcppp is the new value for GDP2011PCPPP. Need to be rounded to 5 decimals.
Special Cases
- We want to have as much data for all regions and coverage, we need to make sure that we use proxies and special cases when we can. For Kosovo, Sahrawi Arab Democratic Republic, and South Sudan use Albania, Morocco (and Mali for GDP switch to Mali in 1967), and Sudan as proxies. Be mindful that for tables with units in rate or percent, proximal values can be directly applied; however, when values are in numbers or headcounts, you will need to borrow the population figures to apply values proportionally. To do this use SeriesPopulation. For instance, Kosovo’s GDP = Albania’s GDP * Kosovo’s Population / Albania’s Population.
- For Taiwan PC PPP use IMF data instead of WDI which gives you data from 1980-present year. Then use Singapore as a proxy for years 1960-1979.
Data Notes
- The IMF updated their NGDP_RPCH projection for part of the countries in July of 2025 (https://www.imf.org/en/Publications/WEO/Issues/2025/07/29/world-economic-outlook-update-july-2025).
- IMF updated their data structure and codes. The script adapted to this.
- GDP2021 and GDP2021PCPPP are new tables introduced in 2025 because the World Bank introduced 2021 PPP.