Module_06 with Bird Flu Deaths

Author

Steven Shank

Bird Flu Deaths

This report includes data on Bird Flu deaths from 15 different countries covering the years of 2003 to 2008. The intent with this report is to:

  • Display the data frame that included the Bird Flu deaths per contry by year.
  • find the country with the highest death rated due to Bird Flu in 2005.
  • Find the country with the highest death rate due to Bird Flu in 2007.

Data Table and Variable Information

birdFluDeaths = read.csv("./BirdFlu_deaths.csv")
print(birdFluDeaths)
                            Country yr2003 yr2004 yr2005 yr2006 yr2007 yr2008
1                        Azerbaijan      0      0      0      5      0      0
2                        Bangladesh      0      0      0      0      0      0
3                          Cambodia      0      0      4      2      1      0
4                             China      1      0      5      8      3      3
5                          Djibouti      0      0      0      0      0      0
6                             Egypt      0      0      0     10      9      3
7                         Indonesia      0      0     13     45     37     15
8                              Iraq      0      0      0      2      0      0
9  Lao.People.s.Democratic.Republic      0      0      0      0      2      0
10                          Myanmar      0      0      0      0      0      0
11                          Nigeria      0      0      0      0      1      0
12                         Pakistan      0      0      0      0      1      0
13                         Thailand      0     12      2      3      0      0
14                           Turkey      0      0      0      4      0      0
15                          Vietnam      3     20     19      0      5      5

Look at the structure and names of the variables included in the table names(birdFluDeaths) head(birdFluDeaths) str(birdFluDeaths) summary(birdFluDeaths)`

names(birdFluDeaths)
[1] "Country" "yr2003"  "yr2004"  "yr2005"  "yr2006"  "yr2007"  "yr2008" 
head(birdFluDeaths)
     Country yr2003 yr2004 yr2005 yr2006 yr2007 yr2008
1 Azerbaijan      0      0      0      5      0      0
2 Bangladesh      0      0      0      0      0      0
3   Cambodia      0      0      4      2      1      0
4      China      1      0      5      8      3      3
5   Djibouti      0      0      0      0      0      0
6      Egypt      0      0      0     10      9      3
str(birdFluDeaths)
'data.frame':   15 obs. of  7 variables:
 $ Country: chr  "Azerbaijan" "Bangladesh" "Cambodia" "China" ...
 $ yr2003 : int  0 0 0 1 0 0 0 0 0 0 ...
 $ yr2004 : int  0 0 0 0 0 0 0 0 0 0 ...
 $ yr2005 : int  0 0 4 5 0 0 13 0 0 0 ...
 $ yr2006 : int  5 0 2 8 0 10 45 2 0 0 ...
 $ yr2007 : int  0 0 1 3 0 9 37 0 2 0 ...
 $ yr2008 : int  0 0 0 3 0 3 15 0 0 0 ...

Country with highest number of Bird Flu deaths in 2005

#find the row with the maximum number of bird flu deaths in 2005
hiDeaths05 = which(birdFluDeaths$yr2005 == max(birdFluDeaths$yr2005))
print(hiDeaths05)
[1] 15
#using the row number with the highest deaths in 2005, find the name of the country using index notation
hiDeath05Co = birdFluDeaths[15,1] 

#print out the name of the country that had the highest number of bird flu deaths in 2005
print(hiDeath05Co) 
[1] "Vietnam"

According to the data table, the country with the highest number of deaths from Bird Flu in 2005 was Vietnam


Country with highest number of Bird Flu deaths in 2007

#find the row with the maximum number of bird flu deaths in 2007
hiDeaths07 = which(birdFluDeaths$yr2007 == max(birdFluDeaths$yr2007)) 
print(hiDeaths07)
[1] 7
#using the row number with the highest deaths in 2007, find the name of the country using index notation
hiDeath07Co = birdFluDeaths[7,1] 
#print out the name of the country that had the highest number of bird flu deaths in 2007
print(hiDeath07Co) 
[1] "Indonesia"

According to the data table, the country with the highest number of deaths from Bird Flu in 2005 was Indonesia