For this project I will be using data from Kaggle on “Adult Mortality Rate (2019-2021)”

adult_mort <- read.csv("Adult mortality rate (2019-2021).csv")
adult_mort%>% head(10)
##              Countries     Continent Average_Pop.thousands.people.
## 1          Afghanistan          Asia                      38947.06
## 2              Albania        Europe                       2834.57
## 3              Algeria        Africa                      43445.00
## 4               Angola        Africa                      33428.62
## 5  Antigua and Barbuda North America                         92.67
## 6            Argentina South America                      45374.74
## 7              Armenia        Europe                       2805.73
## 8            Australia     Australia                      25556.50
## 9              Austria        Europe                       8917.53
## 10          Azerbaijan        Europe                      10085.05
##    Average_GDP.M.. Average_GDP_per_capita... Average_HEXP... Development_level
## 1         17995.64                    462.05           80.53             Short
## 2         16263.16                   5737.44          420.17             Short
## 3        160325.54                   3690.31          215.53             Short
## 4         72148.29                   2158.28           61.29             Short
## 5          1509.63                  16290.97          868.60           Average
## 6        443212.28                   9767.82          985.36             Short
## 7         13374.14                   4766.73          573.12             Short
## 8       1514105.79                  59245.44         6186.68              High
## 9        453405.07                  50844.26         5778.39              High
## 10        48496.47                   4808.75          232.16             Short
##    AMR_female.per_1000_female_adults. AMR_male.per_1000_male_adults.
## 1                              204.85                         322.17
## 2                               53.54                         103.55
## 3                               70.85                         102.21
## 4                              218.03                         316.81
## 5                               58.76                         103.77
## 6                               82.87                         143.85
## 7                               76.26                         228.57
## 8                               42.02                          74.11
## 9                               40.95                          75.49
## 10                             120.13                         250.51
##    Average_CDR
## 1         7.08
## 2        10.20
## 3         4.78
## 4         7.88
## 5         6.06
## 6         8.35
## 7        11.82
## 8         6.57
## 9        10.00
## 10        6.90
Now, I want to look at the breakdown of the development levels within these countries.
adult_pie <- adult_mort %>%
  count(Development_level) %>%
  rename(Categorie = Development_level, Count = n)

fig <- plot_ly(adult_pie, labels = ~Categorie, values = ~Count, type = 'pie')
fig <- fig %>% layout(
  title = "The breakdown of Countries' development levels (2019-2021)",
  xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
  yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))

fig

The pie chart shows that more than half of the countries are still not fully developed. While the countries who are developed or have “high” development level are the smallest. These countries are mainly from Europe and North America. This raises an assumption that the country with lowest CDR will be from High developed country, while the highest from “short” or under developed.

Lets look at the countries with High and Short development levels
#high
adult_mort %>% filter(Development_level == "High") %>% head(10)
##    Countries     Continent Average_Pop.thousands.people. Average_GDP.M..
## 1  Australia     Australia                      25556.50      1514105.79
## 2    Austria        Europe                       8917.53       453405.07
## 3    Belgium        Europe                      11537.93       551810.42
## 4     Canada North America                      37944.96      1797603.40
## 5    Denmark        Europe                       5834.19       366674.81
## 6    Finland        Europe                       5530.72       278929.63
## 7     France        Europe                      67574.47      2775253.80
## 8    Germany        Europe                      83149.97      4012611.25
## 9    Iceland        Europe                        366.52        23923.12
## 10   Ireland        Europe                       4984.30       443119.01
##    Average_GDP_per_capita... Average_HEXP... Development_level
## 1                   59245.44         6186.68              High
## 2                   50844.26         5778.39              High
## 3                   47825.79         5277.94              High
## 4                   47373.96         5963.91              High
## 5                   62849.35         6627.81              High
## 6                   50432.77         4894.77              High
## 7                   41069.56         4880.27              High
## 8                   48257.52         6016.41              High
## 9                   65271.81         6077.78              High
## 10                  88903.04         6108.42              High
##    AMR_female.per_1000_female_adults. AMR_male.per_1000_male_adults.
## 1                               42.02                          74.11
## 2                               40.95                          75.49
## 3                               47.33                          80.24
## 4                               51.68                          88.18
## 5                               43.94                          71.35
## 6                               42.81                          88.87
## 7                               46.95                          92.35
## 8                               46.39                          84.31
## 9                               43.93                          65.15
## 10                              42.45                          69.46
##    Average_CDR
## 1         6.57
## 2        10.00
## 3        10.07
## 4         7.83
## 5         9.50
## 6        10.07
## 7         9.57
## 8        11.83
## 9         6.30
## 10        6.47
#short
adult_mort %>% filter(Development_level == "Short") %>% head(10)
##      Countries     Continent Average_Pop.thousands.people. Average_GDP.M..
## 1  Afghanistan          Asia                      38947.06        17995.64
## 2      Albania        Europe                       2834.57        16263.16
## 3      Algeria        Africa                      43445.00       160325.54
## 4       Angola        Africa                      33428.62        72148.29
## 5    Argentina South America                      45374.74       443212.28
## 6      Armenia        Europe                       2805.73        13374.14
## 7   Azerbaijan        Europe                      10085.05        48496.47
## 8   Bangladesh          Asia                     167431.14       379314.11
## 9       Belize North America                        394.68         2329.33
## 10       Benin        Africa                      12643.49        15921.69
##    Average_GDP_per_capita... Average_HEXP... Development_level
## 1                     462.05           80.53             Short
## 2                    5737.44          420.17             Short
## 3                    3690.31          215.53             Short
## 4                    2158.28           61.29             Short
## 5                    9767.82          985.36             Short
## 6                    4766.73          573.12             Short
## 7                    4808.75          232.16             Short
## 8                    2265.49           52.09             Short
## 9                    5901.78          297.75             Short
## 10                   1259.28           31.72             Short
##    AMR_female.per_1000_female_adults. AMR_male.per_1000_male_adults.
## 1                              204.85                         322.17
## 2                               53.54                         103.55
## 3                               70.85                         102.21
## 4                              218.03                         316.81
## 5                               82.87                         143.85
## 6                               76.26                         228.57
## 7                              120.13                         250.51
## 8                              110.96                         157.49
## 9                              129.34                         237.22
## 10                             245.11                         291.39
##    Average_CDR
## 1         7.08
## 2        10.20
## 3         4.78
## 4         7.88
## 5         8.35
## 6        11.82
## 7         6.90
## 8         5.59
## 9         5.44
## 10        9.35
I want to look at countries with lowest and highest Crude Death Rate
#high
high <- adult_mort%>%
  arrange(desc(Average_CDR))
high %>% head(7)
##   Countries Continent Average_Pop.thousands.people. Average_GDP.M..
## 1  Bulgaria    Europe                       6929.17        74410.97
## 2    Serbia    Europe                       6892.90        55984.25
## 3    Latvia    Europe                       1899.59        36224.07
## 4   Romania    Europe                      19252.99       262556.24
## 5 Lithuania    Europe                       2796.62        59322.36
## 6   Hungary    Europe                       9743.73       167840.99
## 7   Croatia    Europe                       3997.31        62942.80
##   Average_GDP_per_capita... Average_HEXP... Development_level
## 1                  10738.80          864.87           Average
## 2                   8122.02          743.51             Short
## 3                  19069.45         1464.81           Average
## 4                  13637.17          837.06           Average
## 5                  21212.16         1582.99           Average
## 6                  17225.54         1202.91           Average
## 7                  15746.29         1172.91           Average
##   AMR_female.per_1000_female_adults. AMR_male.per_1000_male_adults. Average_CDR
## 1                              98.42                         207.52       18.40
## 2                              63.14                         135.85       17.17
## 3                              84.50                         210.61       16.03
## 4                              63.76                         164.76       15.47
## 5                              77.92                         212.30       15.43
## 6                              76.77                         161.84       14.63
## 7                              43.71                         105.00       14.33
#low
low<- adult_mort %>% arrange(Average_CDR)
low%>% head(7)
##              Countries Continent Average_Pop.thousands.people. Average_GDP.M..
## 1                Qatar      Asia                       2751.95       166819.87
## 2 United Arab Emirates      Asia                       9288.03       394161.48
## 3              Bahrain      Asia                       1478.31        37526.60
## 4               Kuwait      Asia                       4350.55       126312.26
## 5         Saudi Arabia      Asia                      35924.96       813807.64
## 6             Maldives      Asia                        513.47         4916.58
## 7                 Oman      Asia                       4555.55        83407.89
##   Average_GDP_per_capita... Average_HEXP... Development_level
## 1                  60618.75         1981.36              High
## 2                  42437.57         2185.53              High
## 3                  25384.84         1092.18           Average
## 4                  29033.61         1805.22           Average
## 5                  22652.99         1359.14           Average
## 6                   9575.25         1000.92             Short
## 7                  18309.09          825.07           Average
##   AMR_female.per_1000_female_adults. AMR_male.per_1000_male_adults. Average_CDR
## 1                              42.63                          52.76        1.17
## 2                              46.87                          69.84        1.70
## 3                              50.73                          59.78        2.24
## 4                              36.55                          69.58        2.78
## 5                              83.51                         103.07        2.81
## 6                              40.94                          55.55        2.96
## 7                              72.89                         105.23        3.01
Now I will make bar graphs on three countries from Lowest and Highest CDR, to see what their CDR look like compared to each other
high <- high  %>% slice_head(n = 3)

ggplot(high, aes(x = Countries, y = Average_CDR, fill = Countries)) +
  geom_col() +
  xlab("Country") +
  ylab("Average CDR") +
  ggtitle("Comparison of CDR for countries with the highest death rate (2019-2021") +
   scale_fill_brewer(palette = "Pastel2")  + 
  theme_minimal() 

