1. Left vs. Work Accident

a. Chi-Square Test

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  14999 
## 
##  
##              | hr$Work_accident 
##      hr$left |         0 |         1 | Row Total | 
## -------------|-----------|-----------|-----------|
##            0 |      9428 |      2000 |     11428 | 
##              |    12.346 |    73.029 |           | 
##              |     0.825 |     0.175 |     0.762 | 
##              |     0.735 |     0.922 |           | 
##              |     0.629 |     0.133 |           | 
## -------------|-----------|-----------|-----------|
##            1 |      3402 |       169 |      3571 | 
##              |    39.510 |   233.709 |           | 
##              |     0.953 |     0.047 |     0.238 | 
##              |     0.265 |     0.078 |           | 
##              |     0.227 |     0.011 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |     12830 |      2169 |     14999 | 
##              |     0.855 |     0.145 |           | 
## -------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  358.5938     d.f. =  1     p =  5.698673e-80 
## 
## Pearson's Chi-squared test with Yates' continuity correction 
## ------------------------------------------------------------
## Chi^2 =  357.5624     d.f. =  1     p =  9.55824e-80 
## 
## 

b. Technical Interpretation

There is an association between leaving and work accidents, where employees without accidents are more likely to leave

c. Non-Technical Interpretation

Employees without work accidents are more than 3 times more likely to leave (0.265 / 0.078)

d. Graph

2. Left vs. Promotion Last 5 Years

a. Chi-Square Test

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  14999 
## 
##  
##              | hr$promotion_last_5years 
##      hr$left |        No |       Yes | Row Total | 
## -------------|-----------|-----------|-----------|
##            0 |     11128 |       300 |     11428 | 
##              |     0.290 |    13.343 |           | 
##              |     0.974 |     0.026 |     0.762 | 
##              |     0.758 |     0.940 |           | 
##              |     0.742 |     0.020 |           | 
## -------------|-----------|-----------|-----------|
##            1 |      3552 |        19 |      3571 | 
##              |     0.928 |    42.702 |           | 
##              |     0.995 |     0.005 |     0.238 | 
##              |     0.242 |     0.060 |           | 
##              |     0.237 |     0.001 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |     14680 |       319 |     14999 | 
##              |     0.979 |     0.021 |           | 
## -------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  57.26273     d.f. =  1     p =  3.813123e-14 
## 
## Pearson's Chi-squared test with Yates' continuity correction 
## ------------------------------------------------------------
## Chi^2 =  56.26163     d.f. =  1     p =  6.344155e-14 
## 
## 

b. Technical Interpretation

The chi-square test suggests a statistically significant association between employee attrition and receiving a promotion in the last five years. This means that the distribution of promotions differs significantly between employees who left and those who stayed.

c. Non-Technical Interpretation

Employees who did not get a promotion in the last five years are more likely to leave compared to those who received a promotion.

d. Graph

3. Left vs. Department

a. Chi-Square Test

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  14999 
## 
##  
##              | hr$Department 
##      hr$left |  accounting |          hr |          IT |  management |   marketing | product_mng |       RandD |       sales |     support |   technical |   Row Total | 
## -------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|
##            0 |         563 |         524 |         954 |         539 |         655 |         704 |         666 |        3126 |        1674 |        2023 |       11428 | 
##              |       0.783 |       2.709 |       0.391 |       7.250 |       0.002 |       0.408 |       7.346 |       0.255 |       0.348 |       1.178 |             | 
##              |       0.049 |       0.046 |       0.083 |       0.047 |       0.057 |       0.062 |       0.058 |       0.274 |       0.146 |       0.177 |       0.762 | 
##              |       0.734 |       0.709 |       0.778 |       0.856 |       0.763 |       0.780 |       0.846 |       0.755 |       0.751 |       0.744 |             | 
##              |       0.038 |       0.035 |       0.064 |       0.036 |       0.044 |       0.047 |       0.044 |       0.208 |       0.112 |       0.135 |             | 
## -------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|
##            1 |         204 |         215 |         273 |          91 |         203 |         198 |         121 |        1014 |         555 |         697 |        3571 | 
##              |       2.506 |       8.670 |       1.252 |      23.202 |       0.008 |       1.307 |      23.510 |       0.815 |       1.114 |       3.771 |             | 
##              |       0.057 |       0.060 |       0.076 |       0.025 |       0.057 |       0.055 |       0.034 |       0.284 |       0.155 |       0.195 |       0.238 | 
##              |       0.266 |       0.291 |       0.222 |       0.144 |       0.237 |       0.220 |       0.154 |       0.245 |       0.249 |       0.256 |             | 
##              |       0.014 |       0.014 |       0.018 |       0.006 |       0.014 |       0.013 |       0.008 |       0.068 |       0.037 |       0.046 |             | 
## -------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|
## Column Total |         767 |         739 |        1227 |         630 |         858 |         902 |         787 |        4140 |        2229 |        2720 |       14999 | 
##              |       0.051 |       0.049 |       0.082 |       0.042 |       0.057 |       0.060 |       0.052 |       0.276 |       0.149 |       0.181 |             | 
## -------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|-------------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  86.82547     d.f. =  9     p =  7.04213e-15 
## 
## 
## 

b. Technical Interpretation

The test indicates there is a statistically significant association between the department in which an employee works and whether they leave, suggesting that attrition is distributed unevenly across departments.

c. Non-Technical Interpretation

Some departments experience much higher turnover rates than others. This suggests that factors unique to these departments may contribute to increased attrition.

d. Graph

4. Left vs. Salary

a. Chi-Square Test

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  14999 
## 
##  
##              | hr$salary 
##      hr$left |       low |    medium |      high | Row Total | 
## -------------|-----------|-----------|-----------|-----------|
##            0 |      5144 |      5129 |      1155 |     11428 | 
##              |    33.200 |     9.648 |    47.915 |           | 
##              |     0.450 |     0.449 |     0.101 |     0.762 | 
##              |     0.703 |     0.796 |     0.934 |           | 
##              |     0.343 |     0.342 |     0.077 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            1 |      2172 |      1317 |        82 |      3571 | 
##              |   106.247 |    30.876 |   153.339 |           | 
##              |     0.608 |     0.369 |     0.023 |     0.238 | 
##              |     0.297 |     0.204 |     0.066 |           | 
##              |     0.145 |     0.088 |     0.005 |           | 
## -------------|-----------|-----------|-----------|-----------|
## Column Total |      7316 |      6446 |      1237 |     14999 | 
##              |     0.488 |     0.430 |     0.082 |           | 
## -------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  381.225     d.f. =  2     p =  1.652087e-83 
## 
## 
## 

b. Technical Interpretation

The test indicates a statistically significant association between salary level and employee attrition, meaning that the likelihood of leaving the company varies by salary group.

c. Non-Technical Interpretation

Employees earning lower salaries are more likely to leave the company compared to those with medium or high salaries. #### d. Graph