2024-03-13

Inflation in the World

By: Group H (Jack Hosier, Charlotte Farrell, Ben Delafuente)

Intro Slide

  • For this project, we are going to be examining inflation rates of the United States, Canada, Mexico, China, India and Russia over the course of the 21st Century (2000 to 2024).

  • For each country, we will calculate the maximum and minimum inflation rates over this period, as well as the mean and standard deviation and extrapolate why those are with real-world events.

Data Sorting

  • This code will read our CSV file, “Global inflation data”, and pick the countries that we will be analyzing and finding their inflation rates from the years 2000 to 2024
  • We use a select function to get the years wanted and the filter function to get the country that we chose
inflationDF = read.csv("global_inflation_data.csv",sep=",",header=TRUE)

USInflation = inflationDF %>% select(X2000:X2024) %>% filter(inflationDF$country_name == "United States")

CanadaInflation = inflationDF %>% select(X2000:X2024) %>% filter(inflationDF$country_name == "Canada")

ChinaInflation = inflationDF %>% select(X2000:X2024) %>% filter(inflationDF$country_name == "China, People's Republic of")

IndiaInflation = inflationDF %>% select(X2000:X2024) %>% filter(inflationDF$country_name == "India")

MexicoInflation = inflationDF %>% select(X2000:X2024) %>% filter(inflationDF$country_name == "Mexico")

RussiaInflation = inflationDF %>% select(X2000:X2024) %>% filter(inflationDF$country_name == "Russian Federation")

Max Inflation Rates

  • These are the calculations for the maximum inflation rates
# Calculate maximum inflation rates
USMaxInflation <- max(USInflation)
CanadaMaxInflation <- max(CanadaInflation)
ChinaMaxInflation <- max(ChinaInflation)
IndiaMaxInflation <- max(IndiaInflation)
MexicoMaxInflation <- max(MexicoInflation)
RussiaMaxInflation <- max(RussiaInflation)

# Create a vector of maximum inflation rates
maxInflationRates <- c(USMaxInflation, CanadaMaxInflation, ChinaMaxInflation, IndiaMaxInflation, MexicoMaxInflation, RussiaMaxInflation)

# Create a dataframe of all maximum inflation rates 
maxInflationDF <- data.frame(country = c("USA", "Canada", "China", "India", "Mexico", "Russia"), rates = maxInflationRates)

Max Inflation Rates Bar Graph

Explanation of Max Inflation Rates

  • The max inflation rates for the USA and Canada were recorded in 2022, in the midst of the vast supply-chain disruptions caused by the COVID-19 Pandemic.
  • China and India max inflation rates in 2008, when the Global Financial Crisis happened and unemployment skyrocketed.
  • Mexico had its maximum inflation rate in 2000, right around when they elected a new president Vicente Fox.
  • Russia had its max inflation rate in 2018, when it had a presidential election and hosted the 2018 FIFA World Cup.

Min Inflation rates

  • These are the calculations for the minimum inflation rates
USminInflation = min(USInflation) #this was in 2009 
CanadaMinInflation = min(CanadaInflation) #this was in 2009
ChinaMinInflation = min(ChinaInflation) #this was in 2009
IndiaMinInflation = min(IndiaInflation) #this was in 2018
MexicoMinInflation = min(MexicoInflation) #this was in 2015
RussiaMinInflation = min(RussiaInflation) #this was in 2018 

minInflationRates = c(USminInflation, CanadaMinInflation, ChinaMinInflation, IndiaMinInflation, MexicoMinInflation, RussiaMinInflation)

#dataframe of all min inflation rates 
minInflationDF <- data.frame(country = c("USA", "Canada", "China", "India", "Mexico", "Russia"), rates = minInflationRates)

Min Inflation rates Bar graph using ggplot2

## Explanation of Min Inflation rates

  • The min inflation rates in the USA, Canada and China are all in 2009, 1 year after the 2008 Great Recession.
  • The min inflation rate in Mexico was in 2015, which was caused by a steep reduction in mobile phone charges and declining prices for energy products and certain agricultural goods.
  • The min inflation rates for India was in 2018.
  • Russia’s minimum inflation rate was recorded in 2001, when it was electing a new president for the first time since the collapse of the USSR a decade earlier.

Mean of the Inflation Rates

#Create a vector of mean inflation rates

#Create a Dataframe of means

##   country     means
## 1     USA  2.679167
## 2  Canada  2.308333
## 3   China  2.179167
## 4   India  6.391667
## 5  Mexico  4.916667
## 6  Russia 10.104167
  • The means (represented as \(\mu\)) show the average inflation rate of the chosen countries over the span of the year 2000 to 2024.
  • Overall, Russia has the highest inflation rate at 10.10417 and China has the lowest at 2.179167.

Bar Graph of the mean

  • This bar graphy shows the average inflation rate of each country, USA, Canada, China, India, Mexico, and Russia

Standard Deviation of the Inflation Rates

USAsd = sd(USInflation) 
CanadaSD = sd(CanadaInflation) 
ChinaSD = sd(ChinaInflation) 
IndiaSD = sd(IndiaInflation) 
MexicoSD = sd(MexicoInflation) 
RussiaSD = sd(RussiaInflation) 

InflationStdDevs <- c(USAsd, CanadaSD, ChinaSD, IndiaSD, MexicoSD, RussiaSD)

stdDevDF <- data.frame(country = c("USA", "Canada", "China", "India", "Mexico", "Russia"), stdDev = InflationStdDevs)

Bar Graph of Standard Deviation of the Inflation Rates

  • Here is a bar graph of the standard deviations

Summary of the data

  • Standard deviation (represented as \(\sigma\)) is the measure of how spread out a set of values are.
  • A higher standard deviation indicates more variability in the values of a sample.
  • Russia has the highest standard deviation of the group, meaning its inflation values are more spread out than the others.

Conclusion

  • It can be seen that political and global events have a lot of effect on the countries that were chosen.
  • The maximum and minimum inflation rates being effected by global issues or conflicts, such as pandemics, recessions, and presidential elections
  • The mean showcases the average of those years between 2000 and 2024 and show what percentage the people were paying
  • However, the standard deviation might be the most important piece of data
  • The deviation shows how the inflation rates changed over the years and how much they changed throughout, which is important because data and information can be seen from that.