Taxes, Health, GDP: Understanding the Connection

Author

Fanny Iff, Rodrigo Koller Castillo, Steve Marchello, Dominic Niemand

Published

November 19, 2023

1. Introduction

1.1 Overview and Motivations

Health has become a major concern in the past years, with lots of new resources and information available nowadays. More than ever, we are confronted everyday with choices to be made whether buying drinks or buying food for lunch. Furthermore, the variety of this type of product has exploded and has been growing for many years and this is not going to stop in a society that pushes consumption and opulence. We have a rough idea of what is “healthy” and what is “unhealthy”, but can we see patterns across countries?

As far as our personal motivations behind this research, is our shared interest in health from various aspects such as sports performance or just having a healthy lifestyle to better our lives. This merged with our current curriculum in HEC makes our team motivated to find economic links to health in various sectors.

Past papers have been written linking an individual’s health to his personal wealth, and the possible correlation these two have onto each other:

https://www.sciencedirect.com/science/article/pii/S0167629603000596 https://core.ac.uk/download/pdf/158607349.pdf

With this project we want to focus on the efforts carried by governments, the policies countries have and the impact these have on the individual. One would think that the more prosperous a country, the healthier than said country would be. This however does not seem to be the case, the United States serves as an example of this contradiction: obesity rates just like their GDP are higher than ever. We want to know what policies have an effect on the wellbeing of the individuals as well as understanding the aftermath of such political measures.

2. Research questions

1. How do taxes on sweet beverages impact the overall health of a country? Is it effective?

2. How do tobacco taxes affect the health of a country? Is taxation on tobacco prolific in correcting consumer behavior?

3. How do financial inequalities compare to health across countries? What are the social and economic consequences?

3. Data Wrangling

3.1 Where did we find our data

To have our base data, we had to go on different website to create one with all the information that we wanted. The main websites where we find what we wanted are :

3.2 Generic Data

In the pursuit of addressing various research questions, a comprehensive collection of generic data has been meticulously curated. This dataset serves as the foundational bedrock upon which the analytical framework is constructed. The data, carefully gathered, encapsulates a diverse spectrum of information, poised to unravel insights and patterns relevant to the research queries at hand. Through leveraging this rich repository of information, the exploration and subsequent analysis aim to extract meaningful narratives, uncover correlations, and ultimately contribute to a nuanced understanding of the underlying phenomena. The robustness of the collected data underscores its significance as a strategic asset in navigating the complex terrain of data science, offering a conduit to derive actionable intelligence and illuminate the intricacies inherent in the research landscape.

3.2.1 Life Expectancy

As we will be working with health data and trying to establish links between various factors and good health, life expectancy at birth (independently of infant mortality) is an essential indicator, as this article shows. However, this article also warns us about the limitations of interpreting this measure, so it will have to be coupled with other data to enable it to be an objective health indicator. We found a raw dataset, where both male and female were separated. Our analysis will be independent of the sex, so we required only one column representing the whole population. We had to use the mutate function to calculate the average life expectancy independently of the sex of the individual. Then, we removed the unnecessary columns to keep only the country, the period and the life expectancy for each observations. Finally, we wanted to check whether the quantity of data was sufficient, both in terms of the number of years available and the number of countries included. We used the function dfSummary of the package summarytools to get a good overview of our data. We therefore have data for 255 countries/regions over a 71-year period from 1950 to 2021.

TABLE 1.1: Dataset cleaned for the life expectancy
Country Period Life_Expectancy
Afghanistan 1950 27.8
Code
# Raw Data Importation
df_Life_Expectancy_Final <- read.csv(here::here("Data/Life_Expectancy_Final.csv"))

#3. Clean the data of the Life expectancy (df_Life_Expectancy_Final)
#3.1 Keep only the necessary columns
df_Life_Expectancy_Final <- df_Life_Expectancy_Final[,c(1,3,4,5)]
#3.2 Suppress the sex distinction
df_Life_Expectancy_Final <- df_Life_Expectancy_Final %>%
  mutate(final_value = (df_Life_Expectancy_Final$Life.expectancy...Sex..male...Age..at.birth...Variant..estimates + df_Life_Expectancy_Final$Life.expectancy...Sex..female...Age..at.birth...Variant..estimates) / 2)
df_Life_Expectancy_Final <- df_Life_Expectancy_Final[,c(1,2,5)]
#3.3 Rename the columns
colnames(df_Life_Expectancy_Final)[c(1,2,3)] <- c("Country","Period", "Life_Expectancy")
#3.4 change value of life expectancy to numerical ones
df_Life_Expectancy_Final[, 3] <- lapply(df_Life_Expectancy_Final[, 3], as.numeric)
#3.5 Supress potential missing values in our data
df_Life_Expectancy_Final <- subset(df_Life_Expectancy_Final, !is.na(Life_Expectancy))
#3.6 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Life_Expectancy_Final)
#print(df_summary)

3.2.2 Population

For various calculations, we will need to know the population of a country for a specific year. Additionally, we may choose to filter our data based on population to mitigate the impact of certain countries that are clear outliers due to their unique characteristics and very low population. We found a raw dataset that give us data about country name, its population and the year of the observation. We had to change the separation marks for the importation because of the characteristic of the .css files, using the parameter ” sep= “;” ” in the read() function so the file can be read correctly. To clean it, we first put all the years in the same column and all the population in another one with pivot_longer() function. The year, for some reason, had an X in front of them, so we had to remove it with the function gather(). We also had to convert the population to a numeric value. Finally we also removed the possible missing values. To check the state of our data we also used the dfSummary() function. We therefore have data for … countries/regions over a …-year period from … to ….

TABLE 1.2: Dataset cleaned of the population by country
Country Period Population
Aruba 1960 54608
Code
# Raw Data Importation
df_PopByYear <- read.csv(here::here("Data/Pop.csv"))

#1. df_PopByYear
#1.1 Keep only the necessary columns
df_PopByYear <- df_PopByYear[, -c(2,3,4)]
#1.2 Pivoting the data to get the year as row value in a column named Period
#1.2.1 Use the gather function to pivot the data as long
df_PopByYear <- gather(df_PopByYear, key = "Period", value = "Population", -Country.Name)
#1.2.2 Removing the undesired character in the year
df_PopByYear$Period <- gsub("X", "", df_PopByYear$Period)
#1.2.3 Removing potential missing value
df_PopByYear <- subset(df_PopByYear, !is.na(Population))
#1.2.4 Convert the population & Period as numeric number
df_PopByYear$Population <- as.numeric(df_PopByYear$Population, na.rm = TRUE)
df_PopByYear$Period <- as.numeric(df_PopByYear$Period, na.rm = TRUE)
#1.2.5 Rename the name of the column Country.Name to Country
colnames(df_PopByYear)[1] <- "Country"
#1.2.6 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_PopByYear)
print(df_summary)

3.2.3 GDP

::: {.justify}

The GDP is an indispensable economic measure, being correlated both with the health of a population and with inequality within that same population. It would have been impossible not to include it in our research. Despite its imperfections, this indicator has the advantage of providing precise data for numerous countries and geographic areas, as well as across a broad temporal spectrum. In the realm of economic analysis and data science, GDP serves as a valuable metric due to its ability to offer insights into the economic well-being of a region and its population. Its widespread availability and historical data make it a robust tool for examining trends and patterns over time. While acknowledging its limitations, the inclusion of GDP in our research allows for a comprehensive understanding of the socio-economic landscape. we found a raw dataset that show a wide amount of GDP value by country and by year of observation. The cleaning step are almost the same as population raw data set in point 3.2.2

TABLE 1.3: Dataset cleaned of the GDP by country
Country Period GDP_by_head
2 Africa Eastern and Southern 1960 162
Code
# Raw Data Importation
df_GDP <- read.csv(here::here("Data/GDP_Final.csv"), sep=";")

#2. df_GDP
#2.1 Keep only the necessary columns
df_GDP <- df_GDP[,-c(2:4)]
#2.2 Rename the column country
colnames(df_GDP)[1] <- "Country"
#2.3 Use the gather function to pivot the data as long to remove the year as column 
df_GDP <- gather(df_GDP, key = "Period", value = "GDP_by_head", -Country)
#2.4 Put the value of GDB by head as numeric ones
df_GDP$GDP_by_head <- as.numeric(gsub(",", ".", df_GDP$GDP_by_head))
#2.5 Removing potential missing value
df_GDP <- df_GDP[!is.na(df_GDP$GDP_by_head), ]
#2.6 Use the gsub function to remove the X before the year in the column period
df_GDP$Period <- gsub("X", "", df_GDP$Period)
#2.7 Use the gsub function to remove the X before the year in the column period
df_GDP$GDP_by_head <- round(df_GDP$GDP_by_head, digits = 0)
#2.8 Suppress potential missing values in our data
df_GDP$Period <- as.numeric(df_GDP$Period, na.rm = TRUE)
#2.9 Change Period as numeric
df_GDP <- subset(df_GDP, !is.na(df_GDP))
#2.10 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Life_Expectancy_Final)
print(df_summary)

3.2.4 Health expenditure

Corriger selon data import de Fanny

As one can easily imagine, the health status of a country can be strongly linked to its level of health expenditure, our assumption was confirmed by this study. We have managed to obtain data that indicates the level of health expenditure as a percentage of the Gross Domestic Product (GDP), providing objectivity to this information and facilitating comparisons between countries. Moreover, we have observations spanning an extensive duration and covering a substantial number of countries.

TABLE 1.4: Dataset cleaned of the Health expense by country
Country Period Health_Expenditure
10642 Africa Eastern and Southern 2000 5.666276
Code
# Raw Data Importation
df_Health_Expense_By_Country <- read.csv(here::here("Data/Health_Expense_By_Country.csv"),sep=";")

#5. df_Health_Expense
#5.1 Keep only the necessary columns
df_Health_Expense_By_Country <- df_Health_Expense_By_Country[,-c(2:4)]
#5.2 Rename the column country
colnames(df_Health_Expense_By_Country)[1] <- "Country"
#5.3 Use the gather function to pivot the data as long to remove the year as column 
df_Health_Expense_By_Country <- gather(df_Health_Expense_By_Country, key = "Period", value = "Health_Expenditure", -Country)
#5.4 Use the gsub function to remove the X before the year in the column period
df_Health_Expense_By_Country$Period <- gsub("X", "", df_Health_Expense_By_Country$Period)
#5.5 Put the value of Health expense as numeric ones
df_Health_Expense_By_Country$Health_Expenditure <- as.numeric(gsub(",", ".", df_Health_Expense_By_Country$Health_Expenditure))
#5.6 Removing potential missing value
df_Health_Expense_By_Country <- subset(df_Health_Expense_By_Country, !is.na(Health_Expenditure))
#5.7 Change the Period as numeric
df_Health_Expense_By_Country$Period <- as.numeric(df_Health_Expense_By_Country$Period, na.rm = TRUE)
#5.8 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Health_Expense_By_Country)
print(df_summary)

3.2.5 Share of population with cancer

To address our various questions, it was essential to delve into the 21st-century scourge: cancer. To validate our hypotheses regarding the potential link between cancer and sugar consumption, we found an article presenting multiple pieces of evidence suggesting causal connections. Subsequently, we aimed to confirm the existence of causality between tobacco consumption and cancer in a population. For this purpose, we found an article that also outlines the various impacts this link can have on public health.

So we wanted a dataset revealing cancer rates across different countries. This data set show us the share of population with cancer in %, by country and by year. The dataset was relatively clean and did not require much effort to be redefined according to our various needs. We simply removed columns that were not of interest, renamed the remaining ones, ensured there were no missing data, and also converted our cancer rate into numeric values.

TABLE 1.5: Dataset cleaned for the share of population with cancer
Country Period Percentage_Cancer
Afghanistan 1990 9.494158
Code
# Raw Data Importation
df_Share_of_population_with_cancer <- read.csv(here::here("Data/Share-of-population-with-cancer.csv"))

#8. Clean the data of the Share population with cancer (df_Share_of_population_with_cancer)
  #8.1 Keep only the necessary columns
    df_Share_of_population_with_cancer <- df_Share_of_population_with_cancer[,c(1,3,4)]
  #8.2 change value of Malnutrition death rate to numerical ones
    df_Share_of_population_with_cancer[, 3] <- lapply(df_Share_of_population_with_cancer[, 3], as.numeric)
  #8.3 Supress potential missing values in our data
    df_Share_of_population_with_cancer <- subset(df_Share_of_population_with_cancer, !is.na(df_Share_of_population_with_cancer))
  #8.4 Rename the columns
    colnames(df_Share_of_population_with_cancer)[c(1,2,3)] <- c("Country", "Period", "Percentage_Cancer")

3.2.6 Rate of the infantile mortality

The infantile mortality can be linked to the health of a country’s population, it’s what we funded in this article. This article is trying to link various health factor(for example nutrition) to the child mortality. As before, we selected the columns of interest and rename them, change our value column as a numerical one and remove potential NA values.

TABLE 1.6: Dataset cleaned for the infantile death rate
Country Period Infantile_Mortality
Afghanistan 1957 37.59054
Code
# Raw Data Importation
df_Child_Mortality_Rate <- read.csv(here::here("Data/Child-mortality-rate.csv"))

#4. df_Child_Mortality_Rate
#4.1 Keep only the necessary columns
df_Child_Mortality_Rate <- df_Child_Mortality_Rate[,c(1,3,4)]
#4.2 Rename the columns
colnames(df_Child_Mortality_Rate)[c(1,2,3)] <- c("Country", "Period", "Infantile_Mortality")
#4.3 change value of life expectancy to numerical ones
df_Child_Mortality_Rate[, 3] <- lapply(df_Child_Mortality_Rate[, 3], as.numeric)
#4.4 Suppress potential missing values in our data
df_Child_Mortality_Rate <- subset(df_Child_Mortality_Rate, !is.na(df_Child_Mortality_Rate))
#4.5 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Child_Mortality_Rate)
print(df_summary)

3.2.7 Probability of dying from a Non-Communicable disease (NCD)

The Non-Communicable Diseases (NCDs) such as respiratory or cardiovascular one, prove to be a particularly interesting health indicator, as demonstrated by this WHO article. Therefore, we chose to include them to provide yet another perspective on health in addition to data such as life expectancy, which remains relatively incomplete, as previously explained. We successfully found a comprehensive raw dataset containing information on the probability of dying from a Non-Communicable Disease per country and per year. Our data is stratified by gender, but since our analysis does not focus on this dimension, we decided to retain the average value. Subsequently, we performed our usual data cleaning operations.

TABLE 1.7: Dataset cleaned for the probability of dying from a NCD
Country Period Prob_Dying_NCD
Chile 2019 10.04
Code
# Raw Data Importation
df_NCD_mortality_rate <- read.csv(here::here("Data/Age-standardized_NCD_mortality_rate.csv"))

#4. Clean the data of the probability of dying from a Non-Communicable disease [NCD] (df_Proba_Of_Dying_From_NCD)
  #4.1 Keep only the necessary columns
    df_Proba_Of_Dying_From_NCD <- df_Proba_Of_Dying_From_NCD[,c(8,10,13,24)]
  #4.2 Keep only the necessary rows (both sexes,to remove the sex distinction)
    df_Proba_Of_Dying_From_NCD <- df_Proba_Of_Dying_From_NCD[df_Proba_Of_Dying_From_NCD$Dim1 == "Both sexes",]
    df_Proba_Of_Dying_From_NCD <- df_Proba_Of_Dying_From_NCD[,c(1,2,4)]
  #4.3 change value of diabetes death rate to numerical ones
    df_Proba_Of_Dying_From_NCD[, 3] <- lapply(df_Proba_Of_Dying_From_NCD[, 3], as.numeric)
  #4.4 Suppress potential missing values in our data
    df_Proba_Of_Dying_From_NCD <- subset(df_Proba_Of_Dying_From_NCD, !is.na(df_Proba_Of_Dying_From_NCD))   
  #4.5 Rename the columns
    colnames(df_Proba_Of_Dying_From_NCD)[c(1,2,3)] <- c("Country", "Period", "Prob_Dying_NCD")

3.2.8 The merged generic data dataset

Finally we selected every dataset containing generic data and merged them all together to have our final base dataset. Since we named every column the same way, the command merge did what we wanted. Some final changes have been made like modifying the values of the death due to obesity and high blood pressure in rates instead of absolute value. Also, we removed the NA values that were present. These values came from the fact that GDP or Health expenditure data wasn’t collected every year in some countries. We also needed to calculate 2 new variables, as all of our death rate is in ‰ we transformed the absolute value of death number for High blood Pressure and obesity to rate value ‰. We will use this dataset as a reference for our research questions, we will compute local merge to addition the required data to our analysis and EDA, this strategy has been implemented to guarantee that we don’t loose information because of the different range of date and country our our specific data. To present our data dynamically we choose the function datatable() from the package DT, to allow readers to browse our generic data.

Code
#####################################
## Merging the dataframes together ##
#####################################
#8. Merging the dataframe together
list_df <- list(df_GDP, df_Life_Expectancy_Final, df_Child_Mortality_Rate, df_Health_Expense_By_Country, df_Proba_Of_Dying_From_NCD, df_Share_of_population_with_cancer)
df_merged <- Reduce(function(x, y) merge(x, y, by = c("Country", "Period"), all = TRUE), list_df)
df_merged <- merge(x=df_merged,y=df_PopByYear,by=c("Country","Period"))
#9. Adding a primary key
df_merged[10] <- paste(df_merged$Country, df_merged$Period, sep = ".")
colnames(df_merged)[10] <- "Country.Period"

#10. Remove the rows where there's NA
df_merged <- na.omit(df_merged)

#11. Creating 4 classes based on the GPD level by country
df_merged <- df_merged[order(df_merged$Period, df_merged$GDP_by_head), ]
df_merged <- df_merged %>%
  group_by(Period) %>%
  mutate(Class_GDP = ntile(GDP_by_head, 4))
df_merged <- df_merged %>%
  mutate(Class_GDP = case_when(
    Class_GDP == 1 ~ "Low Income",
    Class_GDP == 2 ~ "Medium-Low Income",
    Class_GDP == 3 ~ "Medium-High Income",
    Class_GDP == 4 ~ "High Income"
  ))

#12. Reorder df_merged
df_merged <- df_merged %>%
  select(1,2,10,9,3,11,4,5,6,7,8)

#13. Checking any issues
summary(df_merged)
df_merged$Period <- as.numeric(df_merged$Period)
summary(df_merged)

#14 Create a dynamic table to present our data
#14.1 Round all our value for aesthetic purpose of presentation
df_merge <- round_numeric_columns(df=df_merge)

#14.2 Use the function datatable to create a dynamic table of data
DynamicDataTableGenericData <- datatable(df_merge, options = list(pageLength = 5))

3.3 Specific data for question 1

3.3.1 Taxes about sweetened beverages

For our first research question, we needed the data of countries which have implemented or not taxes on sweetened beverages. We found a raw dataset set which indicates whether a country has implemented taxes or not. We have data for 3 different years : 2017, 2019 and 2021. But we also added the additional year of 2013 as the first implementation of taxes on sweetened beverages started in 2014. The year 2013 adds value to our regression as no country has yet implemented any kind of tax.To do so, we used a for loop too had for each unique country in our data set the value 0 for the tax for the year 2013. Then, we had to filter our data to remove missing values, such as “No response” or “Don’t know”. We also change our value of taxes from “Yes” and “No” to boolean values such as 1 for “Yes” and 0 for other values (that is all “No”). Our work was not finished, we wanted to use the package map to display interactive maps, and match our country name to the country name of the package map. This is because our raw data didn’t use the normalized names. We found it unfortunate to have a relatively small dataset in terms of the temporal dimension. However, given that this tax is relatively new, we had to settle for what was available. In the clean dataset, we can observe 179 country and as we discuss have only 4 times observations which is 2013, 2017, 2019, 2021. The spread of our data is going to constraint our future analysis for question 1. So if we wanted to analyse data for question 1 we will absolutely need value for those years.

TABLE 1.8: Dataset cleaned for the taxes on sweetened beverages by country
Country Period Tax_Sweetened_beverages
Algeria 2021 0
Code
# Raw Data Importation
df_Tax_Sweetened_Beverages<- read.csv(here::here("Data/Existence_Of_tax_on_sugar-sweetened_beverages.csv"))

#6. df_Tax_Sweetened_Beverages
#6.1 Keep only the necessary columns
df_Tax_Sweetened_Beverages <- df_Tax_Sweetened_Beverages[,c(8,10,30)]
#6.2 Keep only the necessary rows, Filtering the data that contain the value "Don't know" or "No response"
df_intermediate <- filter(df_Tax_Sweetened_Beverages,df_Tax_Sweetened_Beverages$Value =="Don't know"| df_Tax_Sweetened_Beverages$Value =="No response")
df_Tax_Sweetened_Beverages <- anti_join(df_Tax_Sweetened_Beverages, df_intermediate, by = "Location")
#6.3 Add the values for the year 2013
#6.3.1 Create a vector that contain each country present in the data
unique_vect <- unique(df_Tax_Sweetened_Beverages$Location) 
#6.3.2 Loop to add the tax on sweetened beverage for each country
for (i in unique_vect) { 
  nouvelle_ligne <- data.frame(
    Location = i,
    Period = 2013,
    Value = "No")
  df_Tax_Sweetened_Beverages <- rbind(df_Tax_Sweetened_Beverages, nouvelle_ligne)
}
#6.4 Rename the columns
colnames(df_Tax_Sweetened_Beverages)[c(1,2,3)] <- c("Country", "Period", "Tax_Sweetened_beverages")
#6.5 Put boolean variables (if there's a tax -> 1 , if not -> 0)
df_Tax_Sweetened_Beverages$Tax_Sweetened_beverages <- ifelse(df_Tax_Sweetened_Beverages$Tax_Sweetened_beverages == "Yes", 1, 0)
#6.6 Change the country name to match the package map name's country
df_Tax_Sweetened_Beverages <- df_Tax_Sweetened_Beverages %>%
  mutate(
    Country = case_when(
      Country == "Russian Federation" ~ "Russia",
      Country == "Bolivia (Plurinational State of)" ~ "Bolivia",
      Country == "Venezuela (Bolivarian Republic of)" ~ "Venezuela",
      Country == "United Republic of Tanzania" ~ "Tanzania",
      Country == "United States of America" ~ "USA",
      Country == "United Kingdom of Great Britain and Northern Ireland" ~ "UK:Great Britain",
      Country == "Türkiye" ~ "Turkey",
      Country == "Democratic People's Republic of Korea" ~ "North Korea",
      Country == "Republic of Korea" ~ "South Korea",
      Country == "Côte d’Ivoire" ~ "Ivory Coast",
      Country == "Viet Nam" ~ "Vietnam",
      Country == "Iran (Islamic Republic of)" ~ "Iran",
      Country == "Czechia" ~ "Czech Republic",
      Country == "Republic of Moldova" ~ "Moldova",
      TRUE ~ Country
    )
  )
#6.7 Removing potential missing value
df_Tax_Sweetened_Beverages <- subset(df_Tax_Sweetened_Beverages, !is.na(df_Tax_Sweetened_Beverages))
#6.8 Change the Period as numeric
df_Tax_Sweetened_Beverages$Period <- as.numeric(df_Tax_Sweetened_Beverages$Period, na.rm = TRUE)
#6.9 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Tax_Sweetened_Beverages)
print(df_summary)

3.3.2 Number of deaths by risk factor

We were interested in two main risk factors for which we found literature indicating a serious link with the consumption of sugar or, more precisely, sweetened drinks. The first factor we were interested in was related to death rates from high blood pressure. The second was obesity rates. We wanted to have these two factors over several periods and for a wide range of geographical areas. We managed to find a raw dataset that contained numerous risk factors for several years and in many countries. Our main concern was that our data was in absolute numbers of deaths. So we would need the population of each country and also by date to be able to calculate a mortality rate and not bias our results because countries have different population sizes. To clean up the data of interest, we eliminated the columns that did not provide any information for our research questions. We then renamed the columns we had selected, with the colnames function. Then, by adding two operations, we ensured that our data were numerical values (necessary for future calculations) and were rounded to the nearest unit. We also made sure that there were no missing values, to drop this potential missing, we use the is.na() function. Finally, we wanted to check whether the quantity of data was sufficient, both in terms of the number of years available and the number of countries included. We used the function dfSummary of the package summarytools to get a good overview of our data. We therefore have data for 228 countries/regions over a 29-year period from 1990 to 2019.

TABLE 1.9: Dataset cleaned for number of deaths by risk factor
Country Period Death_Due_To_High_Blood_Pressure Death_Due_To_Obesity
Afghanistan 1990 25633.13 9517.873
Code
# Raw Data Importation
df_Number_of_deaths_by_risk_factor <- read.csv(here::here("Data/Number_of_deaths_by_risk_factor.csv"))

#1. df_Number_of_deaths_by_risk_factor
#1. Clean the data of the number of deaths by risk factor (df_Number_of_deaths_by_risk_factor)
#1.1 Keep only the necessary columns
df_Number_of_deaths_by_risk_factor <- df_Number_of_deaths_by_risk_factor[,c(1,3,4,20)]
#1.2 Rename the columns
colnames(df_Number_of_deaths_by_risk_factor)[c(1,2,3,4)] <- c("Country", "Period", "Death_Due_To_High_Blood_Pressure","Death_Due_To_Obesity")
#1.3 Removing potential missing value
df_Number_of_deaths_by_risk_factor <- subset(df_Number_of_deaths_by_risk_factor, !is.na(df_Number_of_deaths_by_risk_factor))
#1.4 Change the Period as numeric
df_Number_of_deaths_by_risk_factor$Period <- as.numeric(df_Number_of_deaths_by_risk_factor$Period, na.rm = TRUE)
#1.5 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Number_of_deaths_by_risk_factor)
print(df_summary)

3.3.3 Death rate from diabetes, malnutrition and liver disease

We wanted to have a rate encompassing several diseases linked with a poor diet and bad eating habits. First we get interested by diabetes, we found in this meta-analysis that consumption of sweetened beverages was closely related to the probability of contracting type 2 diabetes. We found a raw dataset that contain the death rate from diabetes in ‰. Firstly, we started by dropping column that wasn’t interesting for us, as always we wanted to keep data about Country,Year of the obesrvation and in this case, the death rate from diabetes. Finally, we used the function dfSummary of the package summarytools to get a good overview of our data. We therefore have data for 228 countries/regions over a 29-year period from 1990 to 2019

TABLE 1.10: Dataset cleaned for the diabetes death rate
Country Period Death_Diabetes
Afghanistan 1990 30.93
Code
# Raw Data Importation
df_Death_rate_from_diabetes <- read.csv(here::here("Data/Death-rate-from-diabetes.csv"))

#2. df_Death_rate_from_diabetes
#2.1 Keep only the necessary columns
df_Death_rate_from_diabetes <- df_Death_rate_from_diabetes[,c(1,3,4)]
#2.2 Rename the columns
colnames(df_Death_rate_from_diabetes)[c(1,2,3)] <- c("Country", "Period", "Death_Diabetes")
#2.3 Removing potential missing value
df_Death_rate_from_diabetes <- subset(df_Death_rate_from_diabetes, !is.na(df_Death_rate_from_diabetes))
#2.4 Change the Period as numeric
df_Death_rate_from_diabetes$Period <- as.numeric(df_Death_rate_from_diabetes$Period, na.rm = TRUE)
#2.5 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Death_rate_from_diabetes)
print(df_summary)

We came across “amusing” articles that showed in certain countries, mostly impoverished ones, the price of Coca-Cola or other sugary beverages could be cheaper than water. This situation might lead a population with limited means to consume sugary drinks and consequently suffer from malnutrition out of necessity. This is why data on malnutrition appeared to be of significant interest in our research. We managed to find a raw dataset that illustrates the mortality rate in ‰ due to malnutrition by country and year.

TABLE 1.11: Dataset cleaned for the malnutrition death rate
Country Period Death_Malnutrition
Afghanistan 1990 11.04
Code
# Raw Data Importation
df_Malnutrition_death_rate <- read.csv(here::here("Data/Malnutrition-death-rates.csv"))

#3. df_Malnutrition_death_rate
#3.1 Keep only the necessary columns
df_Malnutrition_death_rate <- df_Malnutrition_death_rate[,c(1,3,4)]
#3.2 Rename the columns
colnames(df_Malnutrition_death_rate)[c(1,2,3)] <- c("Country", "Period", "Death_Malnutrition")
#3.3 Removing potential missing value
df_Malnutrition_death_rate <- subset(df_Malnutrition_death_rate, !is.na(df_Malnutrition_death_rate))
#3.4 Change the Period as numeric
df_Malnutrition_death_rate$Period <- as.numeric(df_Malnutrition_death_rate$Period, na.rm = TRUE)
#3.5 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Malnutrition_death_rate)
print(df_summary)

Third and last interest data was the liver disease, we saw in a fascinating meta-analysis that the consumption of sweetened beverages could lead to serious liver disease and more precisely on fatty liver disease. So with these evidence of the existing link we can’t let out the liver disease data. We found a raw dataset that included countries data, year and mortality rate due to liver disease in ‰. This data was pretty clean and we only had to perform the same cleaning operations as before.

