Happiness Around the World

Posted on Aug 16, 2020

LinkedIn | Github |ShinyApp

Working as a solutions engineer in the technical services division for an electronic healthcare records company, a bulk of my success was measured by happiness of my customers. However, happiness is not always so easy to measure because everyone has different standards and situations. In this project, I aim to investigate the success of countries around the world by analyzing different factors that attribute to happiness among citizens of different parts of the world.

Data Overview

The data I used for this project was taken from World Happiness Report. Each country is given an overall happiness score for each year and the overall happiness score can be broken down into the following 6 categories:
- GDP per Capita
- Healthy Life Expectancy
- Freedom to Make Life Choices
- Generosity
- Perception of Corruption
- Social Support

A country is given a score for each of the 6 categories and each category score measures how that category improves people's lives compared to Dystopia. Dystopia is a hypothetical country with the lowest scores in all of the 6 categories. The overall score is the summation of the 6 category scores and a residual component called Dystopia Residual that reflect the extent to which the 6 variables over or under estimate the average score.


World Map

My shiny dashboard contains 2 main tabs: World Map and Explore. The World Map tab allows the user to select the year and categories to create a new overall score. The user input is reflected in the world map which shows a darker green for countries with higher scores. The actual data that drives the map is also shown in the bottom.

Overall Happiness Score 2019 World Map

This map shows that Americas, Europe, Australia and New Zealand have higher happiness score than Africa and Asia for the year 2019. Since everyone has different priorities that make their lives happy, users can choose the criteria that are most important for them and investigate how countries rank based on their individual preferences for happiness.


Let's zoom in to the explore page to investigate correlations and trends.

In the variables tab of the explore page, we can investigate which category scores are highly correlated with the overall score by selecting Happiness Score on the Y-axis and desired criteria to investigate on the X-axis.

Highest Correlated Categories

The three highest correlated categories with respect to the overall score are GDP per capita, healthy life expectancy and social support. This shows that countries that are happier due to GDP, healthy life expectancy and social support are more likely to be happier overall.

Lowest Correlated Categories

On the contrary, generosity, perception of corruption and freedom to make life choices were the lowest correlated categories. Therefore, having a high score for these categories does not necessarily lead to higher overall happiness.


On the trends tab, users can analyze which countries had the most increase or decrease in scores for a selected time range.

Top 5 Increasing and Decreasing Countries

The graphs above show top 5 increasing and decreasing countries from 2015 to 2019. With such trending information, countries can understand their current situation with respect to previous years and take actions to make their citizens happier or keep them happy. Further research can be done to analyze trends of happiness scores with factors that may contribute to happiness such as political stability, income disparity and incarceration rates.


Similar to the world map page, regions tab allows users to select criteria of their interest and group by the sub region or continent. A bar graph shows the aggregated score from user's input for each region and the data table is shown below.


Aggregate Scores by Continent

Our observations from the world map page that showed Americas, Oceania and Europe to be happier than Asia and Africa holds true according to the bar chart above.


Through this project, we identified the top 3 correlated categories for overall happiness score were GDP per capita, healthy life expectancy and social support. We also identified which countries were most increasing or decreasing in happiness. This information can serve as a foundation for  further analysis studying the cause of decrease or increase in happiness. Furthermore, we quantified that Americas and Oceania are the happiest continents above Europe, Asia and Africa. I hope you can use this dashboard to select criteria that are most important to you and see which countries or regions are happiest to your standards.

About Author


Brandon Ryu

Experienced Engineer who enjoys using strong research and technical background to guide healthcare software products that aim to improve patient care around the world. Strong interdisciplinary professional who focuses on collaborating with users, stakeholders and developers to drive...
View all posts by Brandon Ryu >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp