Using interactive visualizations to analyze suicide data

Anju Rajbangshi
Analytics Vidhya
Published in
6 min readJul 19, 2020

Table of content.

  1. Introduction
  2. Data Description
  3. Exploratory data analysis using plotly express
  4. Conclusion

1. Introduction

We often keep hearing about so many people committing suicide and the number of such cases keep rising every passing day. Also I read somewhere that “ Suicide or depression doesn’t end the pain. It passes on to someone else”. This is exactly what triggered me to look out for data related to suicide because I wanted to understand the trend and gain some insights about such mournful events.

Also, if you are a part of any public health organization, you may get the opportunity to work with with such projects to perform analysis and come up with various trends leading to suicides which could in turn give us some hope of helping the ones with suicidal thoughts.

2. Data Description

I have used a dataset from Kaggle which is also available in my github repository.

The dataset contains information about suicides in India that occurred between 2001–2012 and consists of below seven features:

  • State : Details of suicide data for each state.
  • Year: Details of suicide data for each year.
  • Type_code: Type code of suicide data which is subdivided into three categories — causes, means adopted and professional background of a person committing suicide.
  • Type: Type is a subset of type code which gives details about cause of suicide, means adopted for suicide and professional background at an individual level.
  • Gender : Gender of the person committing suicide(Male/Female).
  • Age_group: Age range of people committing suicide which is divided into five categories.
  • Total : Number of suicides.

3. Exploratory data analysis using plotly express

Finally we will dig into the main agenda of exploring our data using one of python’s best interactive visualization libraries known as Plotly Express which is a wrapper for Plotly.py.

Since the idea of this article is to visualize the data and understand the trends, I will not embed any code here but it is available in github which can be accessed without any hassle.

  • Let us see the suicide trend over the years from 2001 to 2012.

In the above plot, we can see the details of each year and the respective count of suicides which have grown exponentially over the years and isn’t a good sign and the count has a steep rise from the year 2009 to 2010.

The above pie chart shows us an increased suicide rate from 7.51% in 2001 to 9.36% in 2011.

  • Now, let us see the suicide trend for each of the states.

From the above plot, it is clearly visible that Maharashtra had the highest count of suicides and Lakshadweep had the lowest count.

  • Count of suicides per year in each age group for each gender.

In the above visualization, it is observed that the suicide count was higher in both the genders in the year 2011 in the age range of 30–44 in men and the range of 15–29 in female.

  • Count of suicides per state in each age group for each gender.

Age-Group: 0–44 ,15–29, 60+, 0–14 , 45–59

In the below visualization, we can clearly see that the size of the bubble gives the count of suicides. The bubble with the biggest size indicates the highest count. We can capture every minute detail about each of the states. And it is easier to distinguish the suicide counts for each gender in each of the states in each age group by the size of the bubble which increases or decreases accordingly as we toggle between the different age groups on the right side menu.

Age group of 15–29 is the most vulnerable age in all the states except Kerala.

  • Number of suicide counts in each state per Gender.

The below plot gives us details in a beautiful way about the count of suicides in each state for each of the genders which indicates that male suicide counts are 28% higher than the female count.

Also, it is clearly visible from the below visualization that Maharashtra had the highest count of suicides in the male category whereas West Bengal had the highest count of suicides in the female category.

  • Year wise suicide count in each state.

The below visualization will help us see the count of suicides for each year in each of the states by toggling between the different years on the year menu placed on the right side.

This will assist us in understanding which state had the highest count of suicides in which year, ultimately driving us to trace back and find out why each of these states had the highest suicide count in each particular year.

Also the markers in each individual line plot will give us the count for each of the states for that particular year which has been selected.

  • Reasons for committing suicides.

As seen above, while most of the causes are not known, the top most cause is family problems which affected more than 350K people. And two other major causes were Prolonged illness and mental illness.

Again, the below visualization shows us that irrespective of gender ,age group and year, in most of the states, family problems seem to be the top most reason for committing suicides.

  • Now let us have a peak into the granular level data and try to understand the causes of suicides due to family problems.
  • As we observed in the above visualization, irrespective of state and age group, most of the females who have committed suicides are house wives. Could it be early marriage, dowry dispute, domestic violence ? Also could financial dependence be one of the reasons ? Because in the other categories, the count of female suicide is comparatively lower and this definitely pinpoints the fact that girl education and women empowerment is very much necessary.
  • On the other hand, it is really sad to see highest count of farmers committing suicides compared to other professions followed by unemployed, private sector and self employed. Whereas public sector , government service have very less count of suicides. One of the reasons for high number of suicides in the farming, unemployed and private sector could be stress leading to depression.

4. Conclusion

Hence, we can conclude that plotly express and interactive graphs can provide us with a lot of important and meaningful insights in a very granular way.

--

--