Đề bài

Chào các em Thầy gửi các em một file dữ liệu được lấy về từ địa chỉ: Global Diet Quality Project Nhiệm vụ của nhóm là tìm trong cơ sở dữ liệu của Dự án này các thông tin có thể giải thích cho kết quả được tập hợp trong file excel đính kèm. Những nhóm yếu tố có thể lưu ý bao gồm: - Drivers - Food Supply Chains - Food Environments - và Individual Factors Các em có thể sử dụng các kỹ thuật đã học để biểu diễn, khai thác và đánh giá một hay nhiều yếu tố ảnh hưởng. Lưu ý thời gian nộp bài tập là 1 ngày trước khi thi cuối kỳ. Chúc các em làm bài tốt,

PS: Một số khái niệm
* Phần trăm dân số của các quốc gia mà chưa thể có chế độ ăn khỏe mạnh với mức thu nhập 0.52 tổng thu nhập hộ gia đình *
Definition: Proportion of the population whose food budget is below the cost of a healthy diet. The food budget is defined as 52% of household income, based on the average share of income that households in low-income countries spend on food. Income data are provided by the World Bank’s Poverty and Inequality Platform. A value of zero indicates a null or a small number rounded down at the current precision level. Data are currently available for 2017, 2018, 2019, and 2020.
Relevance: Shows the proportion of a population who cannot afford the lowest cost set of foods that would meet requirements for food-based dietary guidelines, even if spending up to 52% of their income on food. # Cách tiến hành

library("FactoMineR")
library("factoextra")
library('agricolae')
library('countrycode')
data_BTN = read.csv("dataset/percent-of-the-population-who-cannot-afford-a-healthy-diet-at-52-percent-of-income-co-hd-headcount.csv", sep = ',',header = TRUE,encoding="latin1")

Trước tiên, chúng ta thử khảo sát đồ thị histogram giá trị phần trăm của bảng

hist(data_BTN$Value, main="Phần trăm dân số của các quốc gia mà chưa thể có chế độ ăn\nkhỏe mạnh với mức thu nhập 0.52 tổng thu nhập hộ gia đình", col="green", breaks=100,xlab="Giá trị phần trăm", ylab="Tần số xuất hiện")

data_BTN$Continent <- countrycode(sourcevar = data_BTN$Region.Alpha.2.Code,
                            origin = "iso2c",
                            destination = "continent")

Để có thể có cái nhìn tốt hơn về mối quan hệ giữa giá trị phần trăm này theo lục địa, ta sẽ vẽ lại bằng hàm ggplot()

library('ggplot2')
ggplot(data_BTN, aes(x = Value))+geom_histogram(bins = 100)+facet_grid(~data_BTN$Continent)  

Đồ thị cho ta thấy khá nhiều quốc gia châu âu có tỷ lệ người dân không có bữa ăn healthy khá tốt. Tỷ lệ này ngược lại ở các nước Châu Phi
Để hiểu rõ hơn lý do cho hiện tượng này, ta có thể xét các nhân tố từ website sau https://www.foodsystemsdashboard.org/indicators

Với nhân tố Driver, tôi chọn yếu tố về sự bền vững của chính quyền, bởi bộ máy lãnh đạo thường là 1 nguyên nhân chính cho sự thịnh vượng hoặc suy thoái của 1 quốc gia

library(dplyr)
library(data.table)
data_support1_raw = read.csv("dataset/political-stability-and-absence-of-violence-terrorism-index.csv", sep = ',',header = TRUE,encoding="latin1")
data_support1=  
  copy(data_support1_raw) %>% 
  group_by(Region.Alpha.2.Code) %>% # For each model
  arrange(Start.Year) %>%   # Sort by year
  filter(row_number()==n())  # And take the last row
data_support1_merge = merge(x = data_BTN, y =data_support1[,c("Region.Alpha.2.Code","Start.Year","Value")], by ="Region.Alpha.2.Code",all.x = TRUE)
ggplot(data_support1_merge, aes(x = Value.y))+geom_histogram(bins = 100)+facet_grid(~data_support1_merge$Continent) 

Ta cũng thấy xu hướng bất ổn ở các nước Châu Phi và Châu Á. Trong khi ở các nước có chất lượng cuộc sống cao ở Châu Âu và Châu Mỹ có xu hướng ổn định chính trị và quyền lãnh đạo. Như vậy đây là 1 yếu tố ảnh hưởng lớn.

Chúng tôi cũng khảo sát bảng affordability-of-a-healthy-diet-ratio-of-cost-to-food-expenditures-co-hd-fexp.csv. Lưu ý định nghĩa của bảng này là: Definition Ratio of the cost of a healthy diet to total food expenditure per capita per day from national accounts. Data available for 2017. > Relevance Shows the cost of the lowest cost set of foods that would meet requirements for food-based dietary guidelines, in comparison to total food budget. As he ratio approaches 1, the more unaffordable the healthy diet. As the ratio approaches 0, the more affordable the healthy diet.

library(dplyr)
library(data.table)
data_support1_raw = read.csv("dataset/affordability-of-a-healthy-diet-ratio-of-cost-to-food-expenditures-co-hd-fexp.csv", sep = ',', header = TRUE,encoding="latin1")
data_support1=  
  copy(data_support1_raw) %>% 
  group_by(Region.Alpha.2.Code) # For each model
data_support1_merge = merge(x = data_BTN, y =data_support1[,c("Region.Alpha.2.Code","Value")], by ="Region.Alpha.2.Code",all.x = TRUE)
ggplot(data_support1_merge, aes(x = Value.y))+geom_histogram(bins = 100)+facet_grid(~data_support1_merge$Continent) 

Đồ thị cho ta thấy chỉ số của các nước Châu Âu và Châu Đại Dương thấp, điều này có nghĩa là hầu hết người dân ở đây đều có đủ tài chính để đạt được 1 bữa ăn gọi là ‘healthy’. Ngược lại, các nước ở 3 Châu lục còn lại, đặc biệt là Châu Phi, chỉ số thường cao, đồng nghĩa với việc thiếu thốn tài chính là 1 yếu tố khiến bữa ăn ở các vùng này thiếu dinh dưỡng

Chúng tôi cũng khảo sát bảng average-number-of-meals-lunch-dinner-cooked-per-week.csv. Lưu ý định nghĩa của bảng này là:
** Definition People’s recall of the sum of all lunches and dinners cooked in the past week, divided by total number of respondents. Disaggregation by sex available.
Relevance ** Explores the frequency of home cooked meals per week as a proxy of a healthy diet.

library(dplyr)
library(data.table)
data_support1_raw = read.csv("dataset/average-number-of-meals-lunch-dinner-cooked-per-week.csv", sep = ',', header = TRUE,encoding="latin1")
data_support1=  
  copy(data_support1_raw) %>% 
  group_by(Region.Alpha.2.Code) # For each model
data_support1_merge = merge(x = data_BTN, y =data_support1[,c("Region.Alpha.2.Code","Value")], by ="Region.Alpha.2.Code",all.x = TRUE)
ggplot(data_support1_merge, aes(x = Value.y))+geom_histogram(bins = 100)+facet_grid(~data_support1_merge$Continent) 

Đồ thị cho ta thấy số bữa ăn trung bình không thay đổi nhiều giữa các Châu lục. Phàm là con người thì sẽ phải nấu ăn 6-8 bữa trên 1 tuần.

Chúng tôi suy nghĩ, việc một người ăn đủ hay không còn phụ thuộc vào độ có sẵn của thực phẩm tươi tại nơi đó, chúng tôi khảo sát 2 bảng Food availability của rau củ quả và protein: Lưu ý định nghĩa của bảng protein (rau củ quả chưa có definition) này là: Definition Grams of protein per person per day that are available in a country’s food supply, calculated as a three-year average. This indicator is based on national-level data from FAO’s Food Balance Sheets. Note that FAO’s methodology for Food Balance Sheets changed for 2014 estimates and after, which may limit comparability pre and post-2014. Relevance Increasing the protein in national food supplies may be especially important for countries with a high prevalence of undernutrition. Consumption of animal-source foods, which are protein rich, has been associated with improved child growth (Headey, Hirvonen, and Hoddinott 2018). Plant-based foods such as legumes may also provide an important source of protein. This indicator does not consider protein quality/essential amino acid composition or distribution and access to protein-rich foods among population subgroups.

library(dplyr)
library(data.table)
library(tidyverse)
data_support1_raw = read.csv("dataset/average-protein-supply-3-year-average.csv", sep = ',', header = TRUE,encoding="latin1")
data_support2_raw = read.csv("dataset/availability-of-fruits-and-vegetables.csv", sep = ',', header = TRUE,encoding="latin1")
data_support1=  
  copy(data_support1_raw) %>% 
  group_by(Region.Alpha.2.Code) %>% # For each model
  arrange(Start.Year) %>%   # Sort by year
  filter(row_number()==n())  # And take the last row
data_support2=  
  copy(data_support2_raw) %>% 
  group_by(Region.Alpha.2.Code) %>% # For each model
  arrange(Start.Year) %>%   # Sort by year
  filter(row_number()==n())  # And take the last row
df_list <- list(data_BTN,data_support1,data_support2)
merge_table <- df_list %>% reduce(full_join, by='Region.Alpha.2.Code')

ggplot(merge_table, aes(x = Value.y))+geom_histogram(bins = 100)+facet_grid(~merge_table$Continent) + ggtitle("Plot average protein \nsupply 3 year")

ggplot(merge_table, aes(x = Value))+geom_histogram(bins = 100)+facet_grid(~merge_table$Continent)+ ggtitle("Plot availability of fruits \nand vegetables")

Có thể thấy ở cả 2 thông số, Châu Phi đều có tần suất giá trị thấp cao hơn Châu Âu. Như vậy có thể thấy việc thiếu lương thực, rau củ, trái cây, thịt cá trứng sữa tươi là 1 nguyên nhân chính tạo sự khác biệt giữa chế độ dinh dưỡng giữa các Châu lục