Mental health in tech workplace: An analysis

In recent years, there has been a significant research and analysis on the role of mental health in reaching global sustainable development goals. Employees are more likely to experience mental illnesses as a result of workplace stress. Mental illness can result in depression, personality disorders, phobias, anxiety disorders, mood disorders, psychotic disorders and a few more. In this study, we analyzed the Open Sourcing Mental Illness (OSMI) (osmihelp.org) Mental Health in Tech Survey dataset to determine the root causes of mental health disorders among the employees. Here, we looked at the severity of mental illness among working employees based on a variety of factors or attributes, including self-employment, mental health history in the employee's family, company offering benefits, whether the employee is receiving treatment for mental illness, and much more. We then attempted to build a fundamental machine learning model to predict whether an employee requires medical attention or not.


Introduction
The primary goal of this type of data analysis is to raise public awareness of mental illness in the workplace, which reduces the issues associated with mental diseases.In order to prevent any tragic events brought on by numerous variables in a working environment, this paper supports and provides advice regarding the causes of serious mental health behaviors.As a result, this gives a rough idea of how employees in tech businesses are impacted.With the use of this analysis, we can now respond to the concerns of whether and how one's physical and mental health while working are affected by external factors.In-depth analysis of the present status of mental health in the tech industry is provided in this study, along with recommendations for improving mental health and an examination of the origins and consequences of these problems.An April 2018 paper in the Journal of Occupational and Environmental Medicine found that after receiving treatment for depression, over 86% of workers reported better work performance and lower absenteeism rates.For employers, this means significant increases in productivity and retention.The IT company can start cultivating a culture of understanding and compassion by granting employees access to mental health benefits.Employers can make more effective use of their resources by using this model to understand employee mental health issues and offer benefits to those who qualify.This technique can assist in reducing the additional costs associated with giving mental health benefits to those who do not require them and using that money for the employee's other benefits instead.As a result, employee retention will eventually rise, increasing employee satisfaction.

Literature Review
One of the key uses of machine learning in the field of mental health is the detection and diagnosis of mental health problems in individuals.Moreover, it entails creating risk frameworks to forecast people's propensity for mental health problems, which can aid with early intervention [7,8,9].
Another recent study indicated that care for mental health is based primarily on self-assessment as mental illnesses are the outcomes of patients' behaviors.The study also demonstrated that predictive models could be used to identify a patient who requires relatively higher care and concern [10].
Moreover, models have been used to forecast mental health issues of technical workers.[11,12].The most important factors for predicting mental health disorders, according to these studies, include employees' prior mental health concerns and their family history of mental disease.
In the context of the IT industry, patterns of employee stress and the main stressors have been examined.[13].To assist organizations in understanding their employees' mental health and identifying any contributing variables, this study intends to provide forecasts on employee risk levels and mental health.We anticipate that these insights will increase employers' understanding and lead to workplace mental health treatments that will enhance their mental health.

Dataset
We used the Open Sourcing Mental Illness (OSMI) (osmihelp.org)Mental Health in Tech Survey dataset from Kaggle.The 2014 survey, which includes approximately 1254 responses to 23 questions about employees' attitudes about mental health, their perceptions of mental health in the workplace, their awareness of mental health, demographics, etc., intends to assess these attitudes among tech workers.

Proposed Methodology
A schematic diagram of the analytics pipeline used in this study is presented.

Pre-processing and Exploratory Data Analysis
The first step in the analytics pipeline is pre-processing the OSMI Mental Health in Tech Survey 2014 dataset.It included data cleaning (columns with over 70% missing values were dropped) and data manipulation.
Finally, we resorted to encoding categorical and ordinal variables to be amenable to apply various exploratory data analysis (EDA) techniques for feature selection and build predictive models.

Data Visualization
Data visualization was performed on the OSMI Mental Health in Tech Survey 2014 to understand and study the mental health scenario in workplaces and its impact on the employees' mental wellness.After gender & age manipulation lets view the distribution of Gender & Age.

