Section 1: Introduction

In this document, I will examine happiness scores of many countires around the world. I will answer the following questions:

  1. What are the top 10 happiest countries for the year of 2020?
  2. How have the happiness levels changed over the years of 2017 to 2020 for China, India, USA, Indonesia, Japan, and Russia?
  3. Which countries have consistently ranked as the top 10 happiest countries across the 4 years?
  4. Is there a correlation between GDP per capita and happiness score among countries? Does it differ by year?
  5. How does the distribution of happiness scores vary across different regions of the world?
  6. What is the relationship between social support and life expectancy in terms of their impact on happiness?

I will also create a treemap for year 2020, and create a choropleth map colored by the happiness score for different regions.

Section 2: Top 10 Happiest Countries

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.

Section 3: Change in Happiness Scores for China, Indonesia, Russia, Japan, USA, and India

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.

Section 4: Countries Consistently Ranked in the Top 10

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

Section 5: Correlation Between GDP per capita and Happiness Score

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

Section 6: Distribution of Happiness Across the World

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

Section 7: Relationship Between Social Support and Life Expectancy in Terms of Their Impact on Happiness

Here, a bubble plot is used to show the impacts of social support and life expectancy on happiness scores. The size of the bubble reflects the magnitude of the happiness score. As shown in the plot, a higher life expectancy has a positive correlation with social support.

Section 8: Treemap for 2020 Happiness Scores

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.

Section 9: Choropleth Map for Happiness Scoress Across the World

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.