In this document, I will examine happiness scores of many countires around the world. I will answer the following questions:
I will also create a treemap for year 2020, and create a choropleth map colored by the happiness score for different regions.
This bar plot displays the top 10 happiest countries for the year 2020. As shown in the plot, the scores range from about 7.8 to 7.2.
This series of box plots displays how happiness scores have changed through the years of 2017 to 2020 for 6 different countries. Overall, the scores for all 6 countries did not change significantly.
Between the years of 2017 and 2020, there were eight countries which consistently ranked in the top 10 happiest countries: Finland, Denmark, Switzerland, Iceland, Norway, Netherlands, Sweden, and New Zealand. This series of box plots shows how the happiness scores for these countries have changed over these four years. For some of the countries (Switzerland, Iceland, Sweden, and New Zealand), the scores are relatively stable over the four years. For the other countries (Finland, Denmark, Norway, and the Netherlands), the happiness scores had quite a bit of variance.
Here, the five number summary (minimum, first quartile, median, third quartile, maximum) for each country is displayed, which mirrors the box plots for each country.
##
## Five-Number Summary for Finland :
## [1] 7.2840 7.3650 7.4910 7.5545 7.8090
##
## Five-Number Summary for Denmark :
## [1] 7.2840 7.3650 7.4910 7.5545 7.8090
##
## Five-Number Summary for Switzerland :
## [1] 7.2840 7.3650 7.4910 7.5545 7.8090
##
## Five-Number Summary for Iceland :
## [1] 7.2840 7.3650 7.4910 7.5545 7.8090
##
## Five-Number Summary for Norway :
## [1] 7.2840 7.3650 7.4910 7.5545 7.8090
##
## Five-Number Summary for Netherlands :
## [1] 7.2840 7.3650 7.4910 7.5545 7.8090
##
## Five-Number Summary for Sweden :
## [1] 7.2840 7.3650 7.4910 7.5545 7.8090
##
## Five-Number Summary for New Zealand :
## [1] 7.2840 7.3650 7.4910 7.5545 7.8090
These scatterplots display the correlation between GDP per capita and the happiness scores for each country. The 4 plots show how this correlation has changed through the years of 2017 to 2020. Based upon this, it appears that GDP per capita and overall happiness are stongly correlated as the data in all four plots are tightly clustered around the trendline.
## Loading required package: gsubfn
## Loading required package: proto
## Warning in fun(libname, pkgname): couldn't connect to display ":0"
## Loading required package: RSQLite
This series of box plots displays the distributions of happiness scores across the 8 continents in the world. As shown in the display, the distributions vary by continent, with 2 outliers in Asia and North America.
These are the 5 number summaries for each continent, which reflects the data displayed in the box plots.
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## # A tibble: 8 × 6
## continent Min Q1 Median Q3 Max
## <fct> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 Africa 2.82 3.81 4.43 4.83 5.49
## 2 Asia 2.57 4.80 5.32 6.04 7.13
## 3 Europe 4.56 5.78 6.36 7.16 7.81
## 4 North America 3.72 5.95 6.30 6.46 7.23
## 5 Oceania 7.22 7.24 7.26 7.28 7.3
## 6 Seven seas (open ocean) 5.20 5.42 5.65 5.88 6.10
## 7 South America 5.69 5.80 5.98 6.23 6.44
## 8 <NA> 3.53 4.69 5.18 5.54 6.46
This treemap displays the 2020 rankings for happiness. The darker the color, the higher the ranking. The size of each square reflects that country’s happiness score.
This choropleth displays happiness scores on a map, showing a dark blue for higher scores, and light blue for lower scores. From the map, it appears the Canada and Australia have the highest happiness scores.