This report visualizes the global happniess level across the world in year 2017, uncovers how happiness score changed from year 2016 to 2017, and discusses the factors that contribute to the happniess. To categorize the countries in a reasonable way for the happiness analysis, I looked into different indexes that measure different aspects of the countries. GNI per capita (The GNI per capita is the dollar value of a country’s final income in a year, divided by its population. It reflects the average income of a country’s citizens.) is chosen, because it’s intuitive that the citizens who earn more income are less likely to worry about living issues, and that being financially free also enables them to entertain with more abundant methods.
library(dplyr)
library(ggplot2)
library(ggalt)
library(readxl)
library(ggcorrplot)
library(rworldmap)
library(highcharter)
library(maps)
library(stringr)
To complete this report, I used two resources of data:
happy2016
and happy2017
- The is data publised by the World Happiness Report in 2016 and 2017.It contains the happiness scores and factors (GDP,Health,Family,etc.) that contribute to the happiness score for more than 155 countries. Structure of 2016 data:## 'data.frame': 157 obs. of 13 variables:
## $ Country : Factor w/ 157 levels "Afghanistan",..: 38 135 58 104 45 26 98 99 7 134 ...
## $ Region : Factor w/ 10 levels "Australia and New Zealand",..: 10 10 10 10 10 6 10 1 1 10 ...
## $ Happiness.Rank : int 1 2 3 4 5 6 7 8 9 10 ...
## $ Happiness.Score : num 7.53 7.51 7.5 7.5 7.41 ...
## $ Lower.Confidence.Interval : num 7.46 7.43 7.33 7.42 7.35 ...
## $ Upper.Confidence.Interval : num 7.59 7.59 7.67 7.58 7.47 ...
## $ Economy..GDP.per.Capita. : num 1.44 1.53 1.43 1.58 1.41 ...
## $ Family : num 1.16 1.15 1.18 1.13 1.13 ...
## $ Health..Life.Expectancy. : num 0.795 0.863 0.867 0.796 0.811 ...
## $ Freedom : num 0.579 0.586 0.566 0.596 0.571 ...
## $ Trust..Government.Corruption.: num 0.445 0.412 0.15 0.358 0.41 ...
## $ Generosity : num 0.362 0.281 0.477 0.379 0.255 ...
## $ Dystopia.Residual : num 2.74 2.69 2.83 2.66 2.83 ...
IncomeLevel
- Groups of countries based on the GNI per capita: “High Income”, “Upper Middle Income”, “Lower Middel Income”, and “Lower Income”.## Classes 'tbl_df', 'tbl' and 'data.frame': 217 obs. of 2 variables:
## $ IncomeGroup: chr "High income" "Low income" "Lower middle income" "Upper middle income" ...
## $ TableName : chr "Aruba" "Afghanistan" "Angola" "Albania" ...
The higher the score (greener in the map) is, the happier the country is. As it is shown by the map below, countries in the North America, Western Europe, Oceania and South America are overall happier than the rest of the world. Most of the countries in Africa have relatively low happiness scores.
Europe and North America are denses than the other continents at the top of each ‘violin’, indicating Enrope and North America are more likely to be made up with countries that have happiness score higher than 6.5. Africa, however is obviously below the average.
The following plot shows the countries whose happiness score increased from year 2016 to year 2017. The orange guide lines show the top 15 countries with the most significant increase.
The following plot shows the countries whose happiness score decreased from year 2016 to year 2017. The orange guide lines show the top 15 countries with the most significant decrease.
From this chapter, I will bring IncomeLevel
variable into the analysis to further understand how various factors contribute to the degree of happiness across the world.
The density plot shows a clear pattern that in general, the higher the income, the happier the citizens. It proves my hypothesis in the beginning.
The following plots are called diverging maps. It visualizes the degree of diverging away from the medium level of this group. Z_Score is calculated with the following formula
\[ z = (x – μ) / σ \]
High income countries in the Western Europe are among the happiest countries in the high income groups. However, high income countries (region) in Asia, and other parts of Europe are less happiler.
America Countries are the happiest among the upper middle income groups. China is below the medium level of upper middle income groups, and is less happier than Asian countries Russia,Turkey, Thailand and Malaysia.
In this chapter, we will discuss how differemt factors affecting the happiness level across the world.
Correlation Coefficient Explanation:
The factors that are highly correlated to happiness score include Economy (GDP per capital), Family, Health (Life Expectancy);Freedom and trust to the government have a moderate relationship with happiness.
Overall, GDP could drive the happiness directly.
Family has impact on happiness across all income groups, but the impact gets stronger (slope is greater) with the increase of the income level.
Freedom consistantly contribute to the happiness across all the countries.
In the previous chapter, generosity is found to have very weak correlation with the happiness score. However, the generosity shows strong correlation within the high income and upper middle income group.
High Income countries’ happiness is responsive to almost every factors.