Figure 2 Gender distribution & age distribution with respect to gender
In this exploratory data analysis, we will be answering some questions related to the factors(attributes) as per the dataset, which will be our insight.In each case we will be getting certain insights and ultimately can understand the important factors which are responsible for susceptibility of an employee to have mental illness & require treatment or medical attention.For this analysis the 'treatment' attribute of the dataset will be our target variable while building machine learning model.The attribute tells us whether the employee who is seeking for treatment for a mental health condition.The graph below shows that almost half of respondents of the survey are telling 'yes' & the other half is telling 'no'.

Age of the respondents seeking for treatment
In this chart, we can clearly see that both distributions are merging.So this won't be of much use for predicting classes.

Whether working in a tech company or self-employed
From the graph we found that the number of people who are self-employed are around 12%.Most of the people who responded to the survey belonged to the tech company.We also found that though there is a vast difference between people who are self-employed or not, the number of people who seek treatment in both the categories is more or less similar.Thus, we may conclude that whether a person is self-employed or not, does not largely affect whether he may or may not be seeking mental treatment.From the below graph we can see close to 40% of the respondents who said that they have a family history of mental illness, significantly wants to be medically treated rather than respondents who do not have a family history.This is acceptable, & generally people with a family history pay more attention to mental illness.A substantial risk factor for many mental health issues is family history.Thus, this is an important factor that has to be taken under consideration as it influences the behavior of the employees to a significant extent.

Interference of mental health condition, with work
The first graph concludes that around 48% of people say that sometimes work interferes with their mental health.Now 'Sometimes' is a really vague response, and more often these are the people who actually face a mental condition but are too shy or reluctant to choose the extreme category.In the second graph, we could see that the people who chose 'Sometimes' had the highest number of people who actually had a mental condition.Similar pattern was shown for the people who belonged to the 'Often' category.But what is more surprising to know is that even for people whose mental health has 'Never' interfered at work, a little group among them still want to get a treatment before it become a job stress.It can be triggered by a variety of reasons like the requirements of the job do not match the capabilities, resources or needs of the worker.

Whether they work remotely at least 50% of the time
From the charts we can see that around 70% of respondents don't work remotely.The number of individuals in both categories who seek treatment is more or less equal, and thus has little impact on our goal variable.

Figure 8
First graph shows the percentage of respondent working remotely and not work-ing remotely.Second graph shows the number of respondents from each category seeking for treatment

Employees' awareness of available mental health benefits
From the chart be-low we can see that around 38% of the respondents said that their employer pro-vided them with mental health benefits, whereas a significant number (32%) of them didn't even know whether they were provided with this benefits or not.According to the second graph, almost 63% of those who responded YES to mental health benefits claimed they were seeking medical attention.Surprisingly, the people who said NO for the mental health benefits provided by the company, close to 45% of them want to seek mental health treatment.

Figure 9
First graph shows the percentage of respondent's response regarding the fact whether the employer provide mental health benefits or not.The second graph shows the number of respondents who is seeking for treatment in each category

Employees' awareness of including mental health in employee wellness pro-gram
We can see from the graph that about 19% of the respondents' say YES and out of those 60% of employee wants to get treatment.One shocking revelation is that more than 65% of respondents say that there aren't any wellness programs pro-vided by their company.But close to half of those respondents want to get treatment, which means the company needs to fulfil its duty and provide it soon.

Figure 10
First graph shows the percentage of respondent's response to the question whether mental health is included in the employee wellness program.The second graph shows the number of respondents in the three category seeking for treatment

Employees' awareness of available anonymity protection by employers
Figure 11 The first graph shows the percentage of respondents' response as "Don't know", "Yes" & "No".The second graph shows the number of respondents falling in each cate-gory We can see from the chart that around 65% of the people were not aware whether anonymity was provided to them and 30% said yes to the provision of anonymity by the company.Looking at the second graph, we see that out of the people who answered yes to the provision of anonymity, around 60% of them were seeking help regarding their mental condition.The employee may believe that the company has maintained his or her privacy and can be trusted as a possible explanation for this.The most basic reason behind hiding this from the fellow workers can be showcased as a social stigma attached to mental health.

Whether it is easy to take medical leave for a mental health condition
We found that while close to 50% of the people answered that they did not know about it, surprisingly around 45% of those people sought help for their condition.A small percent of people (around 8%) said that it was very difficult for them to get leave for mental health and out of those, 75% of them sought for help.Employees who said it was 'somewhat easy' or 'very easy' to get leave, almost 50% of them sought for medical help.

Figure 12
First graph shows the percentage of respondents' response like "Don't know", "Somewhat easy", "Very easy", "Somewhat difficult" & "Very difficult".Second one shows the number of respondents seeking treatment from the five categories

Employees' level of comfort to discuss mental health issues with your co-workers:
We found that around 62% of the employees said that they might be comfortable discussing some type of mental problems with their co-workers, and out of them around 50% actually sought for medical help.20% of the employees believed that discussing mental health with their co-workers isn't a good option for them.

Figure 13
First graph shows the percentage of employees' responses like "Some of them", "No" & "Yes".The second one shows the number of employees seeking for treatment from the three categories

Employees' level of comfort to discuss mental health issues with supervisors:
Here, around 40% of the workers believe in sharing their mental health with their supervisors.This might be connected to how they perform, etc.According to the second graph, employees in each of the three categories were more or less equally likely to have really sought help for their mental health.

Figure 14
First graph shows the percentage of employees answered, "Yes", "No" & "Some of them".The second graph shows the number of employees seeking treatment from three categories

Fear to discuss mental health issues with employer
From the chart below we can see that 80% of the respondents believe that it is a good option to discuss their mental health with the future employer.This might not have been the case 15 years ago.While around 15% of the candidates seem confused about whether they should be discussing their mental conditions with the future employer or not & less than 5% think that it may not be a good option. .

Figure 15
The first graph shows the percentage of employees' response.The second one shows the number of employees seeking treatment from each category

Feeling whether employer takes mental health as seriously as physical health:
We can see from the graph that employees who think their company doesn't take mental health seriously or who are not sure, are more inclined to seek treatment than the other two categories.
Figure 16 The first one shows the percentage of employees in each category "Don't know", "Yes" & "No".The second graph shows the number of employees seeking treatment from each category

Any negative consequences for co-workers with mental health conditions in workplace
Almost 85% of people never heard of or observed co-workers having negative consequences for having mental health issues.Out of remaining people, who observed negative consequences for co-workers, 10% of them are seeking help.

Figure 17
The first graph shows the percentage of employees' response, positive & negative.The second one shows the number of employees seeking treatment from both the categories After exploratory data analysis & feature selection we will go forward for building a predictive machine learning model.

Prediction method
To predict whether the employees is susceptible to have mental health issues & treatment is required, different prediction models were implemented.
The predictions were obtained by classifying the employees into two classes namely: 'diagnosed for mental health issue' and 'not diagnosed for mental health issue'.The classification was done based on the target variable, treatment ('Has the employee being diagnosed with a mental health condition').70% of the data set was used for training and 30% for testing.
Models tested include the k-nearest neighbor (KNN) classifier, logistic regression, decision tree classifier, random forest, ADABoost, XGBoost and Gradient Boosting classifiers.In a supervised learning environment, these classifiers were chosen based on their usefulness as small-data machine learning models and the effective-ness of earlier efforts for similar understanding of the older OSMI data [11,12,13].

Predicting employees who require Mental Health Diagnosis
The performances of the classification models were evaluated using the metrics: Accuracy, Recall, Precision & F1 score.Precision, Recall and Accuracy are three metrics that are used to measure the performance of a machine learning algorithm.The performance metrics are as follows: The Precision is the ratio of true positives over the sum of false positives and true negatives.It is also known as positive predictive value.
Recall is the ratio of correctly predicted outcomes to all predictions.It is also known as sensitivity or specificity.
Accuracy is the ratio of correct predictions out of all predictions made by an algorithm.It can be calculated by dividing precision by recall or as 1 minus false negative rate (FNR) divided by false positive rate (FPR).
Where, TN = True Negative FP = False Positive FN = False Negative The F1-score combines these three metrics into one single metric that ranges from 0 to 1 and it takes into account both Precision and Recall.
We observe that XGBoost and Gradient Boosting classifiers have nearly comparable results and yield the highest predictive accuracies among the methods tested.These techniques also produce some of the best recall and precision results.We prefer a higher recall and think the Gradient Boosting Classifier is the best model for prediction because false positives may be preferable in the current application (more support provided to an employee perceived to be atrisk of a mental health issue) than failing to detect the presence of a mental health issue.

Important factors
Susceptibility to mental illness of an individual is influenced by various factors.

Figure 19 Correlation matrix
From the correlation matrix we found that work_interference, family_history & care_options are highly correlated positively.We can understand that work_interference has the largest contribution.The company should know whether the employee's mental health issues are interfering with the work or not.family_history and care_options (programs and benefits) provided by company is also influential in employees who want to get treatment.There has been a small contribution of each of the remaining features.Noticing or knowing some of these features before-hand can even help support an employee who may be experiencing a mental health issue and may provide them with the appropriate employee resources.

Discussion
Our emotional, psychological, and social well-being are all impacted by our mental health.It influences our thoughts, emotions, and behaviors.It also influences how we respond to stress and make decisions.
The present study with this dataset shows that, the most of the time employees mental health is affected by the interference of work.And they sought for treatment.Study by Graveling et al. examined the impact of various workplace interventions on mental well-being in workplace [30].family_history and care_options provided by the companies are also influential in employees who want to get treatment for mental illness.
In this paper we have used machine learning model to classify whether a particular employee of a company is having poor mental health condition and requires treatment or not.Gradient Boosting Classifier is the best model we found for the prediction.Hereby we can minimize the mental health issues among the employees of tech-companies by offering them resources to learn about mental health concerns and options for seeking help who are susceptible to mental illness.
Employers can also offer robust benefit packages to support employees who go through mental health issues.This covers EAPs (Employee Assistance Programs), wellness initiatives that prioritize both mental and physical health, disability and health benefits, as well as flexible working hours and leave plans.
Organizations must incorporate mental health awareness aid in the creation of a positive and effective work environment by lowering the stigma attached to mental illness, raising mental health literacy within the organization, and imparting the knowledge and abilities necessary to safely and responsibly resolve a co-worker's mental health concern.This can help pave the way for mental health concerns throughout our community.[15] Limitations & Future Work Given additional time, we would like to combine and examine the datasets from previous years' Mental Health in Tech Study.The year this data set was collected was 2014, so it would be interesting to see whether anything has changed since then.In order to determine whether attitudes about mental health issues fluctuate depending on the industry, we would also like to examine data from other sectors, such as the healthcare sector.

Conclusion
A worker's performance on the job, communication with co-workers, physical abilities, and daily functioning can all be significantly impacted by poor mental health.Loss of productivity is the result of all of this.Therefore, it is crucial that employees receive the care and assistance they require for their mental health issue.By openly discussing mental health illnesses and offering resources and benefits for mental health at work, employers must treat mental health with the same respect as physical health.According to the study of the Mental Health in Tech Survey data set, more needs to be done to educate the tech community about mental health issues and to provide assistance for employees who are dealing with mental illnesses.The OSMI provides training to employers and can assist in finding the appropriate services for supporting staff who are suffering with mental health concerns.

Disclosure of conflict of interest
No conflict of interest to be disclosed.

Figure 3
Figure 3 Percentage of respondents seeking for treatment Now let's go through the attributes one by one.

Figure 4
Figure 4 Age distribution where blue showing respondents who sought for treatment & red showing respondents who did not sought for treatment

Figure 5 Figure 6
Figure 5 First graph shows percentage of employment type (self-employment or working in tech companies) & second graph shows count of employees seeking treatment in both categories 3.4.3.Effect of having a family history of mental illness

Figure 7
Figure 7 First graph shows percentage of respondents showing their feeling as sometimes, never, rarely & often.The second chart is showing the number of respondents seeking treatment in respective categories

Table 1
Performance of classification models