← All projects

What Makes a Country Happy?

Which factors move a country’s happiness score?

Real-world dataSocietyPythonpandasSeabornMatplotlib
158countries
0.78correlation with GDP per capita
0.57correlation with freedom

The question

The World Happiness Report ranks countries on a single score. I tested which measurable factors line up with it.

What I did

Cleaned the survey table and counted countries by region.
Built a correlation matrix across economy, health, family, freedom and trust.
Plotted the strongest relationships and compared regional averages.

What I found

GDP per capita has the strongest link to happiness (r = 0.78). Life expectancy and family support follow.
Freedom to make life choices shows a moderate link (r = 0.57).
Regions differ clearly in both happiness and GDP per capita.

Charts from the analysis

Correlation heatmap.
Correlation heatmap.
Happiness score against GDP per capita.
Happiness score against GDP per capita.
Happiness and GDP by region.
Happiness and GDP by region.

Limits to keep in mind

Real-world data

Correlation does not show cause. Rich countries differ from poorer ones in many ways beyond income.

View the code on GitHub ↗
← PreviousDr. Semmelweis and HandwashingNext →The Android App Market