-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment4.Rmd
572 lines (452 loc) · 24.8 KB
/
Assignment4.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
---
title: "The Causes of Death around the World"
author:
- familyname: Shi
othernames: Jingyi
address: Monash University
email: [email protected]
correspondingauthor: true
qualifications: 32267886
- familyname: Sun
othernames: Miao
address: Monash University
email: [email protected]
correspondingauthor: true
qualifications: 28380584
- familyname: Ou
othernames: Jingwen
address: Monash University
email: [email protected]
correspondingauthor: true
qualifications: 32269633
- familyname: Qin
othernames: Yu
address: Monash University
email: [email protected]
correspondingauthor: true
qualifications: 32606745
department: Faculty of Business and Statistic
organization: Monash University ETC5513 Group Really3Q
bibliography: references.bib
biblio-style: authoryear-comp
linestretch: 1.5
output:
bookdown::pdf_document2:
template: monashreport2.tex
fig_caption: yes
fig_height: 5
fig_width: 8
includes:
in_header: preamble.tex
keep_tex: yes
number_sections: yes
citation_package: biblatex
toc: false
---
```{r setup, echo = FALSE,message=FALSE,warning=FALSE}
knitr::opts_chunk$set(echo = FALSE,
messages = FALSE,
warning = FALSE)
library(tidyverse)
library(ggplot2)
library(readr)
library(knitr)
library(broom)
library(gridExtra)
```
```{r read_data, results='hide',echo = FALSE,message=FALSE,warning=FALSE}
annual_number_of_deaths_by_cause <- read_csv("Data/annual-number-of-deaths-by-cause.csv",
col_types = cols(`Number of executions` = col_double()))
life_expectancy <- read_csv("Data/life-expectancy.csv")
GDP <- read_csv("Data/GDP.csv")
```
\clearpage
# Introduction
Do you know around 56 million people die each year? What caused their death? How did the causes of death change over time and difference between countries and world regions? And can we prevent death early. There are the big questions we are answering in our report.
Our data is from "data in our world", It counts more than 20 causes of death in countries around the world from 1990 to 2018. From the table\@ref(tab:deathcauses), here is a list of the causes of death covered by this report. From the plot\@ref(fig:worldplot), we can see Cardiovascular diseases are the leading cause of death globally. The second biggest cause is Neoplasms. What about the specific situation in the different countries? The four members of our group will choose two countries of interest and make an analysis.
```{r deathcauses,echo = FALSE,message=FALSE,warning=FALSE}
world_data <-annual_number_of_deaths_by_cause %>%
filter(!is.na(Code),
Year %in% c(1990:2018)) %>%
pivot_longer(cols = -c(1:3),
names_to = "Death_cause",
values_to = "Count") %>%
group_by(Year,Death_cause) %>%
summarise(Death_amount=sum(Count, na.rm = TRUE))
world_data %>% filter(Year==1990) %>%
pull(Death_cause) %>%
kable(caption = "The caueses of death")
```
```{r worldplot,fig.cap ="Number of deaths by cause, World, 1990 to 2019",echo = FALSE,message=FALSE,warning=FALSE}
ggplot(world_data,
mapping = aes(x=Year,
y=Death_amount,
color=Death_cause))+
geom_line()+
theme_bw()
```
\clearpage
# Main body
## Australia and Switzerland
**Research Question:**
**Q1: What can be observed in the chart of causes of death due to disease?**
**Q2: What can be observed in the chart of causes of death due to others?**
**1.Plot death due to disease factors**
```{r,echo = FALSE,message=FALSE,warning=FALSE}
disease_data <- annual_number_of_deaths_by_cause %>%
select(1,3,5,6,7,8,9,12,13,14,15,16,17,18,22,24,26,27,32,33,34,36) %>%
filter(Country %in% c("Australia","Switzerland"),
Year %in% c(1990:2018)) %>%
pivot_longer(cols = -c(1:3),
names_to = "Death_cause",
values_to = "Count")
```
```{r diseaseplot,fig.cap="Number of deaths by disease causes, 1990 to 2018",echo = FALSE,message=FALSE,warning=FALSE}
AZ_life_expectancy <- life_expectancy %>% filter(
Entity %in% c("Australia","Switzerland"),
Year %in% c(1990:2018)
) %>%
rename("Country" = "Entity",
"Life_expectancy" = "Life expectancy") %>%
select(-Code)
DL_data <- disease_data %>%
left_join(AZ_life_expectancy,by=c("Country","Year"))
ggplot(DL_data,
mapping = aes(x=Year,
y=Count,
color=Death_cause))+
geom_line()+
facet_wrap(~Country,
scales = "free_y")+
theme_bw()
```
As we can see from this graph\@ref(fig:diseaseplot), cardiovascular disease and Neoplasm are the leading causes of death in both Australia and Switzerland, with cardiovascular disease decreasing but starting to rise again after about 2011, and the number of deaths from Alzheimer's and neoplasm rising sharply.
This result confused me. I would have thought that because of the advancement of medicine, the causes of death from disease should gradually decrease.So I looked up these three conditions online, all of which are highly prevalent in older people, and then in this table \@ref(tab:lifeexpendcy), I listed life expectancy in Australia and Switzerland from 1990 to 2019.As can be seen from the table\@ref(tab:lifeexpendcy), life expectancy increases as the years go by, meaning that more people are living old enough so that the number of people who are sick increases.
```{r lifeexpendcy,echo = FALSE,message=FALSE,warning=FALSE}
A_life_expectancy <- life_expectancy %>% filter(
Entity %in% c("Australia"),
Year %in% c(1990:2018)
) %>%
rename("Country" = "Entity",
"Life_expectancy" = "Life expectancy") %>%
select(-Code)
S_life_expectancy <- life_expectancy %>% filter(
Entity %in% c("Switzerland"),
Year %in% c(1990:2018)
) %>%
rename("Country" = "Entity",
"Life_expectancy" = "Life expectancy") %>%
select(-Code)
AZlife_expectancy <- A_life_expectancy %>%
cbind(S_life_expectancy)
AZlife_expectancy %>%
tail(10) %>%
kable(caption = "Life Expectancy in Australia and Switzerland")
```
In plot\@ref(fig:diseaseplot1), I have added this life expectancy line to the first graph for better visualization and you can see that it is all on an up trend.
```{r diseaseplot1,fig.cap ="Add the line of life expectancy to fig1.",echo = FALSE,message=FALSE,warning=FALSE}
DL_data <- disease_data %>%
left_join(AZ_life_expectancy,by=c("Country","Year"))
ggplot(DL_data,
mapping = aes(x=Year,
y=Count,
color=Death_cause))+
geom_line()+
geom_line(aes(y=Life_expectancy*500),
color="#1CDC4B",
size=1)+
geom_point(aes(y=Life_expectancy*500),
color="#12F09E",
size=1)+
scale_y_continuous(name = "Number of deaths by disease causes",
sec.axis = sec_axis(trans =~./500,
name = "Life expectancy"))+
facet_wrap(~Country,
scales = "free_y")+
theme_bw()
```
**2.Plot death due to other factors**
```{r otherplot, fig.cap ="Number of deaths by other causes in Australia and Switzerland.",echo = FALSE,message=FALSE,warning=FALSE}
other_data <- annual_number_of_deaths_by_cause %>%
select(1,3,4,10,11,19,20,21,23,25,28,29,30,31,35) %>%
filter(Country %in% c("Australia","Switzerland"),
Year %in% c(1990:2018)) %>%
pivot_longer(cols = -c(1:3),
names_to = "Death_cause",
values_to = "Count")
ggplot(other_data,
mapping = aes(x=Year,
y=Count,
color=Death_cause))+
geom_line()+
facet_wrap(~Country,
scales = "free_y")+
theme_bw()
```
For other causes. This graph \@ref(fig:otherplot)shows that self-harm, road injuries are the main causes of death from other causes. Road injuries have been decreasing and I think this is closely related to the improving traffic laws and the popularity of driving tests. I noticed that Australia had an unusual peak in 2009. I searched Google for three keywords: Australia Fire 2009 and I got the information that there was a very serious forest fire in Vic in 2009. @Bushfire said that the Black Saturday fires started on 7 February 2009. Approximately 400 fires were recorded across Victoria, affecting 78 communities. A total of 173 people died in the fires, and 2029 houses were lost. So in 2009 an unusually high number of people died in fires in Australia.
In order to read data used R package @readr, clean the data used R package @tidyverse, plotting picture used R package @ggplot2.
\clearpage
## China and India
```{r}
df_global <- annual_number_of_deaths_by_cause %>%
filter(Year %in% c(1950:2018)) %>%
pivot_longer(
cols = -c(Country, Code, Year),
names_to = "Death_cause",
values_to = "Count"
)
df_CI <- df_global %>%
filter(Country %in% c("China", "India"))
interest <- c(
"Cardiovascular diseases",
"Diabetes mellitus",
"HIV/AIDS",
"Neoplasms",
"Nutritional deficiencies",
"Malaria"
)
```
```{r ,messages = FALSE, warning = FALSE}
CI_Percent <- df_CI %>%
group_by(Country,
Year) %>%
mutate(Total_death = sum(Count, na.rm = TRUE)) %>%
group_by(Country,
Year,
Death_cause,
Total_death) %>%
summarize(Percentage = Count / Total_death * 100, .groups = 'drop') %>%
group_by(Country,
Death_cause) %>%
arrange(desc(Percentage)) %>%
filter(Death_cause %in% interest)
CI_Total <- df_CI %>%
group_by(Country,
Year,
Death_cause) %>%
mutate(Death_abs = sum(Count, na.rm = TRUE)) %>%
filter(Death_cause %in% interest) %>%
group_by(Year,
Country,
Death_cause,
Death_abs) %>%
summarise(.groups = 'drop') %>%
left_join(GDP, by = c ("Country" = "Entity",
"Year" = "Year"))
```
The health conditions are different due to the resources that different countries control. Which leads to an inequality in health in different areas @emadi2021global. Countries in different developing conditions would have different health conditions. This section will focus on 2 typical developing countries : China and India. Investigate diseases that cause the most death in China and India, and how they are related with the GDP per capita.
**Research Question:**
**Q1: What are the diseases that cause the most death in China and India?**
**Q2: How the death caused by those diseases change with the change of GDP per capita?**
We will focusing on 6 typical diseases: they are : Cardiovascular Diseases, Diabetes mellitus, HIV, Neoplasms, Nutritional deficiencies and, Malaria
```{r plot}
Percentage_trend <- CI_Percent %>%
ggplot(aes(x = Year,
y = Percentage,
color = Death_cause)) +
geom_line() +
facet_wrap( ~ Country, nrow = 2, scales = "free_y")
Absolute_trend <- CI_Total %>%
ggplot(aes(x = Year)) +
geom_line(aes(y = Death_abs,
color = Death_cause)) +
geom_line(aes(y = gdppc * 500)) +
facet_wrap( ~ Country, nrow = 2, scales = "free_y")
```
```{r percendeath, fig.cap = "Percentage of different causes of death by year"}
Percentage_trend
```
In this graph \@ref(fig:percendeath) , it is clear that both Cardiovascular Diseases and Neoplasms contribute the most among other diseases we are interested in both China and India and the trend is still increasing. So we will mainly focus on these 2 diseases. There are 43% deaths caused by Cardiovascular diseases and 26% caused by Neoplasms in China. 29% deaths caused by Cardiovascular diseases and 10% caused by Neoplasms in India. So, diseases that cause the most deaths in China and India are Cardiovascular diseases and Neoplasms.
```{r totaldeath, fig.cap = "Total number of death by year and GDP per capita"}
Absolute_trend
```
In this graph \@ref(fig:totaldeath), we combine them with the GDP per capita graph, which is the black line. There is a clear trend that the death caused by these 2 diseases are highly correlated with GDP per capita. To find out the relations between them.
```{r Run regression with the number of deasease against GDP per capita.}
CI_model <- CI_Total %>%
filter(Death_cause %in% c("Cardiovascular diseases", "Neoplasms")) %>%
group_by(Country,
Death_cause) %>%
nest() %>%
mutate(model = map(
.x = data,
.f = function(x) {
lm(Death_abs ~ gdppc,
data = x)
}
))
CI_coef <- CI_model %>%
mutate (tidy = map(model, tidy)) %>%
unnest(tidy) %>%
select(Country, Death_cause, term, estimate) %>%
pivot_wider(
id_cols = c("Country", "Death_cause"),
names_from = term,
values_from = estimate
) %>%
rename("intercept" = "(Intercept)",
"slope" = "gdppc")
CI_model_fitness <- CI_model %>%
mutate(glance = map(model, glance)) %>%
unnest(glance) %>%
select(Country, Death_cause, r.squared) %>%
mutate(r.squared = round(r.squared, 2)) %>%
right_join(CI_coef, by = c("Country", "Death_cause")) %>%
mutate(intercept = round(intercept, 2),
slope = round(slope, 2))
```
```{r modelparameter}
CI_model_fitness %>% kable(caption = "Parameters of model")
```
I run a regression, using the death caused by "Cardiovascular diseases" and "Neoplasms" against GDP per capita shown in the table \@ref(tab:modelparameter). The r^2 is quite high means they fitted into the linear model quite well
More than 90% of deaths caused by Cardiovascular diseases and Neoplasms can be explained by the model. In China, for every 1 unit increase in the GDP per capita, the deaths caused by Cardiovascular diseases and Neoplasms will increase for 182 and 90. In India, for 1 unit increase in the GDP per capita, the deaths caused by Cardiovascular diseases and Neoplasms increased by 221 and 85 respectively.
It is corresponding to common sense as well. Because both Cardiovascular Diseases and Neoplasms occur more in the area with higher income. The longer one lives, the higher the possibility one can get these 2 diseases. Richer a country is, more resources can be used on transmitted diseases. therefore we can observe that death caused by transmitted diseases decreased to a very low level
In this part, I used package readr @readr to read data, package broom @broom to get statistic data from model, package knitr @knitr to make table, package tidyverse @tidyverse for basic calculation and package ggplot2 @ggplot2 to plot.
\clearpage
## Mexico and Germany
**Research Question:**
**Q1: In Mexico and Germany what are the top five diseases that cause the most deaths from 2005?**
**Q2: What are the trends of these countries over the 15 years?**
```{r results='hide',echo = FALSE,message = FALSE,warning = FALSE}
annual_number_of_deaths_by_cause <- read_csv("Data/annual-number-of-deaths-by-cause.csv",
col_types = cols(`Number of executions` = col_double()))
```
**1.The tables of top five diseases in Mexico and Germany**
```{r Mexicotable,echo = FALSE,message = FALSE,warning = FALSE}
Mexico <- annual_number_of_deaths_by_cause %>%
filter(Country == "Mexico") %>%
filter(!is.na(Code), Year >= 2005) %>%
pivot_longer(cols = c(4:36),
names_to = "Death_cause",
values_to = "Count") %>%
group_by(Death_cause) %>%
summarise(Death_amount=sum(Count, na.rm = TRUE))%>%
arrange(desc(Death_amount))
Mexico %>%
head(n=5) %>%
kable(caption = "Deaths by cause of Mexico")
```
From the table \@ref(tab:Mexicotable) we can see that there are most people die from cardiovascular diseases with almost two million (1977765) deaths. The second is Neoplasms. Digestive diseases, Chronic kidney disease and Diabetes mellitus are the third, fourth and fifth respectively.
```{r Germanytable,echo = FALSE,message = FALSE,warning = FALSE}
Germany <- annual_number_of_deaths_by_cause %>%
filter(Country == "Germany") %>%
filter(!is.na(Code), Year >= 2005) %>%
pivot_longer(cols = c(4:36),
names_to = "Death_cause",
values_to = "Count") %>%
group_by(Death_cause) %>%
summarise(Death_amount=sum(Count, na.rm = TRUE))%>%
arrange(desc(Death_amount))
Germany %>%
head(n=5) %>%
kable(caption = "Deaths by cause of Germany")
```
On the other hand, from the table \@ref(tab:Germanytable) it is easy to see it’s similar to Mexico, where the top three are Cardiovascular diseases, Neoplasms and Digestive diseases. But the number of Cardiovascular deaths in Germany is almost five million (4991605) which is more than twice as high as in Mexico. Alzheimer’s diseases and other dementias is the fourth, followed by the Chronic respiratory diseases.
**2.The figure of trend of these diseases in Mexico and Germany**
```{r ,echo = FALSE,message = FALSE,warning = FALSE}
Mexico_cause <- annual_number_of_deaths_by_cause %>%
select(-2, -4) %>%
filter(Country == "Mexico",
Year >= 2005) %>%
pivot_longer(cols = -c(1:2),
names_to = "Death_cause",
values_to = "Count")
Mexico_plot <- Mexico_cause %>%
filter(Death_cause %in% c("Cardiovascular diseases",
"Neoplasms",
"Chronic kidney disease",
"Digestive diseases",
"Diabetes mellitus")) %>%
ggplot(mapping = aes(x = Year)) +
geom_line(aes(y = Count,
color = Death_cause)) +
ggtitle("Mexico death cause trend")
Germany_cause <- annual_number_of_deaths_by_cause %>%
select(-2, -4) %>%
filter(Country == "Germany",
Year >= 2005) %>%
pivot_longer(cols = -c(1:2),
names_to = "Death_cause",
values_to = "Count")
Germany_plot <- Germany_cause %>%
filter(Death_cause %in% c("Cardiovascular diseases",
"Neoplasms",
"Digestive diseases",
"Alzheimer's disease and other dementias",
"Chronic respiratory diseases")) %>%
ggplot(mapping = aes(x = Year)) +
geom_line(aes(y = Count,
color = Death_cause)) +
ggtitle("Germany death cause trend")
```
```{r MexicoAndGermanyfigure,fig.cap = "Deaths by cause in Mexico and Germany",echo = FALSE,message = FALSE,warning = FALSE}
gridExtra::grid.arrange(Mexico_plot,Germany_plot, nrow = 2)
```
The graph \@ref(fig:MexicoAndGermanyfigure) shows that the number of deaths from these five diseases is increasing every year, with the biggest increase in deaths from cardiovascular diseases. The number of deaths from Chronic kidney disease, Diabetes mellitus and Digestive diseases is similar every year. By contrast, the trend of above diseases in Germany has seen a relatively flat. Except for the significant increase in the number of deaths due to cardiovascular diseases since 2011, the other four causes of death showed a relatively stable trend.
**Summary**
To this data set, I selected the data of Mexico and Germany from 2005 to do a research. My conclusion is as I said, cardiovascular disease, Neoplasms and digestive disease are the top three causes of death in Mexico and Germany. The article written by @miller1997exercise said most of these diseases are caused by bad living habits. We should pay attention to this problem and call on all of us to change the bad lifestyle, keep exercising and have a regular diet. In this report, I used R package @tidyverse, @ggplot2 and @readr.
\clearpage
## Benin and Mozambique
**Research Question:**
**Q1: What are top 5 causes of death in Benin and Mozambique, and what may be the reason for it?**
**Q2: What is the development trend of these causes in the above question?**
**1.Top 5 death causes in Benin and Mozambique**
```{r Benintopfivedeathrate, eval=TRUE,echo=FALSE}
disease_data_Benin <- annual_number_of_deaths_by_cause %>%
select(1,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36) %>%
filter(Country %in% c("Benin"),
(Year >= 2000)) %>%
pivot_longer(cols = -c(1:2),
names_to = "Death_cause",
values_to = "Count")%>%
group_by(Death_cause) %>%
summarise(Death_amount=sum(Count, na.rm = TRUE))%>%
arrange(desc(Death_amount))%>%
head(n=5)
disease_data_Benin %>%
kable(caption = "The top 5 death causes of Benin from 2000 until now")
```
```{r Mozambiquetopfivedeathrate, eval=TRUE,echo=FALSE}
disease_data_Mozambique <- annual_number_of_deaths_by_cause %>%
select(1,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36) %>%
filter(Country %in% c("Mozambique"),
(Year >= 2000)) %>%
pivot_longer(cols = -c(1:2),
names_to = "Death_cause",
values_to = "Count")%>%
group_by(Death_cause) %>%
summarise(Death_amount=sum(Count, na.rm = TRUE))%>%
arrange(desc(Death_amount))%>%
head(disease_data_Mozambique,n=5)
disease_data_Mozambique %>%
kable(caption = "The top 5 death causes of Mozambique from 2000 until now")
```
According to that table \@ref(tab:Benintopfivedeathrate), Top five death reasons for Benin from 2000 until now are: Malaria, Neonatal disorders, Lower respiratory infections, cardiovascular disease, Diarrheal diseases. Meanwhile, according to table \@ref(tab:Mozambiquetopfivedeathrate) top five death reasons for Mozambique from 2000 until now are: HIV/AIDS, Malaria,Neonatal disorders, Cardiovascular diseases,Tuberculosis. Comparing to other countries, Benin and Mozambique have totally different results. For those high-income or developed countries and middle-income countries, the main death causes are Cardiovascular disease, cancers, or diabetes mellitus, which are mainly caused by getting old, or unhealthy lifestyle. However, in Benin and Mozambique the main cause of death are different types and infectious diseases and neonatal disorders. The reason for this phenomena is the bad circumstance and the poor medical system in these countries, also they are lack of vaccines and medicines, according to @mbaye2019telling. Many people could have been saved if they have a good treatment. For example, Malaria is mainly transmitted by mosquitoes, and in Africa there are so many mosquitoes. However people can be saved if they have specific drugs like artemisinin. In this way, Malaria, a not very severe disease in other countries, become the top death cause in Benin and Mozambique.
**2.Figure of the trends of these diseases in Benin and Mozambique**
```{r topfiveplot, fig.cap = "figure of top5 death reason in Benin and Mozambique", eval=TRUE,echo=FALSE}
disease_data_Benin_plot <- annual_number_of_deaths_by_cause %>%
select(1,3,9,16,17,18,22) %>%
filter(Country %in% c("Benin"),
(Year >= 2000)) %>%
pivot_longer(cols = -c(1:2),
names_to = "Death_cause",
values_to = "Count")
disease_data_Mozambique_plot <- annual_number_of_deaths_by_cause %>%
select(1,3,9,13,15,16,18) %>%
filter(Country %in% c("Mozambique"),
(Year >= 2000)) %>%
pivot_longer(cols = -c(1:2),
names_to = "Death_cause",
values_to = "Count")
P1 <- ggplot(disease_data_Benin_plot, aes(x=Year,
y= Count,
color=Death_cause))+geom_line(size=1)+ggtitle("Trends of top five death rate in Benin")
P2 <- ggplot(disease_data_Mozambique_plot, aes(x=Year,
y= Count,
color=Death_cause))+geom_line(size=1)+ggtitle("Trends of top five death rate in Mozambique")
gridExtra::grid.arrange(P1,P2)
```
According to figure graph\@ref(fig:topfiveplot), except Diarrheal disease, all the other four diseases were increasing from 2000 until now.Lower respiratory infections death reached the peak around 2015, and began to decrease in recent years. For Mozambique, the death rate of Cardiovascular disease was increasing from 2000 until now. Death number for HIV and Tuberculosis reached the peak in around 2013 and began to drop.The death number of Malaria and Neonatal disorder was deceasing from 2000 until now. In order to help these low-income countries get out of these difficulties, and save more life, high-income developed countries should help them by serving more medicines and vaccines. Also, more medical teams should support Africa and help patients in those low-income countries. To make these tables and figure, I can also cite R packages as follows @tidyverse, @ggplot2, @readr, @gridExtra.
\clearpage
# Conclusion
In conclusion, we can see that in high-income or developed countries like Australia, Switzerland, and Germany, the main death causes are cardiovascular diseases and they are caused by bad lifestyles and a long life time. People need to pay more attention to their mental health,and have a healthy diet. For those middle-income countries like China, India, and Mexico, the main death reason are cardiovascular and cancer, and the death reason is very related to the GDP of these countries. For those low-income countries, like Benin and Mozambique, people are suffering in many kinds of infectious diseases. We hope more high-income and developed countries can help those poor counties by severing more medical help, medicines and vaccines. All the countries in the world should collaborate with each other and make more people have happiness and healthy life.
\clearpage