Question 1: Satisfaction Level by Attrition

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

Interpretations:

P-Value Interpretation: The p-value is < 2.2e-16, which is extremely small, indicating a statistically significant difference; we reject the null hypothesis.

T-Test Interpretation: The mean satisfaction level for employees who stayed is 0.67, while for those who left, it is 0.44. This significant difference suggests that lower satisfaction is associated with higher attrition.

Non-Technical Interpretation: Employees who left the company had significantly lower satisfaction levels than those who stayed.

Visualization

Question 2: Last Evaluation Score by Attrition

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

Interpretations:

P-value Interpretation: The p-value is 0.4683, which is much greater than 0.01. This indicates that the difference in last evaluation scores between employees who left and those who stayed is not statistically significant; we fail to reject the null hypothesis.

T-test Interpretation: The mean last evaluation score for employees who stayed is 0.715, while for those who left, it is 0.718. Since the p-value is high, we do not have enough evidence to conclude that there is a meaningful difference in last evaluation scores between the two groups.

Non-technical Interpretation: Employees who left and those who stayed had similar last evaluation scores, meaning performance evaluations do not appear to be a factor in whether an employee left or stayed.

Visualization

Question 3: Average Monthly Hours by Attrition

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

Interpretations:

P-value Interpretation: The p-value is 5.907e-14, which is extremely small (<0.01), confirming a significant difference; we reject the null hypothesis.

T-test Interpretation: The mean monthly working hours for employees who stayed is 199.06, while for those who left, it is 207.42. This indicates that employees who worked longer hours were more likely to leave the company.

Non-technical Interpretation: Employees who worked longer hours per month were more likely to leave the company.

Visualization

Question 4: Time Spent at Company by Attrition

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

Interpretations:

P-Value Interpretation: The p-value is < 2.2e-16, which is extremely small, confirming a significant difference; we reject the null hypothesis.

T-test Interpretation: The mean time spent at the company for employees who stayed is 3.38 years, while for those who left, it is 3.88 years. This indicates that employees who had been at the company longer were more likely to leave.

Non-technical Interpretation: Employees who had been at the company for more years were more likely to leave.

Visualization