## Warning: package 'RMySQL' was built under R version 3.2.3
## Loading required package: DBI
## [1] "tb"
## [1] "country" "year"    "sex"     "child"   "adult"   "elderly"
## [1] TRUE
## [1] TRUE
## [1] "C:/Users/Antonio/Downloads"
## [1] TRUE
## [1] 1691

get the summary statistics for combined TB-World Population dataframe

##    country               year          cases          population       
##  Length:1691        Min.   :1995   Min.   :     0   Min.   :6.759e+05  
##  Class :character   1st Qu.:2000   1st Qu.:  1050   1st Qu.:8.842e+06  
##  Mode  :character   Median :2005   Median :  2483   Median :2.014e+07  
##                     Mean   :2004   Mean   :  9236   Mean   :6.387e+07  
##                     3rd Qu.:2009   3rd Qu.:  6350   3rd Qu.:4.868e+07  
##                     Max.   :2013   Max.   :430522   Max.   :1.386e+09  
##       rate          
##  Min.   :0.000e+00  
##  1st Qu.:6.558e-05  
##  Median :1.361e-04  
##  Mean   :2.461e-04  
##  3rd Qu.:2.851e-04  
##  Max.   :4.037e-03

Most of the 88 countries show a flat TB rate for the periods 1995 to 2013 (1/100,000 to 5/100,000 prevalence rates). However, for about 15 to 20 countries, there is a upward trend during this period in the prevalence of TB (1/500 to 1/1,000 in 2013). Because of these outliers, the median and mean for world TB Most of these relatively high prevalence countries are in southern Africa such as South Africa, Swaziland, Nambia, Lesotho and Botswana. North Korea and Haiti also have a relatively high rate. These relatively high TB rates, may be reflective of the current political and socio-economic conditions in these countries. As TB is a contagious disease - agravating factors such as malnutrition and unsanitary living conditions may be contributing to the rise (or resurgence) of TB in these countries. Also, specially for countries in southern Africa, the AIDS epidemics there may be another reason for the upward trend.

Ranking of countries by prevalence TB (for 2013) in descending order. Note that the U.S. is last - reflective of America’s superior health care system and how it is able to keep a contigious disease in check

##  [1] "South Africa"                                        
##  [2] "Swaziland"                                           
##  [3] "Lesotho"                                             
##  [4] "Namibia"                                             
##  [5] "Botswana"                                            
##  [6] "Democratic People's Republic of Korea"               
##  [7] "Zambia"                                              
##  [8] "Zimbabwe"                                            
##  [9] "Haiti"                                               
## [10] "Kenya"                                               
## [11] "Mongolia"                                            
## [12] "Indonesia"                                           
## [13] "Djibouti"                                            
## [14] "Democratic Republic of the Congo"                    
## [15] "Kyrgyzstan"                                          
## [16] "Sierra Leone"                                        
## [17] "Bangladesh"                                          
## [18] "Malawi"                                              
## [19] "Kazakhstan"                                          
## [20] "Angola"                                              
## [21] "Cambodia"                                            
## [22] "Central African Republic"                            
## [23] "Guinea"                                              
## [24] "Congo"                                               
## [25] "Republic of Moldova"                                 
## [26] "Peru"                                                
## [27] "Liberia"                                             
## [28] "Republic of Korea"                                   
## [29] "Morocco"                                             
## [30] "Chad"                                                
## [31] "Philippines"                                         
## [32] "Bolivia (Plurinational State of)"                    
## [33] "Côte d'Ivoire"                                      
## [34] "Tajikistan"                                          
## [35] "Uzbekistan"                                          
## [36] "Malaysia"                                            
## [37] "Burundi"                                             
## [38] "China, Hong Kong SAR"                                
## [39] "Georgia"                                             
## [40] "Romania"                                             
## [41] "Nigeria"                                             
## [42] "Uganda"                                              
## [43] "Somalia"                                             
## [44] "Ukraine"                                             
## [45] "Lao People's Democratic Republic"                    
## [46] "Yemen"                                               
## [47] "Ghana"                                               
## [48] "Russian Federation"                                  
## [49] "China"                                               
## [50] "Rwanda"                                              
## [51] "Nepal"                                               
## [52] "Honduras"                                            
## [53] "Togo"                                                
## [54] "Sri Lanka"                                           
## [55] "Viet Nam"                                            
## [56] "Azerbaijan"                                          
## [57] "Belarus"                                             
## [58] "Nicaragua"                                           
## [59] "Iraq"                                                
## [60] "Brazil"                                              
## [61] "Ecuador"                                             
## [62] "Benin"                                               
## [63] "Niger"                                               
## [64] "Paraguay"                                            
## [65] "Colombia"                                            
## [66] "Argentina"                                           
## [67] "Dominican Republic"                                  
## [68] "Venezuela (Bolivarian Republic of)"                  
## [69] "Mali"                                                
## [70] "Portugal"                                            
## [71] "Turkey"                                              
## [72] "Algeria"                                             
## [73] "Iran (Islamic Republic of)"                          
## [74] "Mexico"                                              
## [75] "Syrian Arab Republic"                                
## [76] "Japan"                                               
## [77] "Guatemala"                                           
## [78] "Poland"                                              
## [79] "Burkina Faso"                                        
## [80] "United Kingdom of Great Britain and Northern Ireland"
## [81] "Chile"                                               
## [82] "Spain"                                               
## [83] "Saudi Arabia"                                        
## [84] "Egypt"                                               
## [85] "France"                                              
## [86] "Germany"                                             
## [87] "Italy"                                               
## [88] "United States of America"

2013 TB Rate Top Ten and Bottom Ten Countries

##                                  country         rate
## 1                           South Africa 0.0026333306
## 2                              Swaziland 0.0024273438
## 3                                Lesotho 0.0018881977
## 4                                Namibia 0.0016901726
## 5                               Botswana 0.0014462107
## 6  Democratic People's Republic of Korea 0.0014096535
## 7                                 Zambia 0.0011348379
## 8                               Zimbabwe 0.0010237004
## 9                                  Haiti 0.0007900199
## 10                                 Kenya 0.0006856927

##                                                 country         rate
## 79                                         Burkina Faso 5.556593e-05
## 80 United Kingdom of Great Britain and Northern Ireland 4.908431e-05
## 81                                                Chile 4.869547e-05
## 82                                                Spain 4.500611e-05
## 83                                         Saudi Arabia 4.002932e-05
## 84                                                Egypt 3.915601e-05
## 85                                               France 2.799758e-05
## 86                                              Germany 1.943751e-05
## 87                                                Italy 1.756018e-05
## 88                             United States of America 1.119823e-05