## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
## Rows: 14999 Columns: 10
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): Department, salary
## dbl (8): satisfaction_level, last_evaluation, number_project, average_montly...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Part 1

## 
##  Welch Two Sample t-test
## 
## data:  hr1$satisfaction_level by hr1$Left
## t = -46.636, df = 5167, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group Left and group Stayed is not equal to 0
## 99.9 percent confidence interval:
##  -0.2427168 -0.2107063
## sample estimates:
##   mean in group Left mean in group Stayed 
##            0.4400980            0.6668096
Comments
  • The p-value is extremely small (less than 0.001), which is less than our alpha level. Therefore, we reject the null hypothesis. This means there is a significant difference in satisfaction level between employees who left and those who stayed.
  • Employees who stayed at the company tend to be more satisfied than those who left.

Part 2

## 
##  Welch Two Sample t-test
## 
## data:  hr1$last_evaluation by hr1$Left
## t = 0.72534, df = 5154.9, p-value = 0.4683
## alternative hypothesis: true difference in means between group Left and group Stayed is not equal to 0
## 99.9 percent confidence interval:
##  -0.009340354  0.014618703
## sample estimates:
##   mean in group Left mean in group Stayed 
##            0.7181126            0.7154734
Comments
  • The p-value is very small (less than 0.001), which is less than our alpha level. Therefore, we reject the null hypothesis. This means there is a significant difference in last evaluation scores between employees who left and those who stayed.
  • Employees who left the company tend to have slightly higher evaluation scores.

Part 3

## 
##  Welch Two Sample t-test
## 
## data:  hr1$average_montly_hours by hr1$Left
## t = 7.5323, df = 4875.1, p-value = 5.907e-14
## alternative hypothesis: true difference in means between group Left and group Stayed is not equal to 0
## 99.9 percent confidence interval:
##   4.705107 12.012907
## sample estimates:
##   mean in group Left mean in group Stayed 
##             207.4192             199.0602
Comments

-The p-value is 0.4683, which is greater than our alpha level. Therefore, we fail to reject the null hypothesis. This means there is no significant difference in last evaluation scores between employees who left and those who stayed. - There is no meaningful difference in evaluation scores between employees who left and those who stayed.

Part 4

## 
##  Welch Two Sample t-test
## 
## data:  hr1$time_spend_company by hr1$Left
## t = 22.631, df = 9625.6, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group Left and group Stayed is not equal to 0
## 99.9 percent confidence interval:
##  0.4242640 0.5686833
## sample estimates:
##   mean in group Left mean in group Stayed 
##             3.876505             3.380032
Comments
  • The p-value is extremely small (less than 0.001), which is less than our alpha level. Therefore, we reject the null hypothesis. This means there is a significant difference in time spent at the company between employees who left and those who stayed.
  • Employees who leave the company tend to have spent more time at the company.