Diabetes in Singapore. What are the factors affecting diabetes.
It was the 2017 national day rally speech by Prime Minister Mr Lee Hsien Loong that caught the nation’s attention. Diabetes is going to affect many people in Singapore. The news were sobering, 3 in 10 singaporeans will get diabetes. Ministry of Health in 2014 reported there are 440,000 people with diabetes. It is projected to go up to 1 million people by 2050.

What are the factors affecting diabetes? For this analysis, I did a data extraction from kaggle, an online platform which contains many datasets. The data is a study on diabetes from a hospital in Germany. Total data contains 2000 rows and 9 columns of data. Classification of the data shows 35% has diabetes and 65% is without diabetes. To analyse the data, we have to do feature importance to determine what are the key factors affecting diabetes.

Chart 1 shows the factors affecting diabetes are glucose, body mass index (i.e BMI), Age, diabetes pedigree function (i.e inheritance), blood pressure, pregnancies, insulin and skin thickness. To understand the correlation between the factors, we have to check on the heatmap. See below.

Heatmap shows there is no correlation among the factors. If there are factors that are highly correlated to each other, we have to remove them. Next, we use grid search cross validation to tune the threshold on our models to assess the prediction data against the test data set.

Random forest model, which is based on decision trees classification shows the highest f1 score. F1 score indicates how accurate the model in its prediction. Random forest has highest accuracy, recall (i.e 2nd highest) and precision scores compared to the rest.
With random forest as our model, we can look into the factors affecting diabetes more thoroughly. If a person were to ask how is my risk in getting diabetes? We can look at the table below.

Table 2 shows by risk of getting diabetes by age group. Those who are in 10–30 years age group has 17.5% chance of getting diabetes. If this group has body mass index (BMI) of above 30, their risk increases to 27.8%. This risk will increase to 50%, if they have glucose level above 140, together with BMI of above 30.
If you are older, your risk of getting diabetes increases. In fact, as our body ages, the organs in our body will not be able to function as well as before. This is why we have to do more medical checkups, as we get older.
Conclusion
Diabetes is a disease that can be managed and controlled. We can reduce the risks of having diabetes by going for a yearly medical checkup and leading a healthy lifestyle. In fact, it is a relatively easy and painless process of doing the diabetes test. You just need to fast the day before and go to your family doctor for the test the next day. If you have pre diabetes, you can manage it, so that it does not lead to diabetes.
Prevention is better than cure. We can do all our part to prevent diabetes.
Feel free to contact me on linkedin. Click here.
To view the code on this project. Click this github link.