Analytics & Visualization Python

Analytic Report Women Legal Rights

Dataset: Women, Business and the Law 2019

The dataset is provided by World Bank Group, it contains questions regarding laws and regulations to identify legal gender differentiation. Data represent 187 countries divided into 7 regions, from 2009 to 2018.

For instance, Can a woman legally travel outside her home in the same way as a man? Is a married woman not legally required to obey her husband? and Can a woman legally open a bank account in the same way as a man? are 3 of the 35 questions into the dataset. All the questions just can be answered with Yes or No. Every “No” answer indicates that there is a regulation or law that treats men and women unequally.

Indicator scores are obtained by calculating the unweighted average of the questions within that indicator and scaling the result to 100. Overall scores are then calculated by taking the average of each indicator, with 100 representing the highest possible score.

Questions to answer

The objective of this project is to answer the following questions to discover how much progress there has had during the last decade regarding legal women’s rights around the world.

  • Has there been any progress in Human Legal Rights since 2009?
  • How much progress have countries had in the last decade regarding Human Legal Rights?
  • What is the region with the most significant changes in laws and regulations?
  • What is the region with minimum or null changes on laws and regulations?
  • What is the category with the most significant changes in laws and regulations?
  • What is the category with minimum or null changes on laws and regulations?
  • What are the top 15 countries with the highest scores on Human’s Legal Rights?
  • What are the top 15 countries with the lowest scores on Human’s Legal Rights?
  • Is there any question in the dataset with no changes since 2009?

Loading Libraries and Dataset

The dataset was retrieved on April 23, 2019 from: https://development-data-hub-s3-public.s3.amazonaws.com/ddhfiles/139390/wbl2019paneldata.xlsx

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# Reading from a csv file
df = pd.read_csv('WBL2019.csv')

Analyzing Data

Summary Statistics from the dataset:

  • Mean of Global Score per Year from All Countries
  • Mean of Global Score per Year per Region
  • Comparison of Means of Global Score per Regions (2009 vs 2018)
  • Comparison of Means of Global Score per Category (2009 vs 2018)
  • A Set of Summary Statistics of Main Variables.

Mean of Global Score per Year from All Countries

# Getting the mean of global score per year from all countries 

global_index_mean = df[['WBL_INDEX','reportyr']].groupby('reportyr').mean()

plt.plot(global_index_mean)
plt.ylim([0,100])
plt.title('Global Score Per Year - All Countries')
print(round(global_index_mean,2))
plt.show()

Comparison of Means of Global Score per Regions (2009 vs 2018)

# Function that returns a dataframe with data from a specific year
def create_column(yr,column,new_column):
    lgg_y = df[df.reportyr == yr][['economy','Region',column]]
    lgg_y.rename(columns={column : new_column + '_' + str(yr)},inplace=True)
    return lgg_y

lgg_2009 = create_column(2009,'WBL_INDEX','WBL')
lgg_2018 = create_column(2018,'WBL_INDEX','WBL')

# Creating a new dataframe 
# lgg = legally_gender_gap

lgg = pd.merge(lgg_2009, lgg_2018)
lgg['diff_decade'] = lgg['WBL_2018'] - lgg['WBL_2009']

x = lgg[['Region','WBL_2009','WBL_2018','diff_decade']].groupby('Region').mean().sort_values(by='diff_decade', ascending=True)
x.plot(kind='barh', title='Global Score Comparison per Regions (2009 vs 2018)')

print(x)

Comparison of Means of Global Score per Category (2009 vs 2018)

x = df[df.reportyr == 2009][['GOING_PLACES','STARTING_A_JOB','GETTING_PAID',
                             'GETTING_MARRIED','HAVING_CHILDREN','RUNNING_A_BUSINESS',
                             'MANAGING_ASSETS','GETTING_A_PENSION']].mean()SINESS',
                             'MANAGING_ASSETS','GETTING_A_PENSION']].mean()

y = df[df.reportyr == 2018][['GOING_PLACES','STARTING_A_JOB','GETTING_PAID',
                             'GETTING_MARRIED','HAVING_CHILDREN','RUNNING_A_BUSINESS',
                             'MANAGING_ASSETS','GETTING_A_PENSION']].mean()

plt.plot(x,'o',color='blue',linewidth=2.0)
plt.plot(y,'o',color='red')
plt.ylim([30,100])
plt.ylabel('Score')
plt.title('Comparison of Scores per Category (2009 vs 2018)')
plt.legend(('2009','2018'),loc='upper right')

# rotate axis labels
plt.setp(plt.gca().get_xticklabels(), rotation=45, horizontalalignment='right')
plt.show()

During this project there has had some other calculations and visualizations to be able to answer the questions I defined at the top of this page. If you want to see the details of visualizations, I invite you to visit my GitHub Repo, where you can find the details of this project.

Answering Questions

  • Has there been any progress in Women’s Legal Rights since 2009? Yes
  • How much progress have countries had in the last decade? In the last decade, the average global score increased from 70.06 to 74.71 (100 is the maximum score)
  • What is the region with the most significant changes in laws and regulations? South Asia
  • What is the region with minimum changes in laws and regulations? Middle East & North Africa
  • What is the category with the most significant changes in laws and regulations? Starting a Job
  • What is the category with minimum changes in laws and regulations? Managing Assets
  • What are the top 15 countries with the highest scores on Women’s Legal Rights? Belgium, Denmark, France, Latvia, Luxembourg, Sweden, Austria, Canada, Estonia, Finland, Greece, Ireland, Portugal, Spain, and United Kingdom.
  • What are the top 15 countries with the lowest scores on Women’s Legal Rights? Saudi Arabia, Sudan, United Arab Emirates, Iran, Islamic Republic, Qatar, Syrian Arab Republic, Jordan, Kuwait, Guinea-Bissau, Bahrain, Afghanistan, Iraq, Mauritania, Oman, and South Sudan.
  • Is there any indicator (question) with no changes since 2009? Yes, there are two questions: Can a woman legally travel outside her home in the same way as a man? and Does the law provide for the valuation of nonmonetary contributions? with no changes since 2009.

Conclusions

It is true there has been some progress in the last 9 years trying to close the legal gender gap around the world but it is also true that the gap is still there, in most of countries.

Important findings:

  • Only 6 of 187 countries, women and men are legally treated equally
  • Just 3% of the countries have laws or regulations for human beings, no matter the gender
  • 97% of the countries still have a legal gender gap, small and huge gaps. The legal gender gap must disappear
  • The lowest score found was 25.63. It is evident there is a lot of work to do it to close the gap

Further Reserach: Using same dataset, can I predict the year when legal gender gap disappear in every category, in every country, in all the regions?

There is not a single reason to grant any kind of privileges to someone just because it was born as a girl or as a boy.