TABLE 1.12: Dataset cleaned for the liver disease death rate
Country Period Death_Liver_disease
Afghanistan 1990 2673
Code
# Raw Data Importation
df_Liver_Disease_death_rate <- read.csv(here::here("Data/Deaths-from-liver-disease.csv"))

#4. df_Liver_Disease_death_rate
#4.1 Keep only the necessary columns
df_Liver_Disease_death_rate <- df_Liver_Disease_death_rate[,c(1,3,4)]
#4.2 Rename the columns
colnames(df_Liver_Disease_death_rate)[c(1,2,3)] <- c("Country", "Period", "Death_Liver_disease")
#4.3 Removing potential missing value
df_Liver_Disease_death_rate <- subset(df_Liver_Disease_death_rate, !is.na(df_Liver_Disease_death_rate))
#4.4 Change the Period as numeric
df_Liver_Disease_death_rate$Period <- as.numeric(df_Liver_Disease_death_rate$Period, na.rm = TRUE)
#4.5 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Liver_Disease_death_rate)
print(df_summary)

3.3.4 Dataset for question 1 merged

For question 1 EDA and analysis, we merged our generic dataframe to all this new one. We compute some small operation to recalculate some column to get value of death in rate and not as absolute value, using the population data. Then we recreate a dynamic table to show our results

Code
#7. merging df_merged and these new dataframe
list_dfQ1 <- list(df_Number_of_deaths_by_risk_factor, df_Death_rate_from_diabetes, df_Malnutrition_death_rate, df_Liver_Disease_death_rate, df_Death_rate_from_digestive_diseases, df_Tax_Sweetened_Beverages)
df_mergedQ1 <- Reduce(function(x, y) merge(x, y, by = c("Country", "Period"), all = TRUE), list_dfQ1)
df_mergedQ1 <- merge(x=df_merged,y=df_mergedQ1,by=c("Country","Period"))

#8. remove NA value
df_mergedQ1 <- na.omit(df_mergedQ1)

#9. modify columns to have a rate rather than an absolute value for high blood pressure death and obesity death
df_mergedQ1 <- df_mergedQ1 %>%
  mutate(
    Death_Obesity = (Death_Due_To_Obesity/as.numeric(df_mergedQ1$Population)*100000),
    Death_HBP = (Death_Due_To_High_Blood_Pressure/as.numeric(df_mergedQ1$Population)*100000)
  )  %>%
  select(-Death_Due_To_Obesity, -Death_Due_To_High_Blood_Pressure)

#10 Create a dynamic table to present our data
#10.1 Round all our value for aesthetic purpose of presentation
df_mergedQ1 <- round_numeric_columns(df=df_mergedQ1)

#10.2 Use the function datatable to create a dynamic table of data
DynamicDataTableDataQ1 <- datatable(df_mergedQ1, options = list(pageLength = 5))

3.4 Specific data for question 2

3.4.1 Tobacco consumption

For our second research question we needed the data concerning the consumption of tobacco by country and its evolution by year. The raw dataset was pretty clean, we only had to remove the irrelevant columns, renames our column names, change our number of tobacco consumption to numerical value (note that here the value is in % of population) and finally discard missing values.

TABLE 1.13: Dataset cleaned for the tobacco consumption
Country Period Tobacco_Consumption
Afghanistan 2000 36.9
Code
# Raw Data Importation
df_Tobacco_Consumption <- read.csv(here::here("Data/prevalence-of-tobacco-use-sdgs.csv"))

#3. df_Tobacco_Consumption
# 3.1 Keep only necessary columns
df_Tobacco_Consumption <- df_Tobacco_Consumption[,-c(2)]
# 3.2 Rename the columns     
colnames(df_Tobacco_Consumption)[c(1,2,3)] <- c("Country", "Period","Tobacco_Consumption")
# 3.3 Removing potential missing value
df_Tobacco_Consumption <- subset(df_Tobacco_Consumption, !is.na(df_Tobacco_Consumption))
# 3.4 Change the Period as numeric
df_Tobacco_Consumption$Period <- as.numeric(df_Tobacco_Consumption$Period, na.rm = TRUE)
# 3.5 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Tobacco_Consumption)
print(df_summary)

3.4.2 Death rate due to tobacco

We also required to know tobacco’s death toll in the world. This raw dataset was also pretty clean, we computed the same operation as before, removing one column and renaming it to match our needs.

TABLE 1.14: Dataset cleaned for the death rate due to tobacco
Country Period Percentage_Death_From_Smoking
Afghanistan 1990 4.018696
Code
# Raw Data Importation
df_Death_From_Smoking_By_Country <- read.csv(here::here("Data/share-deaths-smoking.csv"))

#1. df_Death_From_Smoking_By_Country
# 1.1 Keep only necessary columns
df_Death_From_Smoking_By_Country <- df_Death_From_Smoking_By_Country[,-c(2)]
# 1.2 Rename the columns
colnames(df_Death_From_Smoking_By_Country)[c(1,2,3)] <- c("Country", "Period", "Percentage_Death_From_Smoking")
# 1.3 Removing potential missing value
df_Tax_Sweetened_Beverages <- subset(df_Tax_Sweetened_Beverages, !is.na(df_Tax_Sweetened_Beverages))
# 1.4 Change the Period as numeric
df_Death_From_Smoking_By_Country$Period <- as.numeric(df_Death_From_Smoking_By_Country$Period, na.rm = TRUE)
# 1.5 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Death_From_Smoking_By_Country)
print(df_summary)

3.4.3 Taxes on tobacco

Our question relies mainly on the tax’s potential effect on our different factors. So we also needed the data regarding tax on tobacco products. In the end we have a column containing the tax force by country. A number going from 1 to 5 which indicates the importance of this tax. 1 is less than 10% tax, 2 is between 10 to 25%. 3 is from 26 to 50%,4 is from 51 to 75%,and 5 is for taxes above 75%. The raw dataset were also pretty clean, we only computed simple operations to transform them as we wanted.

TABLE 1.15: Dataset cleaned for the taxes on tobacco
Country Period Percentage_Death_From_Smoking
Afghanistan 1990 4.018696
Code
# Raw Data Importation
df_Tax_On_Tobacco <- read.csv(here::here("Data/share-of-tobacco-retail-price-that-is-tax.csv"))

#2. df_Tax_On_Tobacco
# 2.1 Keep only necessary columns
df_Tax_On_Tobacco <- df_Tax_On_Tobacco[,-c(2)]
# 2.2 Rename the columns  
colnames(df_Tax_On_Tobacco)[c(1,2,3)] <- c("Country", "Period","Taxes_On_Tobacco")
# 2.3 Removing potential missing value
df_Tax_On_Tobacco <- subset(df_Tax_On_Tobacco, !is.na(df_Tax_On_Tobacco))
# 2.4 Change the Period as numeric
df_Tax_On_Tobacco$Period <- as.numeric(df_Tax_On_Tobacco$Period, na.rm = TRUE)
# 2.5 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Tax_On_Tobacco)
print(df_summary)

3.4.4 Banning advertising on tobacco

To add a control variable and another dimension to our analysis we choose to include the data about the banning of tobacco advertisements. The raw dataset was a bit more disorganised, we had to change all our column names, proceed to a pivot longer to have our year as row attributed in a new column period. Finally, we removed all the lacking values.

