# excel file
myData <- read_excel("../01_module4/data/myData.xlsx")
myData
## # A tibble: 193 × 9
## hdi_rank_2023 country human_development_in…¹ life_expectancy_at_b…²
## <dbl> <chr> <dbl> <dbl>
## 1 1 Iceland 0.972 82.7
## 2 2 Norway 0.97 83.3
## 3 2 Switzerland 0.97 84.0
## 4 4 Denmark 0.962 81.9
## 5 5 Germany 0.959 81.4
## 6 5 Sweden 0.959 83.3
## 7 7 Australia 0.958 83.9
## 8 8 Hong Kong, China… 0.955 85.5
## 9 8 Netherlands 0.955 82.2
## 10 10 Belgium 0.951 82.1
## # ℹ 183 more rows
## # ℹ abbreviated names: ¹human_development_index_hdi, ²life_expectancy_at_birth
## # ℹ 5 more variables: expected_years_of_schooling <dbl>,
## # mean_years_of_schooling <dbl>, gross_national_income_gni_per_capita <dbl>,
## # gni_per_capita_rank_minus_hdi_rank <dbl>, hdi_rank_2022 <chr>
There is preliminary evidence of a positive correlation between a country’s human development index and their life expectancy at birth.
ggplot(data = myData) +
geom_point(mapping = aes(x = human_development_index_hdi, y = life_expectancy_at_birth),
alpha = 0.5) +
geom_smooth(mapping = aes(x = human_development_index_hdi, y = life_expectancy_at_birth)) +
labs(x= "HDI",
y = "Life Expectancy",
title = "Human Development Index vs. Life Expectancy",
subtitle = "Correlation between HDI and Life expectancy")
There is according to the graphics a strong correlation between a country’s life expectancy at birth and their human development index, which is an overall evaluation of a county’s living standard.