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.
cor_test_result1 <- cor.test(hr$satisfaction_level, hr$last_evaluation)
ggplot(hr, aes(x = satisfaction_level, y = last_evaluation)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
ggtitle("Higher satisfaction levels are associated with higher evaluation scores") +
xlab("Satisfaction Level") +
ylab("Last Evaluation Score")
## `geom_smooth()` using formula = 'y ~ x'

cat("Correlation Coefficient:", cor_test_result1$estimate, "\n")
## Correlation Coefficient: 0.1050212
cat("p-value:", cor_test_result1$p.value, "\n")
## p-value: 4.704312e-38
- This p-value is far below the common significance threshold of
0.05, which indicates that the correlation between the two variables (in
this case, likely last_evaluation and satisfaction_level) is highly
statistically significant. This means we can reject the null hypothesis
with a high degree of confidence.
- The results indicate that there is a strong and significant link
between how satisfied employees feel and how well they are evaluated at
work. Improving employee satisfaction could lead to better evaluation
outcomes, benefiting both employees and the organization as a
whole.
cor_test_result2 <- cor.test(hr$last_evaluation, hr$number_project)
ggplot(hr, aes(x = number_project, y = last_evaluation)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
ggtitle("More projects may relate to higher last evaluation scores") +
xlab("Number of Projects") +
ylab("Last Evaluation Score")
## `geom_smooth()` using formula = 'y ~ x'

cat("Correlation Coefficient:", cor_test_result2$estimate, "\n")
## Correlation Coefficient: 0.3493326
cat("p-value:", cor_test_result2$p.value, "\n")
## p-value: 0
- A p-value of 0 or nearly 0 indicates overwhelming evidence against
the null hypothesis (the idea that there is no relationship between the
two variables). This strong significance suggests that the observed
correlation is highly unlikely to be due to random variation alone.
- This p-value is far below the conventional significance level of
0.05, which indicates that the correlation between satisfaction_level
and number_project is highly statistically significant. You can
confidently reject the null hypothesis, which states that there is no
relationship between the two variables.
- The results suggest that there is a strong and significant
relationship between how many projects employees work on and their
satisfaction at work. Generally, it can be interpreted that employees
who take on more projects are likely to feel more satisfied with their
jobs. This insight could be useful for management in understanding
employee engagement and satisfaction in relation to project
workload.
cor_test_result4 <- cor.test(hr$time_spend_company, hr$satisfaction_level)
ggplot(hr, aes(x = time_spend_company, y = satisfaction_level)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
ggtitle("Relationship between Time Spent at Company and Satisfaction Level") +
xlab("Time Spent at Company (years)") +
ylab("Satisfaction Level")
## `geom_smooth()` using formula = 'y ~ x'

cat("Correlation Coefficient:", cor_test_result4$estimate, "\n")
## Correlation Coefficient: -0.1008661
cat("p-value:", cor_test_result4$p.value, "\n")
## p-value: 3.203473e-35
- This p-value is far below the conventional threshold of 0.05,
suggesting that the correlation between time_spend_company and
satisfaction_level is highly statistically significant. You can
confidently reject the null hypothesis, which posits that there is no
relationship between the two variables.
- The analysis reveals that spending more time at the company is
associated with higher job satisfaction. The relationship is
statistically significant, suggesting this trend is reliable and worth
considering when thinking about employee retention and satisfaction
strategies.