1.t-test of satisfaction level and whether they stayed or left

## 
##  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 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  0.2171815 0.2362417
## sample estimates:
## mean in group 0 mean in group 1 
##       0.6668096       0.4400980

P-value interpretation-T-Test interpretation-Non-Technical Interpretation

Since the p-value is very low, the difference in satisfaction levels between employees who have left and those who stayed is statistically significant.

The t-test shows us that there is a strong difference between the mean result and hypothesized result.

The results show employees with lower satisfaction are more likely to end up leaving the company.

2. t-test showing average monthly hours and whether they left or stayed

## 
##  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 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -10.534631  -6.183384
## sample estimates:
## mean in group 0 mean in group 1 
##        199.0602        207.4192

P-value interpretation-T-Test interpretation-Non-Technical Interpretation

Since the p-value is much lower than 0.05,there is a statistically significant difference in average monthly hours between employees who left and those who decided to stay.

Employees who worked more, are more likely to leave.

The t-test shows that the difference in mean of employees who left and stayed is strong.

3. t-test between employee evaluationn scores and whether they stayed or left

## 
##  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 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -0.009772224  0.004493874
## sample estimates:
## mean in group 0 mean in group 1 
##       0.7154734       0.7181126

P-value interpretation-T-Test interpretation-Non-Technical Interpretation

The p-value is greater than 0.05, meaning there is no statistically significant difference in last evaluation scores between employees who left and those who stayed.

The results show evaluation scores are not a reason an employee may decide to leave the company.

The t-test shows us that the difference between employees who left and stayed when comparing attrition and employee satisfaction is similar.

4. t-test comparing time spendt at company and whether they left or not

## 
##  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 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -0.5394767 -0.4534706
## sample estimates:
## mean in group 0 mean in group 1 
##        3.380032        3.876505

P-value interpretation-T-Test interpretation-Non-Technical Interpretation

Since the p-value is extremely low, we conclude that the difference in time spent at the company between employees who left and those who stayed is statistically significant.

The results show us that employees who have been at the company for a longer time are more likely to leave.

The t-test shows us that there is a strong difference between the mean of left and stayed employees when comparing tenure to whether they left or stayed.