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
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.
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.
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'