What is Quadrant Analysis & How to do it in Python | by Abhijith Chandradas | Towards Data Science

A Quadrant Analysis chart is a very common tool used for decision making especially in business setting.A Quadrant chart is technically a scatter plot that is divided into four sections or quadrants, hence the name. In a quadrant analysis, performance under two parameters are assessed for each entity. Depending on how an entity performs under either of the KPIs, the entity is grouped into either of the quadrants. After identifying which quadrant the entity belongs to, actions can be taken to improve performance under relevant KPIs.
Preparation of Quadrant Analysis in data visualization tools like Power BI and Tableau are very straight forward. However the process is not so straight-forward in python.
We will use some KPIs from Human Development Index published by the United Nations Development Program, the full kaggle dataset can be accessed here.
Our data set consists of the following data:i. Country : Country Nameii. hdi : Human Development Indexiii. life_ex : Life Expectancy at Birthiv. gni_pc: Gross National Income (GNI) per Capita
There are three components for a Quadrant Analysis Chart:
i. AxisThe parameters(KPIs) the data is plotted in the graph based on are defined in the X and Y-axes. We will perform a quadrant analysis on how the G-20 nations are performing with respect to two KPIs:i. Gross National Income (GNI) per Capitaii. Life Expectancy at BirthX-axis represents the Gross National Income (GNI) per Capita and Y-axis represents the Life Expectancy at Birth, the data will be plotted to the appropriate quadrant based on these two metrics.
ii. BenchmarkThe threshold limit for the X and Y-axes can be defined as the Benchmark.This splits the axis into four quadrants. When profitability, growth, improvement etc. are considered y-o-y basis, generally ‘0’ is used as an objective benchmark. In some situations where relative comparison is required, mean or median values can also be used as benchmark.We will use mean values of KPIs as benchmarks.
iii. GroupingGrouping specifies how you want to group the data that is measured on the X and Y-axes. In our example the only grouping possible is country-wise. If other data is available, viz- Continent wise, Language wise or some other specific category, it can also used for grouping depending on the use case.
Preparing scatter plot with Gross National Income (GNI) per Capita as X-axis and Life Expectancy at Birth as Y-axis.Country Labels are also added to the scatter plot.
You can refer the following article on how to add labels to a scatter plot.
towardsdatascience.com
plt.figure(figsize=(12,8))sns.scatterplot(data=hdi_df, x='gni_pc', y='life_ex')plt.title(f"G 20 Countries : {abbr['gni_pc']} vs {abbr['life_ex']}")plt.xlabel(abbr['gni_pc'])plt.ylabel(abbr['life_ex'])          for i in range(hdi_df.shape[0]):          plt.text(hdi_df.gni_pc[i], y=hdi_df.life_ex[i], s=hdi_df.Country[i], alpha=0.8)plt.show()
The scatter plot can be converted into a Quadrant Analysis chart by adding the benchmark lines which divide the chart into 4 quadrants. The quadrants as labelled as Q1, Q2, Q3 and Q4 for later reference.Vertical and Horizontal lines corresponding to the mean values of KPIs on x-axis and y-axis respectively are added to the scatter plot.
Once the data is grouped into 4 quadrants, the groups can be analyzed depending on the use case. It can be used to find the profitable products, most productive worker, backward states etc. Once the quadrant of the entity is determined, concrete action can be taken to improve its KPIs to desirable level.
G-20 countries are grouped into 4 quadrants as shown above.The horizontal dotted line represents mean Life expectancy and the vertical one represents mean Gross National Income per capita.
Q1: GNI per capita > mean and Life expectancy > meanQ2: GNI per capita < mean and Life expectancy > meanQ3: GNI per capita < mean and Life expectancy < meanQ4: GNI per capita > mean and Life expectancy < mean
Countries in Q1 are performing better than the rest under bot the KPIs. Every country’s aim should be to reach Q1. (Thats my assumption)Mexico, in Q2 has life expectancy better than the mean value, however the country has to improve the GNI per capita.Countries in Q3 lags behind under both the parameters, these countries have to take concrete steps to improve to the standards of developed Nations.Saudi Arabia in Q4 has high per capita income but fares below average in terms of life expectancy. The country has to identify the factors affecting its citizens life expectancy and address them to reach Q1.
The notebook for this article is available in my Git Repo.
I hope you like the article, I would highly recommend signing up for Medium Membership to read more articles by me or stories by thousands of other authors on variety of topics. Your membership fee directly supports me and other writers you read. You’ll also get full access to every story on Medium.
towardsdatascience.com
medium.datadriveninvestor.com
medium.com
You can check out the following article from my EPL Prediction series where I have used Quadrant Analysis to compare football teams based of xG Scored and xG conceded