TABLE 1.16: Dataset cleaned for the advertising banning on tobacco
Country Period Advertising_Banned
Afghanistan 2020 No
Code
# Raw Data Importation
df_Banning_Advertising_On_Tobacco <- read.csv(here::here("Data/Banning_Advertising_OnTobacco.csv"))

#4. df_Banning_Advertising_On_Tobacco
#4.1 Renaming the columns
colnames(df_Banning_Advertising_On_Tobacco) <- c("Country", "2020", "2018", "2016")
#4.2 Pivot longer to have our year by row in a new column Period  
df_Banning_Advertising_On_Tobacco <- pivot_longer(df_Banning_Advertising_On_Tobacco, cols = starts_with("20"), names_to = "Period", values_to = "Advertising_Banned")
#4.3 changing Period as numeric
df_Banning_Advertising_On_Tobacco$Period <- as.numeric(df_Banning_Advertising_On_Tobacco$Period) 
#4.4 Removing value with no interest for us
df_Banning_Advertising_On_Tobacco <- df_Banning_Advertising_On_Tobacco %>% 
  filter(df_Banning_Advertising_On_Tobacco$Advertising_Banned != "Answer not provided" & df_Banning_Advertising_On_Tobacco$Advertising_Banned != "Report not provided" )
#4.5 Removing potential missing value
df_Banning_Advertising_On_Tobacco <- subset(df_Banning_Advertising_On_Tobacco, !is.na(df_Banning_Advertising_On_Tobacco))
#4.6 Change the Period as numeric
df_Banning_Advertising_On_Tobacco$Period <- as.numeric(df_Banning_Advertising_On_Tobacco$Period, na.rm = TRUE)
#4.7 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Banning_Advertising_On_Tobacco)
print(df_summary)

3.4.5 Dataset for question 2 merged

As for the first research question, we merged our new data to the generic ones, to use this as a data base for the EDA and Analysis for question 2. We also reuse the function datatable to show dynamic results

Code
# Raw Data Importation
df_Banning_Advertising_On_Tobacco <- read.csv(here::here("Data/Banning_Advertising_OnTobacco.csv"))

#5. merging df_merged and these new dataframe
list_dfQ2 <- list(df_Death_From_Smoking_By_Country, df_Tax_On_Tobacco, df_Tobacco_Consumption, df_Banning_Advertising_On_Tobacco)
df_mergedQ2 <- Reduce(function(x, y) merge(x, y, by = c("Country", "Period"), all = TRUE), list_dfQ2)
df_mergedQ2 <- merge(x=df_merged,y=df_mergedQ2,by=c("Country","Period"))

#6. remove NA value
df_mergedQ2 <- na.omit(df_mergedQ2)

#7 Create a dynamic table to present our data
#7.1 Round all our value for aesthetic purpose of presentation
df_mergedQ2 <- round_numeric_columns(df=df_mergedQ2)

#7.2 Use the function datatable to create a dynamic table of data
DynamicDataTableDataQ2 <- datatable(df_mergedQ2, options = list(pageLength = 5))

3.5 Specific data for question 3

3.2.10 Gini Coefficient

For our third research question, we needed an indicator representing the inequalities within a population. We choose the Gini index as it encompasses inequality through a variety of environments (income, wealth and consumption) which allows us to understand and analyse our data more thoroughly. The raw dataset was quiet messy.We first needed to remove unuseful rows. We started by deleting the first 3 rows and used the fourth as the headline for our columns. We also dropped unnecessary columns. We renamed our main columns, using the function gather to pivot our date as rows. Finally we had to remove potential missing values and transform our values for the Gini coefficient as numeric ones.

TABLE 1.17: Dataset cleaned for the advertising banning on tobacco
Country Period Gini_Index
United States 1963 37.6
Code
# Raw Data Importation
df_Gini_Index <- read.csv(here::here("Data/Gini_Index.csv"),sep=";")

#1. df_Gini_Index
#1.1 Suppress unnecessary rows
df_Gini_Index <- df_Gini_Index[-c(1, 2), ]
#1.2 Use the third line as headline
colnames(df_Gini_Index) <- as.character(unlist(df_Gini_Index[1,]))
#1.3  Keep only the necessary columns and rows
df_Gini_Index <- df_Gini_Index[-1,-c(2:4) ]
#1.5 Rename the column country
colnames(df_Gini_Index)[1] <- "Country"
#1.5 Use the gather function to pivot the data as long to remove the year as column 
df_Gini_Index <- gather(df_Gini_Index, key = "Period", value = "Gini_Index", -Country)
# 1.6 Delete all the lines that have no value
df_Gini_Index <- df_Gini_Index %>% filter(df_Gini_Index$Gini_Index != "")
#1.7 Transfrom the value as numeric ones
df_Gini_Index$Gini_Index <- as.numeric(gsub(",", ".", df_Gini_Index$Gini_Index))
#1.8 Removing potential missing value
df_Gini_Index <- subset(df_Gini_Index, !is.na(df_Gini_Index))
#1.9 Summarize our data using the package dfSummary
df_summary <- dfSummary(df_Gini_Index)
print(df_summary)

4. Exploratory Data Analysis

4.1 Exploratory Data Analysis for Generic Data

4.1.1 Generic Health data

We had to find elements to indicate health. When trying to find a good health indicator we could not find a relevant health indicator for all countries across our time periods. This is why we chose different indicators to judge the health level of a country. We choose these: Life expectancy at birth, People who contracted cancer, Death rates from malnutrition, Death rates from digestive diseases, Death rate from obesity and Child mortality. Mettre a jour

Modifier les graphique pour filtrer par date

Mettre des conclusions ici ?

We also looked at how much countries spend on healthcare.

We can clearly see the impact of COVID as health expenses exploded

What can we conclude from these graphs: Some data seems logical and is not cause of concern, for example the overall life expectancy keeps increasing even though there is a slight dip in 2020, possibly because of COVID. As people get older and the population larger the number of people with cancer keeps increasing even though at a slight decreasing tendency. Child mortality and deaths from malnutrition decreases as countries become more developed. However, two graphs are worth analysing further. First, the death of digestive diseases which has increased since 2013 at a dangerous rate. This might be due to an increase in highly processed food, fast foods and sweet beverages at the international level. Second is the obesity death rate which had a very clear drop and stabilisation as of 2005. This might be due to an increasing awareness of food consumption and increased medical attention to the issue.

4.1.2 Countries classify by GDP

Firstly, we collected data to create four separate classes based on GDP. The data stems from the World Bank and is compared through three different years to evaluate the evolution of the different countries. We ranked the four classes by quartile such as Q1 is the 25% of countries with the lowest GDP per capita. We used GDP per capita as this is a better metric to measure wealth across countries as this measures the baskets of goods one person can buy in a country compared to another one. (1) We first downloaded the CSV dataset and uploaded it on R. (2) After checking for missing values, we cleaned up the dataset to leave the countries that had values. (3) Using the function we ordered the countries in four distinct parts: Low income, Medium low income, Medium high income, High income.

Code
# Graph of the Class distribution
# Define the color palette
palette_bleus <- colorRampPalette(c("#E0F3F8", "#99C2D5", "#66A2D5", "#2C7BB6"))(4)

