Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 World Happiness Index Analysis

A comprehensive data analysis project examining 10 years (2015–2024) of World Happiness Report data across 175 countries and 10 global regions, combining Exploratory Data Analysis with Machine Learning to uncover what truly drives national happiness.


📋 Table of Contents


Overview

This project analyzes the World Happiness Report — an annual publication by the UN Sustainable Development Solutions Network — to understand:

  • What factors most strongly predict national happiness?
  • How do happiness levels vary across regions and over time?
  • Where does India stand, and what can be improved?

The analysis combines statistical EDA (correlation analysis, distribution analysis, regional comparisons) with Machine Learning (Linear Regression & Random Forest) to validate findings from multiple angles.


Dataset

Attribute Detail
Source World Happiness Report (Gallup World Poll)
Records 1,502
Countries 175
Regions 10
Time Span 2015 – 2024
Features 11 columns

Features

Feature Description
Happiness Score Overall happiness rating
GDP per Capita Economic output per person
Social Support Having someone to count on
Healthy Life Expectancy Expected years of healthy life
Freedom to Make Life Choices Perceived personal freedom
Generosity Willingness to donate
Perceptions of Corruption Trust in government & business

Project Structure

World-Happiness-Index-Analysis/
├── data/
│   └── world_happiness_combined.xlsx     # Source dataset
├── notebook/
│   └── world_happiness_analysis.ipynb    # Complete analysis notebook
├── presentation/
│   └── Keshav Agarwal_1000.pptx         # PowerPoint presentation
├── report/
│   ├── World_Happiness_Analysis_Report.pdf  # Detailed PDF report
│   └── charts/                           # 17 exported visualizations
│       ├── 01_distribution.png
│       ├── 02_region_avg.png
│       ├── ...
│       └── 17_india_factors_trend.png
├── .gitignore
└── README.md

Methodology

Raw Data (Excel)
    → Data Cleaning (3 missing values fixed via Mode imputation)
    → Univariate Analysis (distributions, box plots)
    → Bivariate Analysis (correlations, scatter plots)
    → Regional Analysis (trends, comparisons)
    → India Deep Dive (benchmarking, factor decomposition)
    → Machine Learning (Linear Regression + Random Forest)
    → Conclusions & Report

Data Cleaning

  • 3 missing values in Regional indicator for Greece, Cyprus, and Gambia
  • Fixed using Mode imputation (most frequent region from other years)
  • Zero duplicates confirmed; data integrity verified

Key Findings

  1. GDP per Capita is the strongest predictor of happiness — confirmed by both correlation analysis and ML feature importance
  2. Social Support is the second strongest predictor — community bonds matter enormously
  3. Nordic countries (Finland, Denmark, Norway) consistently dominate the top rankings
  4. Sub-Saharan Africa consistently ranks lowest
  5. Latin America scores higher than GDP would predict — suggesting unmeasured cultural factors
  6. Generosity and Corruption Perception have the weakest influence on happiness

Machine Learning

Two models were trained to predict Happiness Score from the 6 contributing factors:

Model Purpose
Linear Regression Baseline — interpretable, outputs feature coefficients
Random Forest Regressor Advanced — captures non-linear patterns, outputs feature importance
  • Data Split: 80% train / 20% test (random_state=42)
  • Metrics: R² Score, MAE, RMSE
  • Result: Random Forest outperforms Linear Regression, confirming non-linear relationships between factors
  • Feature Importance: GDP per Capita > Social Support > Health > Freedom > Corruption > Generosity

India Deep Dive

  • India consistently ranks in the lower half among 175 countries
  • Happiness score falls below the global average but near the South Asia average
  • GDP per Capita is a relative strength vs. South Asian neighbors
  • Social Support and Freedom are the weakest factors dragging India's score down
  • Economic growth alone has not translated into proportional citizen happiness

Tech Stack

Tool Purpose
Python 3 Programming language
Jupyter Notebook Interactive analysis
pandas Data manipulation
numpy Numerical computing
matplotlib Visualization
seaborn Statistical visualization
scikit-learn Machine Learning (LinearRegression, RandomForestRegressor)

How to Run

  1. Clone the repository

    git clone https://github.com/KeshavAg08/World-Happiness-Index-Analysis.git
    cd World-Happiness-Index-Analysis
  2. Install dependencies

    pip install pandas numpy matplotlib seaborn scikit-learn openpyxl
  3. Open the notebook

    jupyter notebook notebook/world_happiness_analysis.ipynb
  4. Run all cells to reproduce the analysis and generate charts


Visualizations

The project generates 17 charts covering:

Charts Content
01–02 Score distribution, regional averages
03–04 Top 10 and Bottom 10 countries
05 Global happiness trend over time
06–08 Correlation heatmap, feature importance, GDP scatter
09–12 India: trend, comparison, neighbors, factors
13–14 Regional trends and box plots
15–17 Feature distributions, box plots, India factor trends

Author

Keshav Agarwal

About

Comprehensive analysis of World Happiness Report data (2015–2024) across 175 countries. Combines EDA, correlation analysis, India deep dive, and ML (Linear Regression + Random Forest) to identify what drives national happiness.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages