Chi-square test 1: Attrition vs Salary

## 
##  Pearson's Chi-squared test
## 
## data:  hr$salary and hr$left
## X-squared = 381.23, df = 2, p-value < 2.2e-16

- p-value (2.2e-16) is < alpha (0.01), so we reject the Ho.

- Employees with low salaries are more likely to leave the company.

Plot

Chi-square test 2: Attrition vs Department

## 
##  Pearson's Chi-squared test
## 
## data:  hr$Department and hr$left
## X-squared = 86.825, df = 9, p-value = 7.042e-15

- p-value (7.042e-15) < alpha (0.01), so we reject the Ho.

- Some departments have higher turnover than others.

Plot

Chi-square test 3: Attrition vs Promotion

## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  hr$promotion_last_5years and hr$left
## X-squared = 56.262, df = 1, p-value = 6.344e-14

- p-value (6.344e-14) < alpha (0.01), so we can reject the Ho.

- Employees who are not promoted are more likely to leave the company.

Plot

Chi-test 4: Attrition vs Work Accident

## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  hr$Work_accident and hr$left
## X-squared = 357.56, df = 1, p-value < 2.2e-16

p-value is (2.23-16) < alpha (0.01), so we can reject the Ho.

Employees who had a work accident are less likely to leave the company.

Plot