# Create the bar plot with adjusted colors, thicker bars, and more space
Class_Repartition <- ggplot(df_2019, aes(x = Classe, fill = Classe)) +
  geom_bar(color = "black", size = 0.5, width = 0.7) +  # Adjust width for thicker bars
  scale_fill_manual(
    values = palette_bleus,
    breaks = unique(df_2019$Classe),
    labels = unique(df_2019$Classe),
    name = "Class"  # Set the legend title
  ) +
  labs(
    title = "Distribution of country by Class for the year 2019",
    x = "Class",  # Set the x-axis label
    y = "Number of countries"
  ) +
  theme_minimal()

4.2 Exploratory Data Analysis for Question 1

4.2.1 Our data on an interactive map

We also desired to design an interactive map to visualise different data per country. Here we can see the Countries which have implemented taxes for 2017 in green and the ones which have not in red. We can also access the data of population, GDP and category of each country by clicking on it.

Code
# Data transforming
df_Tax_Sweetened_Beverages_Map <- df_merge
df_Tax_Sweetened_Beverages_Map$Tax_Sweetened_beverages <- ifelse(df_merge$Tax_Sweetened_beverages == "1", "Taxes", "No Taxes")
Tax_on_sweetened_beverages <- filter(df_Tax_Sweetened_Beverages_Map, Period == "2017") %>% arrange()

# Get data from our package
world <- ne_countries(returnclass = "sf")
#Rename the column for the merge
colnames(world)[10] <- "Country"

# Join our data
world_data <- merge(x=world,y=Tax_on_sweetened_beverages,by="Country")

# Set a color palette
color_pal <- colorFactor(c("red", "green"), domain = c("Taxes", "No Taxes"))

# Create the interactive map
inter_graph <- leaflet(world_data) %>%
  addProviderTiles(providers$OpenStreetMap.Mapnik) %>%
  addPolygons(color = ~color_pal(world_data$Tax_Sweetened_beverages),
              weight = 1,
              popup = ~paste("Country: ", name, "<br>", "Tax: ", world_data$Tax_Sweetened_beverages, "<br>", "Population: ", world_data$Population, "<br>","GDP: ", world_data$GDP, "<br>","Classe: ", world_data$Classe, "<br>"),
              highlightOptions = highlightOptions(color = "black", weight = 2, bringToFront = TRUE)) %>%
  addLegend("bottomright", pal = color_pal, values = unique(world_data$Tax_Sweetened_beverages),
            title = "Legend", opacity = 1, labels = unique(world_data$Tax_Sweetened_beverages)) %>%
  setView(lng = -39.443407, lat = 35.649315, zoom = 2.4)

4.2.2 Evolution of taxation of sweet beverages

The next graph describes the evolution of taxation of sweet beverages across countries.

The taxation started as of 2013, indicating a recent awareness of this issue. As of today, the evolution of countries that put taxes in place to regulate sweet beverages is constant with a slight increase in 2017. This allows us to legitimise this paper as to corroborate the effectiveness of such taxation in regards to health.

Ajouter qqch ?

4.2 Exploratory Data Analysis for question 2

4.2.1 Evolution of tobacco consumption

We first looked at the evolution of tobacco consumption over time. We can see a drop from 2000 to 2020 of nearly 10% with a slight plateau in 2018.

4.2.2 Evolution of deaths due to tobacco consumption

We compare the number of deaths due to tobacco consumption and the evolution of tobacco consumption over time.

4.2.3 Evolution of number of country that banned advertising

We compare the number of deaths due to tobacco consumption and the evolution of tobacco consumption over time.

4.2.4 Exploring our data with an interactive map

On this interactive map we can observe the evolution of the tax percentage on tobacco products around the world as well as compare the evolution of prices over time.

By analyzing parts of the world, we can note that Europe taxes tobacco the heaviest (>75%). America follows with on average 50%-75% taxes. Asia has on average low taxes on tobacco (25%-50%). The continent which taxes tobacco products the least is Africa.

4.3 Exploratory Data Analysis for question 3

What are the social and economic consequences? When talking about income inequalities, we often refer to the Gini or Theil index as a measure of wealth distribution across the country.

4.3.1 Gini index over the time

We find interesting to show how wide our data is in terms of time width.. develop

4.3.2 Interactive map

We also find interesting to display our data on an interactive map so we can explore our data intuitively and also seeing how much country we can find in our data.. develop

4.3.3 Gini index by class

We also wanted to approch our data with our past class design, so we ploted our different class with the gini coefficient to see if we were having something to go deeper with

4.3.4 Gini index regarding life expectancy

We also mixed the gini coefficient regarding the life expectancy to know if we were having something to dig here.

5. Analysis

In order to simplify our analysis, we had the idea to combine all our health data to create one robust indicator of health by country based on our informations. To get started, we needed to normalize our data, we started by sorting our interest columns in our main data frame and then computing the normalization. Then, we had to add weight on this indicator,as we can imagine the life expectancy of a country is probably more describing the health of the population than the Death rate form high blood pressure issue. We based our weight on some study ….. than allow us to estimate how our data was representative of the good health of a Country’s population.

A voir si possible,sinon ça dégage,demander a l’asisstant si ça fait du sens

5.1 Analysis of taxes on sweetened beverages

5.1.1 Influence of a country’s GDP on life expectancy

For us it was interesting to see how can potentially impact the GDP on life expectancy Develop..

As we can see, there is clearly a difference ….

5.1.3 Influence of a country’s GDP from dying of a NCD

We chose to look at NCDs (non-communicable diseases) as this eliminates outliers where a epidemie would have taken place. We looked at the death rates from NCDs per quartile as described in 2.1.1. We used a box plot for each country to center the observations and eliminate any outlier that could falsely alter the results.

We see a perfect correlation between GDP and deaths by NCDs. Furthermore, we can observe that the two low income groups have a higher spread in the box plot. This indicates that low income countries are more affected by different metrics as just financial means. We will explore some possible reasons later on in this paper.

5.1.4 Taxation per income level

Next we looked at the evolution of taxation between 2017 and 2019 across different income levels. This will allow us to evaluate whether the income level has an influence across time.

In 2017 both low income and high income had a similar number of countries taxing sweet beverages. As of 2019 the differences flatten with similar levels except for low income which is lower. High income had the highest jump, indicating that there was a need for this tax to be put in place in countries of high income.

5.1.5 PCA Analysis

Compléter l’analyse PCA

5.1.6 Correlation Matrix

The correlation matrix permits us to find correlation between our different variables. The color scale allows us to find the intensity of correlation or negative correlation.

First, we can confirm important theories. Correlation between Life expectancy and Infantile death rate, malnutrition death rate, deaths from NCDs are - ≥ 0.8. However the correlation is much lower between Life expectancy and Diabetes death rate where correlation is -0.4 which indicates that having diabetes is not strongly linked to a lower life expectancy. We can confirm the importance of high GDP per capita for a country’s life expectancy and deaths by NCDs. The correlation between GDP per head and Probability of dying of an NCD is -0.6. The correlation between GDP per head and Life expectancy is 0.7. This results explains that GDP per capita is responsible for a high life expectancy and a lower probability of dying of an NCD. Looking at known correlation between types of deaths we can understand some mechanics of roles of different variables. The correlation between Infantile death rate and Deaths from malnutrition is 0.7. The correlation between GDP per head and infantile death rate is -0.6. With these results we can observe that infantile death is positively correlated to the death rate of malnutrition which is negatively correlated to GDP per capita. This allows us to say that a country with a higher GDP per capita will have fewer deaths by malnutrition and thus implicating a lower infancy death rate. Finally we observe the link between obesity and deaths due to high blood pressure which is one consequence from obesity. The correlation between death rate of obesity and death rate from high blood pressure is 0.9 which confirms known consequences of obesity.

