# Measuring the Effect of Mental Health on Type 2 Diabetes
## 6 Conclusions and Implications  
### Conclusions  
This study used the DoWhy library to estimate the causal relationship between mental health and diabetes. DoWhy organized the mechanism for causality inference into four steps. The first step (modeling) encodes the data into a causal graph, and the second step (identification) identifies the causal relationship of the model and transforms the causal quantity to an estimable quantity based on the available data. Step 3 (estimation) makes an estimate for the identified causality using the estimable quantity, and Step 4 (refutation) attempts to refute the obtained estimate. When estimating a causal effect, essential assumptions are made, such as the direction of the effect, the presence of an instrumental variable or mediator, and whether all relevant confounding factors are observed. Violation of this assumption results in significant errors in the causal effect estimate. For predictive models using machine learning, cross-validation methods exist, but global validation methods for causal inference do not currently exist.  
Therefore, expressing and validating causal assumptions as formally as possible is essential. For this purpose, DoWhy provides the ability to explicitly declare a causal model in Step 1. It also provides several validation methods to verify subsets of assumptions. Validation tests to better detect errors, such as mean causality and conditional causation, have been developed and are addressed in Step 4.  
This study estimated whether mental health issues, such as stress, could affect the onset of diabetes. Environmental and biological factors were considered external factors, the mental health (stress) factor was defined as the treatment variable, and diabetes onset was defined as the outcome variable for analysis. According to the analysis results, it was found that at high levels of stress, the risk of diabetes is increased by about 15%. Existing studies are researching the onset of diabetes and complications caused by chronic diseases. However, these do not specifically suggest the possibility of diabetes mellitus being affected by stress [18]. This study suggests the degree to which mental health issues could induce diabetes using causal inference methodology.  
Our study used the propensity score and matching techniques to estimate causal effects without satisfying parametric assumptions among the structural assumptions of ignorability and parametric assumption in causal inference. This method is possible when used with a flexible modeling approach rather than linear modeling on the response surface. The results of this study's analysis can be said to be reliable because the robustness of the estimate was confirmed by passing the validation tests of random common cause, placebo treatment refuter, and data subset refuter.  
We estimated the causal effect of mental health on diabetes using DoWhy, an extensive library for causal inference. Unlike most other libraries, DoWhy focuses on helping analysts devise correct causal models and test the assumptions made in addition to estimating causal effects. This study designed a causal model for diabetes based on the framework of [PERSON] et al. due to its unique advantages [1]. This model set mental health as the treatment variable and diabetes as the outcome variable. The identified estimand was evaluated based on the backdoor criteria supported by DoWhy, and the causal effect was evaluated based on the causal model. Random common cause, placebo treatment, and data subset refuter were the methodologies used to verify the causal relationship. Through three refutation tests, the reliability of the DoWhy causal inference model for diabetes inference using the treatment variable called mental health was demonstrated.