Introduction

This project analyzes gross savings as a percentage of GDP across countries using data from the World Bank. The purpose of this analysis is to determine which country has the most consistent increase in gross savings over time. The dataset includes variables such as country, year, and gross savings (% of GDP), which are used to track changes in savings behavior across different nations.

To answer the research question, the data was cleaned by removing missing values and non-country aggregates. A new variable, yearly difference, was created to measure the change in savings from one year to the next for each country.

Data Analysis

The dataset was cleaned and analyzed using R. Missing values were removed, and the data was sorted by country and year. A new variable called yearly difference was created to measure changes in gross savings over time. Summary statistics and a histogram were used to explore the distribution of savings. The consistency of each country’s savings was measured by calculating the standard deviation of the yearly differences. The country with the lowest standard deviation was identified as having the most consistent increase.

# Load package
library(WDI)

# Get data
wb_data <- WDI(indicator = "NY.GNS.ICTR.ZS")

# Rename column
names(wb_data)[names(wb_data) == "NY.GNS.ICTR.ZS"] <- "savings"

# Clean data (remove missing values)
wb_clean <- subset(wb_data, !is.na(savings))

# Sort data
wb_clean <- wb_clean[order(wb_clean$country, wb_clean$year), ]

# Create yearly difference
wb_clean$yearly_diff <- ave(
  wb_clean$savings,
  wb_clean$country,
  FUN = function(x) c(NA, diff(x))
)

# Summary statistics
summary(wb_clean$savings)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -236.24   16.61   22.20   22.74   28.33  372.98
# Histogram
hist(wb_clean$savings)

# Find most consistent country
consistency <- aggregate(
  yearly_diff ~ country,
  data = wb_clean,
  FUN = function(x) sd(x, na.rm = TRUE)
)

consistency <- consistency[order(consistency$yearly_diff), ]

head(consistency)
##                       country yearly_diff
## 91                  IDA total   0.3479311
## 214                     World   0.7223862
## 153              OECD members   0.7438324
## 66             European Union   0.7650930
## 165 Post-demographic dividend   0.7777387
## 62                  Euro area   0.7903503

Conclusion

The results show that Italy has the most consistent increase in gross savings over time, as it has the lowest variation in yearly changes. This indicates that Italy’s savings growth has been more stable compared to other countries.

These findings suggest that some countries maintain more consistent economic behavior in terms of savings. Future research could explore why certain countries have more stable savings patterns and how this relates to economic policies or external factors.

References

World Bank Group. World Development Indicators.
https://data.worldbank.org/