library(trelliscopejs)
library(tidyverse)
library(ggplot2)
library(dslabs)
library(dplyr)
#cognostic measure of GDP per captita
gapminder_2 <- mutate(gapminder,
Gdp_per_person = cog(
val = gdp/population,
desc = "GDP per capita"
))
#create the faceted plot with lineplot to get GDP per capita compare with population by different countries
gapminder_2 %>%
filter(!is.na(population), !is.na(gdp)) %>% # leave the population/gdp with null value
ggplot(aes(x = year)) +
geom_line(aes(y = Gdp_per_person,color = "GDP per capita"),size = 2,show.legend = TRUE) +
geom_line(aes(y = population/1000000,color = "population"), size = 2,show.legend = TRUE)+
labs(y = "GDP per capita/populaion(million)") +
xlim(c(1960, 2011)) +
facet_trelliscope(~ country,
name = "gdp per capita and population changed",
desc = "gdp per capita and population changed 1960- 2020",
nrow = 2, ncol = 3,
path= ".",
self_contained = TRUE)+
scale_color_manual(values = c("green", "lightblue"),
labels = c("GDP per capita", "Population(M)"))+
theme(legend.position = "top")
The variable I graphed, GDP/population with population, is a crucial indicator of a country’s economic health. GDP per capita, in particular, provides valuable insights into the state of the economy. By examining this variable alongside population data, we can gain a deeper understanding of the economic and political environments in different countries. Through time-series analysis, I aim to uncover the narratives of these countries’ economic histories using line graphs.
As we can see, most countries with GDP per capita and population are increasing smoothly. However, in countries like Egypt, GDP per capita and population increased obviously, especially after 1974. The reason is after the 1973 wars, Egypt received significant financial aid and investments from oil-rich Gulf countries. With more global trading, the Suez Canal brings enormous revenues to Egypt’s economy. Egypt’s politicians also focus on economics rather than competition after the war.
Russia, Bulgaria, Georgia, and some other countries had a big decreasing GDP per capita from 1988 to 1998, which was influenced by the collapse of the Soviet Union.
Before 1997, Iraq’s GDP per capita increased dramatically. However, after the oil price decreased, United States sanctions were imposed, and the Iraq war began, the GDP per capita of Iraq decreased badly.
There has yet to be GDP data from 1961 to 1969 in China. The reason is the “Great Leap Forward,” “the Great Cultural Revolution,” and other civil riots and unrest. After 1991, with the “reform and opening up” policy, the GDP per capita started to rise up.