← Back to blog GDP analysis cover image

Gross Domestic Product (GDP) Analysis

Writer: Tanushree Nepal · · ~7 min read
On this page

Introduction

Gross Domestic Product (GDP) measures the market value for all products and services within a country's borders. GDP Growth Rate is the percentage increase in GDP from quarter to quarter. To avoid double counting, GDP includes only the final product value; intermediate goods like shoelaces in a shoe are not counted.

Identity: GDP = Consumption + Investment + Government Spending + (Exports – Imports)

Objectives

  1. Compare GDP growth between developed (USA, China, Kuwait, etc.) and developing nations (Nepal, Pakistan, Bangladesh, etc.).
  2. Quantify how financial/economic indicators correlate with GDP.

Algorithm Used — Linear Regression

Methodology

  1. Data collection
  2. Cleaning
  3. Preprocessing
  4. Visualization
  5. Model training & testing (Linear Regression)

Data Source & Cleaning

World Bank datasets (1997–2021) across South Asia, North America, and MENA; ~32 countries. Indicators split by type (currency / percentage / number). NA values replaced with 0 per documented reasons in metadata rather than mean imputation across countries.

Visualization & Findings

Nepal vs China — Total GDP Over Time

Total GDP of Nepal and China over time
Fig 1: Nepal’s GDP stalls around the 2015 earthquake, resumes growth, then dips in 2020; China continues growing.

Exports of Goods & Services

Correlation of exports and GDP growth
Fig 2: Export growth correlates strongly with GDP growth.
Exports over time: Nepal vs China
Fig 3: China’s exports steadily increase; Nepal’s exports vary and dip post-2015.

GDP Per Capita Over Time

GDP per capita trends
Fig 4: Nepal’s GDP per capita rises overall, with a decline in 2020 then recovery in 2021.

Total Reserves (incl. gold)

Total reserves
Fig 5: Reserves fall in 2021 as Nepal imports medical equipment during the pandemic.

Gross National Income (GNI)

GNI trend
Fig 6: GNI dips in 2020 due to lockdowns reducing domestic value-added.

Predictive Modeling

Data split 70/30 (train/test). Linear regression on the currency indicators achieved an R² ≈ 0.99 for this dataset, suggesting a very strong linear fit.

R-squared on currency indicators
Fig 7: High R² on the currency indicators model.

Conclusion

GDP is strongly affected by trade and financial indicators and by country-specific shocks. Nepal shows sensitivity around the 2015 earthquake and the 2020 pandemic; export strength and reserve policies materially influence outcomes.

References

Originally drafted for Data Insight Online; republished on my site.