Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.

Original


Source: Happiness score including 6 variables by western European countries (2016).


Objective

The UN has published the World Happiness Report from 2012 and this original visualisation is presented in the 4th report of 2016. The World Happiness Report 2016 includes the happiness scores evaluated by 7 factors, economic (GDP per Capita), family, health (life expectancy), freedom, generosity, trust (government Corruption) and Dystopia residual, in 156 countries. Although this visualisation shows 21 western European countries.

  • ‘Dystopia Residuals’ attribute: This attribute contains Dystopia and residual values. The purpose of creating Dystopia is to have a benchmark against which all countries can be favourably compared in terms of each of the six key factors since Dystopia is an imaginary country containing the world’s least-happy people. This means that Dystopia is characterized by the lowest scores for the 6 factors. Every country has different residuals, reflecting the extent to which the 6 factors either over or under explain average 2014-2016 life evaluations. Sometimes these residual values are exceeding 1 on the scale from 0 to 10, but they are smaller than the calculated value in Dystopia, so the average value of ‘Dystopia Residuals’ is around 1.85 + residual value.

This happiness index and subjective well-being including 7 attributes can be used as key indicators of the quality of human development. In addition, health organization, governments and local communities are able to implement new policies for people to live a better life by utilising the world happiness reports.

The visualisation chosen had the following three main issues:

  1. Data integrity - One of the attributes, ‘economy’, was not represented despite containing sufficient data of the 21 countries. In addition, the ‘Dystopia residual’ attribute is not used in this visualisation even though ‘Dystopia residual’ is one of the 7 attributes.
  2. Colour issues - It is very difficult to analyse the data for each country since the colour used is similar for many countries.
  3. Country rank and happiness score are missing - This visualisation should show the order of each country based on their happiness score. This makes it difficult to compare the social-economic and well-being factors. The author draws conclusions of happiness when happiness is not shown in the visualisation. If the author wishes to reference this, happiness rank should be included.

Reference

Code

The following code was used to fix the issues identified in the original.

setwd("D:/RMIT/2021_1st semester/MATH2270 Data Visualisation & Comm/Assignment/Assignment2")
library(ggplot2)
library(dplyr)
library(tidyr)
library(forcats)
library(extrafont)

Happiness<-read.csv("2016.csv")
West_EU<-Happiness%>%filter(Region=='Western Europe')

head(West_EU)
##       Country         Region Happiness.Rank Happiness.Score
## 1     Denmark Western Europe              1           7.526
## 2 Switzerland Western Europe              2           7.509
## 3     Iceland Western Europe              3           7.501
## 4      Norway Western Europe              4           7.498
## 5     Finland Western Europe              5           7.413
## 6 Netherlands Western Europe              7           7.339
##   Lower.Confidence.Interval Upper.Confidence.Interval Economy..GDP.per.Capita.
## 1                     7.460                     7.592                  1.44178
## 2                     7.428                     7.590                  1.52733
## 3                     7.333                     7.669                  1.42666
## 4                     7.421                     7.575                  1.57744
## 5                     7.351                     7.475                  1.40598
## 6                     7.284                     7.394                  1.46468
##    Family Health..Life.Expectancy. Freedom Trust..Government.Corruption.
## 1 1.16374                  0.79504 0.57941                       0.44453
## 2 1.14524                  0.86303 0.58557                       0.41203
## 3 1.18326                  0.86733 0.56624                       0.14975
## 4 1.12690                  0.79579 0.59609                       0.35776
## 5 1.13464                  0.81091 0.57104                       0.41004
## 6 1.02912                  0.81231 0.55211                       0.29927
##   Generosity Dystopia.Residual
## 1    0.36171           2.73939
## 2    0.28083           2.69463
## 3    0.47678           2.83137
## 4    0.37895           2.66465
## 5    0.25492           2.82596
## 6    0.47416           2.70749
colnames(West_EU)
##  [1] "Country"                       "Region"                       
##  [3] "Happiness.Rank"                "Happiness.Score"              
##  [5] "Lower.Confidence.Interval"     "Upper.Confidence.Interval"    
##  [7] "Economy..GDP.per.Capita."      "Family"                       
##  [9] "Health..Life.Expectancy."      "Freedom"                      
## [11] "Trust..Government.Corruption." "Generosity"                   
## [13] "Dystopia.Residual"
west_EU<-West_EU[,-which(names(West_EU) %in% c("Region","Happiness.Score","Lower.Confidence.Interval","Upper.Confidence.Interval"))]
colnames(west_EU)
## [1] "Country"                       "Happiness.Rank"               
## [3] "Economy..GDP.per.Capita."      "Family"                       
## [5] "Health..Life.Expectancy."      "Freedom"                      
## [7] "Trust..Government.Corruption." "Generosity"                   
## [9] "Dystopia.Residual"
country<-west_EU[c(order(-west_EU$Happiness.Rank, decreasing=FALSE)),]
country<-country$Country

west_EU<-gather(west_EU, "Attribute", "Score", 3:9)
west_EU<-west_EU[c(order(-west_EU$Happiness.Rank, decreasing=FALSE)),]

table(west_EU$Attribute)
## 
##             Dystopia.Residual      Economy..GDP.per.Capita. 
##                            21                            21 
##                        Family                       Freedom 
##                            21                            21 
##                    Generosity      Health..Life.Expectancy. 
##                            21                            21 
## Trust..Government.Corruption. 
##                            21
west_EU$Attribute<-fct_collapse(west_EU$Attribute,
                               Dystopia_Residual="Dystopia.Residual",
                               Economy="Economy..GDP.per.Capita.",
                               Family="Family",
                               Freedom="Freedom",
                               Generosity="Generosity",
                               Health="Health..Life.Expectancy.",
                               Trust="Trust..Government.Corruption.")

west_EU$Country<-factor(west_EU$Country,levels=country)
west_EU$Country<-fct_collapse(west_EU$Country,
                               UK="United Kingdom")
                               
g<-ggplot(west_EU,aes(x=Country, y=Score))

g1<-g+geom_col(aes(fill=Attribute), width=0.7, colour="black")+
        geom_text(aes(label=Happiness.Rank, y=0),
                  fill="grey", hjust="top", family="Arial")+
  coord_flip()

background <- "#EFF1F0"
pal <- c("#A7CECB",
         "#8BA6A9",
         "#75704E",
         "#CACC90",
         "#F4EBBE",
         "#FDE74C",
         "#D7907B"
)


g2<-g1+theme_gray() + 
        scale_fill_manual(values = pal) +
        theme(plot.background = element_rect(fill = background),
              panel.background = element_rect(fill = background),
              legend.background = element_rect(fill = background),
              text=element_text(family="Arial"),
              title = element_text(face = "bold"))
g2<-g2+labs(x="Country", y="Happiness score",
       title="Happiness score of western European countries by attribute",
       caption="Source: World Happiness Report (2016)")

Data Reference

Reconstruction

The following plot fixes the main issues in the original.