1.Satisfaction Level and Last Evaluation

1a. Perform the correlation:

cor.test(hr$satisfaction_level , hr$last_evaluation)
## 
##  Pearson's product-moment correlation
## 
## data:  hr$satisfaction_level and hr$last_evaluation
## t = 12.933, df = 14997, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.08916727 0.12082195
## sample estimates:
##       cor 
## 0.1050212

1b. Interpret the results in technical terms:

The satisfaction level and last evaluation have a weak positive correlation since the correlation coefficient is .105. However the very small p value indicates that the correlation is statistically significant and it is unlikely that it is due to random chance.

1c. Interpret the Results in non-technical terms:

There is a slight relationship between how satisfied employees are and how they score in their last evaluation. When employees have a higher satisfaction level their evaluations tend to be a little bit higher, but this connection is very weak. Additionally, it is unlikely that this weak relationship between the two values is due to coincidence or random chance.

1d. Create a plot that helps visualize the correlation:

library(ggplot2)
ggplot(hr, aes(x = satisfaction_level, y = last_evaluation)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE, color = "red") +
  labs(title = "Higher Satisfaction Levels Have a Very Weak Link to Higher Evaluations",
       x = "Satisfaction Level",
       y = "Last Evaluation")
## `geom_smooth()` using formula = 'y ~ x'

2. Average Monthly Hours and Time Spend Company

2a. Perform the correlation:

cor.test(hr$average_montly_hours , hr$time_spend_company)
## 
##  Pearson's product-moment correlation
## 
## data:  hr$average_montly_hours and hr$time_spend_company
## t = 15.774, df = 14997, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1119801 0.1434654
## sample estimates:
##       cor 
## 0.1277549

2b. Interpret the results in technical terms:

The average monthly hours and last evaluation have a weak positive correlation since the correlation coefficient is .128. However the very small p value indicates that the correlation is statistically significant and it is unlikely that the relationship is due to random chance.

2c. Interpret the Results in non-technical terms:

There is a weak relationship between average monthly hours worked by employees and how long they have stayed at the company, meaning that there is there is a slight relationship indictaing that the more average monthly hours worked hints that the employee may have longer time spent at the company. Additionally, it is unlikely that this weak relationship between the two values is due to coincidence or random chance.

2d. Create a plot that helps visualize the correlation:

ggplot(hr, aes(x = average_montly_hours, y = time_spend_company)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE, color = "red") +
  labs(title = "The Average Monthly Hours Worked Have a Very \n Weak Link the Time Spent at Company",
       x = "Average Monthly Hours of Employee",
       y = "Time Spent at the Company")
## `geom_smooth()` using formula = 'y ~ x'

3. Satisfaction Level and Average Monthly Hours

3a. Perform the correlation:

cor.test(hr$satisfaction_level , hr$average_montly_hours)
## 
##  Pearson's product-moment correlation
## 
## data:  hr$satisfaction_level and hr$average_montly_hours
## t = -2.4556, df = 14997, p-value = 0.01408
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.036040356 -0.004045605
## sample estimates:
##         cor 
## -0.02004811

3b. Interpret the results in technical terms:

If a P-value is less that 0.05, that is an indicator that the correlation can be considered statistically significant. In this example, the P value is 0.01408, so the results are indeed statistically significant. The 95% confidence interval suggests that the true correlation could range from -0.036 to -0.004, but it is likely a very small negative relationship in the population.

3c. Interpret the results in non-technical terms:

We tested this data to see if there was a relationship between employee’s satisfaction levels and the average number of hours they work on a monthly basis. The correlation coefficient is about -0.02, which suggests a very weak negative relationship. This means that as average monthly hours increase, job satisfaction tends to decrease slightly, but the effect is very small.

3d. Create a plot that helps visualize the correlation

library(ggplot2)
ggplot(hr, aes(x = satisfaction_level, y = average_montly_hours)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE, color = "red") +
  labs(title = "Very Weak Relationship between Satisfaction Level and the \n Average Monthly Hours an Employee Works",
       x = "satisfaction",
       y = "average monthly hours")
## `geom_smooth()` using formula = 'y ~ x'

4. Average Monthly Hours and Last Evaluation

4a. Perform the correlation:

cor.test(hr$average_montly_hours , hr$last_evaluation)
## 
##  Pearson's product-moment correlation
## 
## data:  hr$average_montly_hours and hr$last_evaluation
## t = 44.237, df = 14997, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.3255078 0.3538218
## sample estimates:
##       cor 
## 0.3397418

4b. Interpret the results in technical terms:

There is a statistically significant moderate positive correlation (r ≈ 0.34) between average_monthly_hours and last_evaluation in the data set. The p-value is less than 2.2x10-16, which is extremely small. This indicates that the null hypothesis can be rejected with very high confidence.

4c. Interpret the results in non-technical terms:

As employees work more hours on average per month, their last evaluation scores tend to be higher. This statistical significant correlation is due to the p value being extremely small.

4d. Create a plot that helps visualize the correlation:

library(ggplot2)
ggplot(hr, aes(x = average_montly_hours, y = last_evaluation)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE, color = "red") +
  labs(title = "Moderate Positive Correlation with Average Monthly Hours \n An Employee Works and Their Last Evaluation",
       x = "average monthly hours",
       y = "last_evaluation")
## `geom_smooth()` using formula = 'y ~ x'