Assignment 8: t-test - Employee Attrition Analysis

By Kevin Hanson & Pat O’Connell

Task 1: Task 1: T-Test between Satisfaction Level & 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

Technical Analysis

  • The p-value (\(< 2.2e-16\)) is extremely small, indicating a highly significant difference in the mean satisfaction levels between employees who left and those who stayed.

  • This suggests that the observed difference is very unlikely to have occurred by chance.

Non-Technical Analysis

  • Employees who left the company tend to have significantly lower satisfaction levels compared to those who stayed.

  • This indicates that dissatisfaction is a strong predictor of employee attrition.

The Graph

Task 2: T-Test between Last Evaluation & 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

Technical Analysis

  • The p-value (1.74e-09) is very small, indicating a significant difference in the mean last evaluation scores between employees who left and those who stayed.

  • This suggests that the observed difference is statistically significant.

Non-Technical Analysis

  • Employees who left the company tend to have slightly higher evaluation scores, which might suggest that high performers are also at risk of leaving, or that those who leave were given higher evaluations before departure.

The Graph

Task 3: T-Test between Average Monthly Hours & Left

## 
##  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

Technical Analysis

  • The p-value (2.47e-28) is extremely small, indicating a highly significant difference in the mean average monthly hours between employees who left and those who stayed.

  • This suggests that the difference is very statistically significant.

Non-Technical Analysis

  • Employees who left the company tended to work significantly more hours per month than those who stayed.

  • This indicates that working longer hours may contribute to employee attrition.

The Graph

Task 4: T-Test between Time Spent at Company & Left

## 
##  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

Technical Analysis

  • The p-value (< 2.2e-16) is extremely small, indicating a highly significant difference in the mean time spent at the company between employees who left and those who stayed.

  • This strongly suggests that the difference is statistically significant.

Non-Technical Analysis

  • Employees who left the company tended to have spent less time at the company compared to those who stayed.

  • This implies that tenure plays a role in employee retention.

The Graph