The Data

##  satisfaction_level last_evaluation  number_project  average_montly_hours
##  Min.   :0.0900     Min.   :0.3600   Min.   :2.000   Min.   : 96.0       
##  1st Qu.:0.4400     1st Qu.:0.5600   1st Qu.:3.000   1st Qu.:156.0       
##  Median :0.6400     Median :0.7200   Median :4.000   Median :200.0       
##  Mean   :0.6128     Mean   :0.7161   Mean   :3.803   Mean   :201.1       
##  3rd Qu.:0.8200     3rd Qu.:0.8700   3rd Qu.:5.000   3rd Qu.:245.0       
##  Max.   :1.0000     Max.   :1.0000   Max.   :7.000   Max.   :310.0       
##                                                                          
##  time_spend_company      Work_accident       left       promotion_last_5years
##  Min.   : 2.000     No Accident :12830   Left  : 3571   Min.   :0.00000      
##  1st Qu.: 3.000     Yes Accident: 2169   Stayed:11428   1st Qu.:0.00000      
##  Median : 3.000                                         Median :0.00000      
##  Mean   : 3.498                                         Mean   :0.02127      
##  3rd Qu.: 4.000                                         3rd Qu.:0.00000      
##  Max.   :10.000                                         Max.   :1.00000      
##                                                                              
##     salary           department  
##  high  :1237   sales      :4140  
##  low   :7316   technical  :2720  
##  medium:6446   support    :2229  
##                IT         :1227  
##                product_mng: 902  
##                marketing  : 858  
##                (Other)    :2923

Left vs Satisfaction

## 
##  Welch Two Sample t-test
## 
## data:  hr$satisfaction_level by hr$left
## t = -46.636, df = 5167, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group Left and group Stayed is not equal to 0
## 95 percent confidence interval:
##  -0.2362417 -0.2171815
## sample estimates:
##   mean in group Left mean in group Stayed 
##            0.4400980            0.6668096

Left vs last evaluation

## 
##  Welch Two Sample t-test
## 
## data:  hr$last_evaluation by hr$left
## t = 0.72534, df = 5154.9, p-value = 0.4683
## alternative hypothesis: true difference in means between group Left and group Stayed is not equal to 0
## 95 percent confidence interval:
##  -0.004493874  0.009772224
## sample estimates:
##   mean in group Left mean in group Stayed 
##            0.7181126            0.7154734

Left vs last number of projects

## 
##  Welch Two Sample t-test
## 
## data:  hr$number_project by hr$left
## t = 2.1663, df = 4236.5, p-value = 0.03034
## alternative hypothesis: true difference in means between group Left and group Stayed is not equal to 0
## 95 percent confidence interval:
##  0.006540119 0.131136535
## sample estimates:
##   mean in group Left mean in group Stayed 
##             3.855503             3.786664

Left vs last average monthly hours

## 
##  Welch Two Sample t-test
## 
## data:  hr$average_montly_hours by hr$left
## t = 7.5323, df = 4875.1, p-value = 5.907e-14
## alternative hypothesis: true difference in means between group Left and group Stayed is not equal to 0
## 95 percent confidence interval:
##   6.183384 10.534631
## sample estimates:
##   mean in group Left mean in group Stayed 
##             207.4192             199.0602

Left vs tenure

## 
##  Welch Two Sample t-test
## 
## data:  hr$time_spend_company by hr$left
## t = 22.631, df = 9625.6, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group Left and group Stayed is not equal to 0
## 95 percent confidence interval:
##  0.4534706 0.5394767
## sample estimates:
##   mean in group Left mean in group Stayed 
##             3.876505             3.380032

left vs work accident

## 
##  
##    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 |  No Accident | Yes Accident |    Row Total | 
## -------------|--------------|--------------|--------------|
##         Left |         3402 |          169 |         3571 | 
##              |       39.510 |      233.709 |              | 
##              |        0.953 |        0.047 |        0.238 | 
##              |        0.265 |        0.078 |              | 
##              |        0.227 |        0.011 |              | 
## -------------|--------------|--------------|--------------|
##       Stayed |         9428 |         2000 |        11428 | 
##              |       12.346 |       73.029 |              | 
##              |        0.825 |        0.175 |        0.762 | 
##              |        0.735 |        0.922 |              | 
##              |        0.629 |        0.133 |              | 
## -------------|--------------|--------------|--------------|
## 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 
## 
## 

The relative risk of staying when having a work accident is 3.7.
If you have a work accident, you are 3.7 time more likely to stay

left vs promotion

## 
##  
##    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 |         0 |         1 | Row Total | 
## -------------|-----------|-----------|-----------|
##         Left |      3552 |        19 |      3571 | 
##              |     0.928 |    42.702 |           | 
##              |     0.995 |     0.005 |     0.238 | 
##              |     0.242 |     0.060 |           | 
##              |     0.237 |     0.001 |           | 
## -------------|-----------|-----------|-----------|
##       Stayed |     11128 |       300 |     11428 | 
##              |     0.290 |    13.343 |           | 
##              |     0.974 |     0.026 |     0.762 | 
##              |     0.758 |     0.940 |           | 
##              |     0.742 |     0.020 |           | 
## -------------|-----------|-----------|-----------|
## 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 
## 
## 

People that did not get a promotion in the past 5 years are 4 times more likely to leave

left vs salary

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

The higher the salary, the less likely to leave

left vs department

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