hr <- read_csv('https://raw.githubusercontent.com/aiplanethub/Datasets/refs/heads/master/HR_comma_sep.csv')
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
The p-value is less than alpha (0.01), which means the correlation
between satisfaction_level and last_evaluation
is statistically significant. We reject the null hypothesis (H₀) and
conclude that there is a positive and small correlation between last
evaluation and satisfaction, indicating that as last evaluation scores
increase, satisfaction levels increase slightly.
As evaluations increase, satisfaction increases slightly.
ggplot(hr, aes(x = satisfaction_level, y = last_evaluation)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(title = "As evaluations increase, satisfaction increases slightly.",
x = "Satisfaction Level",
y = "Last Evaluation")
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
The p-value is is greater than alpha (0.01), so we fail to reject H₀ and conclude there is no statistically significant correlation between satisfaction level and average monthly hours.
No relationship between satisfaction and monthly hours.
ggplot(hr, aes(x = satisfaction_level, y = average_montly_hours)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(title = "No relationship between satisfaction and monthly hours.",
x = "Satisfaction Level",
y = "Average Monthly Hours")
cor.test(hr$last_evaluation, hr$number_project)
##
## Pearson's product-moment correlation
##
## data: hr$last_evaluation and hr$number_project
## t = 45.656, df = 14997, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.3352028 0.3633053
## sample estimates:
## cor
## 0.3493326
The p-value is less than alpha (0.01), so we reject H₀ and conclude there is a statistically significant correlation between last evaluation and number of projects. The correlation is positive and moderate, meaning as the number of projects increases, evaluation scores increase moderately.
More projects, higher performance evaluations.
ggplot(hr, aes(x = last_evaluation, y = number_project)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(title = "More projects, higher performance evaluations.",
x = "Last Evaluation",
y = "Number Project")
cor.test(hr$average_montly_hours, hr$number_project)
##
## Pearson's product-moment correlation
##
## data: hr$average_montly_hours and hr$number_project
## t = 56.219, df = 14997, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.4039037 0.4303411
## sample estimates:
## cor
## 0.4172106
The p-value is less than alpha (0.01), so we reject H₀ and conclude there is a statistically significant correlation between average monthly hours and number of projects. The correlation is positive and moderate, meaning as the number of projects increases, monthly hours worked increase moderately.
More projects, more hours worked.
ggplot(hr, aes(x = average_montly_hours, y = number_project)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(title = "More projects, more hours worked.",
x = "Average Monthly Hours",
y = "Number Project")