Opening all the required packages

library(ggplot2)
library(ggthemes)
library(tidyverse)
library(gganimate)
library(gifski)
library(dplyr)
library(plotly)

Bangladesh GDP Growth: Trend Visualization (Animated)

Reading the data

dx<- read.csv("BD_economic_indicators.csv")
summary(dx)
##       Year           GDP         GDP.per.capita      GDP.growth       
##  Min.   :1980   Min.   : 41.20   Length:40          Length:40         
##  1st Qu.:1990   1st Qu.: 89.33   Class :character   Class :character  
##  Median :2000   Median :173.55   Mode  :character   Mode  :character  
##  Mean   :2000   Mean   :257.56                                        
##  3rd Qu.:2009   3rd Qu.:371.68                                        
##  Max.   :2019   Max.   :817.60                                        
##  Inflation.rate     Unemployed.rate    Government.debt    Total.Investment  
##  Length:40          Length:40          Length:40          Length:40         
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
## 
#Formatting Data
a<- gsub("%","",dx$GDP.growth)
gdpGrowth<- as.numeric(a)
#visualization
v <- dx %>% 
  ggplot(aes(Year, gdpGrowth)) +
  geom_line(color="navy") + geom_point()+
  transition_reveal(Year) + # adding animation 
  ease_aes('linear') +
  theme_classic()+
  labs(title= "Bangladesh Annual GDP Growth Rate, 1980-2020", subtitle="From BD_economic_indicator dataset" )
v

Interpretation

# This graph provides useful insights into Bangladesh's economic growth trajectory over the past four decades. It shows that after volatility in the early years, GDP expansion began to steadily increase from the late 1990s onward as the country implemented pro-market reforms and further opened up to global trade. Growth accelerated further in the 2000s, reaching a peak above 8% by the mid-2000s, suggesting these reforms were bearing fruit in attracting investment and expanding trade. While the global financial crisis caused a temporary downturn, Bangladesh bounced back fairly quickly, highlighting the growing resilience of its economy. Notably, average annual growth has exceeded 5% throughout the period depicted, demonstrating Bangladesh's impressive transformation into a rapidly developing, lower-middle income nation through consistent high growth. This upward trend, coupled with brief dips followed by swift recoveries, affirms that Bangladesh's economy became more robust at sustaining expansion in challenging times.

GDP Growth Vs Inflation(Interactive)

#data formatting 
a<- gsub("%","",dx$GDP.growth)
GDP_Growth<- as.numeric(a)
b<- gsub("%","",dx$Inflation.rate)
Inflation<- as.numeric(b)
#visualization
v <- dx %>%
  ggplot(aes(Year)) +
  geom_line(aes(y = GDP_Growth, color = "GDP Growth"), size = 0.23) +
  geom_line(aes(y = Inflation, color = "Inflation"), size = 0.23) +
  scale_color_manual(values = c("GDP Growth" = "navy", "Inflation" = "red")) +
  labs(title = "GDP Growth Vs Inflation",subtitle="From BD_economic_indicator dataset", x = "Year", y = "Rate %") +
  theme_classic() +
  labs(color = "Indicator") +
  theme(legend.title = element_text("Indicator"))

ggplotly(v)

Interpretation

#The graph shows that GDP growth and inflation have been generally positively correlated in Bangladesh over the past 30 years. This means that when GDP growth has been higher, inflation has also been higher, and vice versa. However, from 2010 to 2020, GDP growth remained steady while inflation declined.

#This relationship is not surprising, as it is consistent with economic theory. When the economy is growing rapidly, there is more demand for goods and services, which can lead to higher prices. Additionally, businesses are more likely to invest and expand when the economy is growing, which can also lead to higher prices. But over the past decade, successful economic policies allowed the Bangladeshi government to tame inflation

Relationship Between PerCapitaIncome & Life Expectency(Animated)

library(gapminder)
baseplot <- gapminder %>% 
  ggplot(aes(gdpPercap, lifeExp, size = pop, color = continent)) +
  geom_point() +
  # axis transformations 
  scale_x_log10() +
  theme_classic()

Adding Animation

Anim_plt = baseplot +
  transition_time(year) +
  labs(subtitle = "Year: {frame_time}")

Anim_plt

Interpretation

#In general, as countries get wealthier (higher GDP per capita), life expectancy also increases.The above animated visualization validates this claim as we can see that both per capita income & life expectancy highest in Europe and Lowest in Africa    


#However, Over time, the global trend has been upwards - both GDP per capita and life expectancy have increased on average across the continents. This reflects economic growth and improvements in health/medicine globally.