### Applied Session 2
### Olympics Dataset
### Angel Garcia de la Garza


###  Set Libraries








### Load Datasets


### The list of countries in the two datasets aren't the same. Find a list of the names that do not match. 
###### Look at the names of the variables
###### Country names do no match 100%
###### Country names have changed; New countries have appeared. 
###### See Russia vs. USRR vs. Russian Federation
###### This is code to manually standardize these names

gdp_data <- gdp_data %>%
  mutate(country_name = case_when(country_name == "Russian Federation" ~ "Russia",
                                  country_name == "Bahamas, The" ~ "Bahamas",
                                  country_name == "Bolivia" ~ "Boliva",
                                  country_name == "Brunei Darussalam" ~ "Brunei",
                                  country_name == "Cote d'Ivoire" ~ "Ivory Coast",
                                  country_name == "Czechia" ~ "Czech Republic",
                                  country_name == "Cabo Verde" ~ "Cape Verde",
                                  country_name == "Congo, Dem. Rep." ~ "Democratic Republic of the Congo",
                                  country_name == "Egypt, Arab Rep." ~ "Egypt",
                                  country_name == "Gambia, The" ~ "Gambia",
                                  country_name == "Iran, Islamic Rep." ~ "Iran",
                                  country_name == "United Kingdom" ~ "UK",
                                  country_name == "Kyrgyz Republic" ~ "Kyrgyzstan",
                                  country_name == "Lao PDR" ~ "Laos",
                                  country_name == "numberrth Macedonia" ~ "Macedonia",
                                  country_name == "Micronesia, Fed. Sts." ~ "Micronesia",
                                  country_name == "Congo, Rep." ~ "Republic of Congo",
                                  country_name == "Slovak Republic" ~ "Slovakia",
                                  country_name == "Korea, Rep." ~ "South Korea",
                                  country_name == "Eswatini" ~ "Swaziland",
                                  country_name == "Syrian Arab Republic" ~ "Syria",
                                  country_name == "Trinidad and Tobago" ~ "Trinidad",
                                  country_name == "Turkiye" ~ "Turkey",
                                  country_name == "United States" ~ "USA",
                                  country_name == "Venezuela, RB" ~ "Venezuela",
                                  country_name == "Viet Nam" ~ "Vietnam",
                                  country_name == "Virgin Islands (U.S.)" ~ "Virgin Islands US",
                                  country_name == "Yemen, Rep." ~ "Yemen",
                                  country_name == "St. Lucia" ~ "Saint Lucia",
                                  country_name == "St. Kitts and Nevis" ~ "Saint Kitts",
                                  country_name == "St. Vincent and the Grenadines" ~ "Saint Vincent",
                                  T ~ country_name))


### Is GDP Related to Number of Gold Medals Using 2000 as an Example?









### Is a country GDP proportional to the number of Gold Medals? 









### Try this yourself; Calculate the Ranks but with the Total number of Medals (to the point system)









### What's the Average over all years of the ranks?









### What's the relationship between number of medals and GDP per capita using 2000 as an example?









### What's the relationship between number of medals and population using 2000 as an example?










