1. Perform the correlation (.5 point) Choose any two appropriate variables from the data and perform the correlation, displaying the results.

q1 <- cor.test(hr$satisfaction_level, hr$average_montly_hours)

print(q1)
## 
##  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

2. Interpret the results in technical terms (.5 point) For each correlation, explain what the test’s p-value means (significance).

p-value: The p-value is extremely small, which means that the correlation between satisfaction level and average monthly hours is statistically significant at any common significance level (e.g., 0.05). This suggests that there is evidence of a correlation between the two variables.

Correlation estimate: The correlation coefficient is negatve, which indicates a moderate negative correlation. As satisfaction levels decrease, average monthly hours tend to increase.

3. Interpret the results in non-technical terms (1 point) For each correlation, what do the results mean in non-techical terms.

In simple terms, employees who work longer hours tend to report lower job satisfaction. The data suggests that spending more time at work is linked to feeling less satisfied with the job.

4. Create a plot that helps visualize the correlation (.5 point) For each correlation, create a graph to help visualize the realtionship between the two variables. The title must*** be the non-technical interpretation.

ggplot(hr, aes(x = average_montly_hours, y = satisfaction_level)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE, color = "red") +
  labs(title = "More Hours Worked, Less Satisfaction",
       x = "Average Monthly Hours",
       y = "Satisfaction Level")
## `geom_smooth()` using formula = 'y ~ x'