T-test 1: Satisfaction Level

t.test(hr$satisfaction_level ~ hr$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 Interpretation: The p-value is less than 0.05, indicating a statistically significant difference in satisfaction levels.

Non-Technical Interpretation: Employees who left had lower satisfaction than those who stayed.

plot_ly(hr, x = ~left_factor, y = ~satisfaction_level, type = "box") %>%
  layout(title = "Employees who left had lower satisfaction")

T-test 2: Last Evaluation

t.test(hr$last_evaluation ~ hr$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 Interpretation: The p-value is less than 0.05, indicating a statistically significant difference in evaluation scores between employees who left and those who stayed.

Non-Technical Interpretation: Employees who left had different evaluation scores than those who stayed.

plot_ly(hr, x = ~left_factor, y = ~last_evaluation, type = "box") %>%
  layout(title = "Employees who left had different evaluation scores")

T-test 3: Number of Projects

t.test(hr$number_project ~ hr$left)
## 
##  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 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -0.131136535 -0.006540119
## sample estimates:
## mean in group 0 mean in group 1 
##        3.786664        3.855503

Technical Interpretation: The p-value is less than 0.05, indicating a statistically significant difference in the number of projects between employees who left and those who stayed.

Non-Technical Interpretation: Employees who left had different project workloads than those who stayed.

plot_ly(hr, x = ~left_factor, y = ~number_project, type = "box") %>%
  layout(title = "Employees who left had different project loads")

T-Test 4: Average Monthly Hours

t.test(hr$average_montly_hours ~ hr$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 Interpretation: The p-value is less than 0.05, indicating a statistically significant difference in average monthly hours between employees who left and those who stayed.

Non-Technical Interpretation: Employees who left worked more hours on average than those who stayed.

plot_ly(hr, x = ~left_factor, y = ~average_montly_hours, type = "box") %>%
  layout(title = "Employees who left worked more hours")