low <- low  %>% slice_head(n = 3)

ggplot(low, aes(x = Countries, y = Average_CDR, fill = Countries)) +
  geom_col() +
  xlab("Country") +
  ylab("Average CDR") +
  ggtitle("Comparison of CDR for countries with the lowest death rate (2019-2021") +
   scale_fill_brewer(palette = "Pastel2")  + 
  theme_minimal() 

From these plot we can see that though Bulgaria and Serbia close to each other when it comes to death rate but Bulgaria is still higher. While the difference for countries with lowest CDR is quite significant, Qatar is almost half of Bahrain.

For this project I will focus on Qatar and Bulgaria, to see if their GDP have any effect on the CDR. Also, I will be observing if there is a significant difference between death rate of Women vs. Men.
low <- low  %>% slice_head(n = 3)

ggplot(low, aes(x = Countries, y = Average_GDP.M.., fill = Countries)) +
  geom_col() +
  xlab("Country") +
  ylab("Average GDP") +
  ggtitle("Comparison of GDP for countries with the lowest death rate (2019-2021") +
   scale_fill_brewer(palette = "Pastel2")  + 
  theme_minimal() 

This bar graph was intereseting to look at because though United Arab Emirates has GDP more than double of Qatar, it’s CDR is still higher than of Qatar. This might suggest that GDP has no effect on the death rate.
#Qatar vs. Bulgaria GDP

count<- adult_mort %>% filter (Countries == "Qatar" | Countries == "Bulgaria")

ggplot(count, aes(x = Countries, y = Average_GDP.M.., fill = Countries)) +
  geom_col() +
  xlab("Country") +
  ylab("Average GDP") +
  ggtitle("Comparison of GDP(2019-2021)") +
   scale_fill_brewer(palette = "Pastel2") 

This graph shows that Qatar has slightly more than double of Bulgaria’s GDP
bul_data <- read.csv("bulg_gdp_death.csv")


ggplot(bul_data) + 
  geom_line(aes(x= Year, y= GDP_currentUS, color= "GDP(in Billion US$)"), size=0.78)+ 
  geom_line(aes(x= Year, y= Death_rate_crude, color= "Crude death rate %"), size= 0.78)+
  geom_point(aes(x= Year, y= GDP_currentUS, color= "GDP(in Billion US$)"))+ 
  geom_point(aes(x= Year, y= Death_rate_crude, color= "Crude death rate %"), shape=20)+
  #xlim(2018, 2022)+
  labs(y="Values", x= "Year", 
       title= "Bulgaria: CDR vs. GDP (1980-2021)", 
       color = "Indicators") + 
  scale_color_manual(labels = c( "Crude Death Rate(%)", "GDP(in Billion US$)"),
                     values = c("blue","seagreen"))
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_line()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

As seen by the plot, we can see that there is a dis proportionality between GDP and CDR. Though, it’s important to note that the two variables are in different scales. We can still observe that while CDR remained constant from 1980 - 2021, GDP for Bulgaria was increasing significantly. Also, in 2021 both GDP and CDR increased, meaning that GDP and death rate have direct relationship. Which is not what I have hypothesized.

rates <- data.frame(
  Country = rep(c("Bulgaria", "Qatar"), each = 2),
  Gender = c("Female", "Male", "Female", "Male"),
  Mortality_Rate = c(98.4, 207.5, 42.6, 52.8) )


ggplot(rates, aes(x = Gender, y = Mortality_Rate, fill = Gender)) +
  geom_col() +
  facet_wrap(~ Country) +
  xlab("Gender") +
  ylab("Mortality Rate") +
  ggtitle("Female vs Male Average Adult Mortality Rate(per 1000) for Bulgaria and Qatar (2019-2021)") +
  theme_minimal() +
  scale_fill_manual(values = c("Female" = "lightpink", "Male" = "lightblue"))

This graph was surprising, because I expected to female mortality to be higher due to factors such as femicide, gender inequality and the unequality when it comes to medical access and health. However, for both countries adult males have higher death rate compared to female. Bulgaria’s male death rate is significantly higher of approximately 208 men per 1000.

ggplot(count, aes(x = Countries, y = Average_HEXP..., fill = Countries)) +
  geom_col() +
  xlab("Country") +
  ylab("Average HEXP") +
  ggtitle("Comparison of Health Expenditure(2019-2021)") +
   scale_fill_brewer(palette = "Set3")

In conclusion, based on the data and the plots, the higher death rate for Bulgaria might be due to health expenditure spendings and access to health care. Qatar has higher overall health expenditure spending compared to Bulgaria. Also, wanted to note that Bulgaria does not have the lowest GDP and is considered “Average” developed while Qatar is one of the highly developed countries, based on the data.