5.1.7 Predictive modeling

We built a predictive model to estimate whether a country taxes sweet beverages by regressing linearly on different health variables. We split our dataset in two, the first slice tests the predictability of the model and the second tests its robustness.

Développer….

Coefficient Std.Error Significance
(Intercept) -3.0790186 4.8319460
Life_Expectancy 0.0410254 0.0586837
Prob_Dying_NCD -0.0849888 0.0395380 *
Death_Diabetes -0.0132712 0.0090992
Death_Malnutrition 0.0174047 0.0377582
Percentage_Cancer -0.0533222 0.0793296
Death_Digestive_Diseases 0.0075996 0.0142461
Health_Expenditure -0.0933348 0.0791172
Death_Obesity 0.0365067 0.0115896 *
Death_HBP -0.0186459 0.0060864 *
Class_GDPLow Income 1.8074181 0.9256873
Class_GDPMedium-High Income 1.2447595 0.5350776 *
Class_GDPMedium-Low Income 1.8518155 0.6350692 *
Réalité Positif Négatif
Positif 3 22
Négatif 7 89

5.2 Anylsis of taxes effect on Tobacco consumption

5.2.1 Tobacco consumption compared to GDP per capita

We will now take a look at the consumption of tobacco compared to GDP per capita over three time years which are 2015, 2018 and 2020.

The two variables Tobacco consumption and GDP per capita are slightly positively correlated. However, in the data we find two outliers that might be flashing these results. Monaco and Luxembourg are two very small countries that seem to be outliers. As their population is small compared to the global population we will omit their results in order to find a clearer correlation in the world population.

When we omit Luxembourg and Monaco we find the following results:

The results do not change significantly. The correlation between the two still correlates only slightly positively. This indicates that the habit of tobacco consumption is not a function of purchasing power. We can suggest that tobacco consumption is caused by cultural and social differences between countries and not from income differences.

5.2.2 Taxation of tobacco as a function of GDP

We now look at the correlation between taxation of tobacco and GDP per head.

There is a positive correlation between these two variables in 2014 and 2018. There are no major changes between these two dates. This allows us to state that the higher the GDP per capita in a country, the higher the taxes on tobacco products.

5.2.3 Deaths from tobacco consumption to GDP Across 2014, 2018 and 2020

There is a positive correlation between Deaths from tobacco and GDP by head.

5.2.4 Correlation matrix between our variable about tobacco and health data

We decided to analyse the correlation between our variables

5.2.5 Compare mortality based on the advertising banning

We found interesting to see if there is difference on country/contient on mortality compared to the banishment of advertising

5.2.6 Compare mortality based on the taxation level

add text

then we wanted to see if there were difference in time..developp

what we can conclude ….

5.3 Anylsis of Gini coefficient

5.3.2 Correlation matrix - with Gini coefficient

5.3.3 Linear regression of the gini index

We wanted to see if our variable allow us to well predict our Gini coefficient.

term estimate std.error statistic p.value
(Intercept) 137.0900584 13.9391041 9.834926 0.0000000
Infantile_Mortality -1.3248107 0.3308274 -4.004538 0.0000759
Life_Expectancy -1.1157139 0.1699377 -6.565429 0.0000000
GDP_by_head -0.0001352 0.0000224 -6.030932 0.0000000
Percentage_Cancer -0.5370689 0.1222557 -4.392996 0.0000148
Prob_Dying_NCD -0.5912064 0.0784803 -7.533187 0.0000000
Health_Expenditure 0.4265861 0.1946372 2.191699 0.0290578

6. Discussion

6.1 Conclusion

6.2 Limitations

6.2.1 Availability and quality of Data

Securing access to comprehensive and relevant datasets proved to be a significant hurdle. Despite meticulous planning and defined project scopes, locating datasets that encompassed all necessary variables was a formidable challenge. The intricacies stemmed from data silos, disparate sources, and proprietary constraints, limiting the accessibility to a consolidated and holistic dataset.

In a landscape where the data ecosystem is often fragmented, the endeavor to aggregate, clean, and align datasets from diverse origins demanded extensive effort. Navigating through data repositories, APIs, and collaboration with data providers became imperative to bridge gaps in the availability of essential information.

Even when datasets were procured, ensuring their quality emerged as an intricate task. The inherent variability in data formats, missing values, outliers, and inconsistencies posed formidable obstacles. Robust data cleaning processes became indispensable to enhance the reliability and accuracy of subsequent analyses.

Quality assessment tools, anomaly detection algorithms, and domain-specific knowledge were leveraged to identify and rectify discrepancies within the datasets. This phase involved iterative cycles of validation, cleaning, and refinement to align the data with the requisite standards for robust analytical modeling.

6.2.2 No data on sweetened beverages consumption

The quest for information on sugary beverage consumption posed intricate hurdles, primarily stemming from the unavailability of dedicated datasets or repositories addressing this specific domain. The scarcity of centralized databases capturing detailed and up-to-date information on the consumption patterns of sugary drinks presented a substantial impediment to the research endeavor.

6.2.3 Challenges in Establishing Causality Amidst Multifactorial Dynamics

The complexities arose from the daunting task of discerning the most pertinent variables from a multitude of potential influencers, a task exacerbated by the intricate nature of the subject matter. This narrative elucidates the difficulties faced in making informed choices among a plethora of factors, a conundrum that significantly hindered the establishment of robust causal relationships.

The enormity of our analytical landscape demanded meticulous consideration of numerous factors, each purportedly wielding an influence on the phenomena under investigation. From the outset, the challenge lay in the judicious selection of variables that held substantive relevance to the research question. Despite an exhaustive review of diverse studies and an extensive exploration of the existing literature, the conundrum persisted, rendering the task of isolating salient factors a formidable endeavor.

The intricacy of the multifactorial landscape was further compounded by the dynamic nature of the data, requiring a nuanced understanding of temporal trends and contextual fluctuations. The plethora of potential confounders, moderators, and mediators introduced layers of complexity that made it arduous to disentangle the true drivers of the observed phenomena.

While literature reviews and empirical studies provided invaluable insights into the relationships among various factors, the inherent limitations of observational studies and the challenges of establishing causality in complex systems became apparent. The interplay of numerous covariates and the potential for confounding variables presented hurdles in establishing a causal link between our variables of interest.

Navigating this intricate terrain required a delicate balance between theoretical understanding, statistical rigor, and domain expertise. Despite employing sophisticated statistical techniques and leveraging advanced modeling approaches, the elusive quest for clear causal pathways persisted. Sensitivity analyses and robustness checks were conducted diligently, yet the underlying complexity of the system thwarted endeavors to isolate causal effects definitively.

  • Impossible de generalisé l’analyse
  • Conclusion abusives

6.3 Proposition for future work

  • Possibilité d’utilisé des données sur la santé dentaire pour voir si une reduction de la conso des boissons sucrée a une incidence

Reference List (“GDP per capita (current US\() | Data”) Work Cited “GDP per capita (current US\)) | Data.” World Bank Data, https://data.worldbank.org/indicator/NY.GDP.PCAP.CD. Accessed 15 November 2023.

https://www.aeaweb.org/articles?id=10.1257/jep.33.3.202

```{r child = c(‘intro.qmd’, ‘data.qmd’, ‘eda.qmd’, ‘analysis.qmd’, ‘concl.qmd’)}