Economic Freedom & Macro-Economic Prosperity

Posted on Jul 3, 2022

The skills the author demonstrated here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.


Economic freedom is the fundamental right of every human to control his or her own labor and property. The Economic Freedom Index is an annual index and ranking created in 1995 by that measures the degree of economic freedom in the world's nations. Why should we care? Countries that score higher in the Index also perform higher in three key areas, income per capita, social progress, and democratic governance. In addition to enjoying more elevated levels of economic prosperity, people in these free societies live longer, have better health, are more educated, and are better protectors of the environment.

The Index is composed of 12 different factors, each grouped into respective categories. Considerations include the rule of law referring to property rights and freedom from corruption, government size, which relates to tax burden and government spending, regulatory efficiency, having to do with business, labor, and monetary freedom, and open markets, related to the country's trade, investment, and financial freedom. 

The Index is composed of 12 different factors, each grouped into respective categories. Considerations include the rule of law referring to property rights, business, labor, and monetary freedom, and open markets, which are related to the country's trade, investment, and financial freedom. Government size and freedom from corruption are also considered, as it has a bearing on government spending, regulatory efficiency, and the citizens' tax burden. 

Research question

This analysis aims to answer three research questions:

  1. Which regions and countries have the highest level of economic freedom, and which have the lowest level of economic freedom?
  2. Does financial freedom translate into greater economic prosperity?
  3. What are the key factors that most affect a country's ranking worldwide?

Economic Freedom Dataset

The dataset was imported directly from the Heritage Economic Freedom Index website with historical Index information from 2017 to 2022 and macroeconomic data for each country. The dataset includes features such as the country name, region, freedom score, and macro-economic data such as GDP, GDP per capita, inflation, etc. Feature generation was used to create new features such as the change in Freedom score over time, grouping the 12 features, and segmenting the freedom scores into quartiles. The final dataset includes 988 rows and 47 columns.

Analysis of Economic Freedom

To begin the analysis, a box plot was created to observe the disparity of Freedom Scores per country between the five regions. We can identify the regions on the X-axis and the Y-axis, the economic freedom score. As we can see from the plot, Europe seems to have the highest mean Freedom score with few outliers. At the same time, Sub-Saharan Africa appears to be the region with the lowest mean Economic Freedom score but does demonstrate some outliers in the upper and lower bounds.

economic freedom

Figure 1 - Disparity of Scores per Region

To understand the state of the world's highest and lowest ranking countries in terms of Economic Freedom, the top five and bottom five countries were plotted in bar plots with country names on the X-axis, and the mean score from 2017 to 2022, given by Heritage's EFI Index, on the Y-axis. Singapore, New Zealand, and Switzerland form the top three highest-scoring countries, while Venezuela, Eritrea, and The Republic of Congo have the lowest mean Freedom score.

economic freedom

Figure 2 - Highest Mean Scoring Countries

economic freedom

Figure 3 - Lowest Mean Scoring Countries


After analyzing the world's leaders in Economic Freedom, I wanted to investigate which countries in the Americas have a high score and which do not. Canada seems to be the region leader, and the United States is close behind in third place. In contrast, countries in Latin America - Venezuela, Bolivia, and Suriname - have the lowest levels of economic freedom.

Figure 4 - Highest Ranking Countries in the Americas

Figure 5 - Lowest Ranking Countries in the Americas


After analyzing the current state of Economic Freedom, it was essential to distinguish which countries have had the most significant change in their Economic Freedom from 2017 to 2022. By doing so, an analysis can be done to see where the nations most improved or regressed regarding Economic Freedom. The plots have the country name on the X-axis, and its transformation in Economic Freedom score from 2017 to 2022 on the Y-Axis. The graph shows which countries have grown the most freedom-wise: Barbados, Slovenia, and Samoa. In contrast, Sudan, Burundi, and Rwanda are the countries that have regressed significantly.

Figure 6 - Rising Nations

Figure 7 - Falling Nations


To better understand the rise and fall of Barbados and Sudan, I analyzed their four freedom categories and saw what went well and what went wrong. In figure 8, we can see the respective country scores from 2017 to 2022, with the years on the X and their respective freedom scores on the Y. Figure 9 is a table that describes the increase and decrease of their freedom categories from 2017 to 2022. Barbados' most significant gains were in its Rule of Law and Government size, leading to an overall increase of its freedom score to 71.3, from 54.5. As for Sudan, its significant decreases were in Regulatory Efficiency and Government Size, which went down 16.7, from 48.7 to 32.

Figure 8 - Barbados & Sudan Change in Score

Figure 9 - Changes in Economic Freedom Barbados & Sudan


After analyzing the countries and regions with the highest and lowest level of economic freedom, I moved on to the project's second research question, "Does Economic Freedom translate into greater economic prosperity?". To answer this question, I first plotted a scatterplot with GDP per capita on the X-axis and Economic Freedom score on the Y.

Figure 10 - GDP per Capita vs. Economic Freedom Score


I built a multiple linear regression with GDP per Capita as the dependent variable to measure the relationship between GDP per Capita and the four categories of Economic Freedom (Rule of Law, Regulatory Efficiency, Government Size, and Open Markets). After running the regression once, I observed that the Open Markets category did not have a statistical significance concerning GDP per Capita, so I removed it from the model. Now, we can see the remaining variables have a p-value lower than 0.05 and a model with an adjusted r-squared of 0.5657. By holding all other variables constant, we can see that for one increase in score, the GDP per capita could increase by 705.52.

Figure 11 - Multiple Linear Regression GDP per Capita


Once I could determine which categories most affected economic prosperity, I moved on to answer the project's final research question concerning factors and world rankings. To do so, I created another multiple linear regression model to analyze the relationship between the world rank of a country and the 12 factors of Economic Freedom. Figure 12 describes the summary of the model and the remaining statistically significant factors with a p-value lower than 5% and sorted by their coefficients.

As we can see, property rights seem to have the most substantial effect on a country's rank if the remaining factors remain constant. Since a lower rank is desired, for each point in property rights, the overall rank of a country goes down by 0.626. As a reminder, the property rights component assesses individuals' ability to accumulate private property secured by clear laws fully enforced by the state. It measures the degree to which a country's laws protect private property rights and the degree to which its government enforces those laws.

Figure 12 - Multiple Linear Regression Table with Economic Freedom Factors


Figure 13 - Property Rights vs. Score


We succeeded in answering our questions. Europe has the highest mean score of Economic Freedom of the five regions, while Sub-Saharan Africa has the lowest. Singapore ranked the highest in Economic Freedom, and Venezuela ranked lowest. There is a correlation between economic freedom and greater economic prosperity. This could be concluded from our first Multiple Linear Regression table demonstrating a positive relationship between Score and GDP per Capita. Finally, as we saw in our second linear regression summary, property rights, trade freedom, and investment freedom have the most substantial impact.

Future Work

As for future work, I would've liked to incorporate more metrics such as the Happiness Index and the Gini score of a country to see if they also impact Economic Freedom. I'd also like to analyze the trends over time for each region and see the 4 Freedom categories for respective countries visualized with a Shiny app. And finally, I would like to use different machine learning models, other than linear regression, that could help predict a country's score based on all factors included. 

About Author

Joaquin Gomez

Data Scientist with Masters in Business Administration. Highly motivated to combine interdisciplinary skillset with a passion for Data Analytics to solve modern-day business issues. Capable of creating, manipulating, and deploying Machine Learning models using Python, R, and SQL...
View all posts by Joaquin Gomez >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans 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 boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis 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 seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI