## 5 Social Variables Analysis  
XGB model trained with the following variables:  
Dependent variable: LVEF over 50;  
Independent variable: low education, low income, women, from rural.  
The performance of the model is shown in Figure 5. The validation technique is the same, cross-validation--leave one out. It can be seen that the probabilities for those who actually had LVEF over 50 were much higher than those for patients without LVEF over 50. The median, marked in the graph with a white dot, is almost 0.8 for LVEF over 50, and for the others is about 0.3. In the ROC curves, one can observe a progress in learning the relationship, where the AUC is 0.75. The results from the confusion matrix confirm a relationship between the independent and dependent variables, where the accuracy is 77% and the F1 score is 78%.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multicolumn{5}{c}{**Logit Regression Results**} \\ \hline
**Dependent Variable** & LVEF\_over\_50 & **No. Observations:** & 201 \\ \hline
**Model:** & Logit & **Df Residuals:** & 197 \\ \hline
**Method:** & MLE & **Df Model:** & 3 \\ \hline
**Date:** & Wednesday, 13 July 2022 & **Pseudo R-squ.:** & 0.1858 \\ \hline
**Time:** & 19:57:17 & **Log-Likelihood:** & \(-\)113.38 \\ \hline
**Converged:** & True & **LL-Null:** & \(-\)139.26 \\ \hline
**Covariance Type:** & nonrobust & **LLR \(p\)-Value:** & \(3.371\times 10^{-11}\) \\ \hline  & **coef** & **std err** & **z** & \(p>1\,\mathrm{\SIUnitSymbolMicro}\) & **[0.025** & **0.975**]** \\ \hline Intercept & \(1.5682\) & \(0.398\) & \(3.944\) & \(0.000\) & \(0.789\) & \(2.347\) \\ \hline smoker & \(-1.9056\) & \(0.373\) & \(-5.113\) & \(0.000\) & \(-2.636\) & \(-1.175\) \\ \hline alcoholic & \(-0.4042\) & \(0.431\) & \(-0.937\) & \(0.349\) & \(-1.249\) & \(0.441\) \\ \hline obese & \(-1.0038\) & \(0.417\) & \(-2.410\) & \(0.016\) & \(-1.820\) & \(-0.187\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Logistic regression output for behavioural variables.  
The use of these independent variables largely explains LVEF in patients. Next, it is important to see how the contribution of these variables is divided individually. In order to better understand the role played by the variables in calculating the probabilities, they are analyzed by Shap Values, and the results are presented in Figure 6.  
For those with low education equal to 1 (red dots on the first line), the assigned Shap values are very small--this suggests that they negatively influenced, with a high power, the probability that a patient has LVEF over 50. If the patient does not have a low education, their chances increase, but not much compared to not having an education. Surprisingly it is low income, those with low income equal to 1 have a certain advantage--they are a little more favored in having LVEF over 50. This can be explained perhaps by the fact that they have restricted access to cigarettes or alcohol. Women have a small advantage, as there is a slight tendency for women to have a slightly higher probability than for men. For the variable from rural, the values are very close to zero, which suggests that there is not a large contribution of this variable to the formation of probabilities. These results are also reflected in logistic regression.  
As we can see in Table 4, the biggest influence is low education, with a negative value of \(-2.87\). Then, low_income has a protective role, with 1.58, and the variable women modifies the score, which can later be transformed into a probability of 0.59. In the case of these three variables, the \(p\)-value is below 0.05, so we have reason to believe that they do have an impact. As for the from_rural variable, \(p\)-value is 0.7, the data do not show that we can be sure if it has an influence.  
Figure 5: Classification results for social variables.  
Figure 6: Shapley values for social variables.