t_test_result <- t.test(satisfaction_level ~ left, data = `HR_comma_sep(2)`)
t_test_result

plotly_boxplot <- plot_ly(`HR_comma_sep(2)`, x = ~left, y = ~satisfaction_level, type = 'box') %>%
  layout(title = "Satisfaction Level Comparison",
         xaxis = list(title = "Employment Status"),
         yaxis = list(title = "Satisfaction Level"))


plotly_boxplot

Interpretation For Problem 1. Through the boxplots we can determine the median satisfaction level to be .69 with Q1 and Q3 ranging from .54 to .89, this determines that the average satisfaction level of those employees which stayed was that of a higher degree than the percieved average of 0.5

t_test_result_hours <- t.test(average_montly_hours ~ left, data = `HR_comma_sep(2)`)
t_test_result_hours

plotly_boxplot_hours <- plot_ly(`HR_comma_sep(2)`, x = ~left, y = ~average_montly_hours, type = 'box') %>%
  layout(title = "Average Monthly Hours Comparison",
         xaxis = list(title = "Employment Status"),
         yaxis = list(title = "Average Monthly Hours"))

Interpretation For Problem 2. It appears through the boxplots that we can conclude that there is a significant statsitical difference of average monthly hours between employees that left and employees that stayed, with average monthly hours appearing much greater for employees which remained.Though a higher median for those who left, ultimately within the ‘left’ column there seems to be some outliers dragging the average hours drastically up as well as drastically down, however more who leave appear to be on the lower end of the average falling in the second quartile of 126-146 Hours.

t_test_result_last_evaluation <- t.test(last_evaluation ~ left, data = `HR_comma_sep(2)`)
t_test_result_last_evaluation

plotly_boxplot_last_evaluation <- plot_ly(`HR_comma_sep(2)`, x = ~left, y = ~last_evaluation, type = 'box') %>%
  layout(title = "Last Evaluation Comparison",
         xaxis = list(title = "Employment Status"),
         yaxis = list(title = "Last Evaluation Score"))


plotly_boxplot_last_evaluation

Interpretation For Problem 3. While the median last performance evaluation for members that left were higher, the first quartile, which appeared to the majority of those who left the company, clocked in at an evaluation score of .52 whereas the lowest quartile for employees that remained was a slightly higher evaluation score of .58. While none of these factors alone can provide true insight into exact reasons why employees chose to leave or remain with the company, it can be determined that the ‘low points’ of the employees that left the company vs the ones that stayed tend to exceed, and sometimes often exceed the low points of the employees that remain.