R Markdown
library(readr)
library(ggplot2)
hr <- read_csv('https://raw.githubusercontent.com/aiplanethub/Datasets/refs/heads/master/HR_comma_sep.csv')
## Rows: 14999 Columns: 10
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): Department, salary
## dbl (8): satisfaction_level, last_evaluation, number_project, average_montly...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
1. b.Interpret the results in technical terms (.5 point) For each
correlation, explain what the test’s p-value means (significance).
# The results of the test show that there is no correlation between satifcation level and the average hours employees work monthly. The p-value is less than the common significance level of 0.05, at 0.01408. The results are statistically significant and there is no correlation between average hours worked per month and employee satisfaction.
1.c. Interpret the results in non-technical terms (1 point) For each
correlation, what do the results mean in non-techical terms.
# this means that employees satisfaction level at the company has nothing to due with the average amount of hours they work every month. So, their satisfaction level is due to another factor.
1. d.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 = "Average Monthly Hours vs. Satisfaction",
x = "Ave Monthly Hours",
y = "Satisfaction")
## `geom_smooth()` using formula = 'y ~ x'

2. b.Interpret the results in technical terms (.5 point) For each
correlation, explain what the test’s p-value means (significance).
# as average monthly hours increase, satisfaction level tends to decrease slightly.The p-value of 0.01408 is below 0.05, which suggests that the correlation is statistically significant.
2.c. Interpret the results in non-technical terms (1 point) For each
correlation, what do the results mean in non-techical terms.
# it appears that when employees work more hours, their satisfaction levels tend to drop just a little bit. If someone is working longer hours, it might slightly affect how content they feel about their job.
2. d.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 = number_project, y = time_spend_company)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(title = "Number of Projects vs. Amount of Time at Company",
x = "Projects",
y = "Time at Company")
## `geom_smooth()` using formula = 'y ~ x'

3. b.Interpret the results in technical terms (.5 point) For each
correlation, explain what the test’s p-value means (significance).
# the correlation coefficient is approximately 0.128, indicating a weak positive correlation. The p-value is less than 2.2e-16, which is less than 0.05.This suggests that the correlation is statistically significant.
3.c. Interpret the results in non-technical terms (1 point) For each
correlation, what do the results mean in non-techical terms.
# If an employee work more, they are likely to stay at the company longer.
3. d.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 = time_spend_company)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(title = "Ave Monthly Hours vs. Time at Company",
x = "Ave Monthly Hours",
y = "Time at Company")
## `geom_smooth()` using formula = 'y ~ x'

4. b.Interpret the results in technical terms (.5 point) For each
correlation, explain what the test’s p-value means (significance).
# The correlation coefficient in this test is 0.145, which indicates a weak positive correlation. The p-value is less than 2.2e-16, which is much lower than 0.05 proving that the correlation is statistically significant.
4.c. Interpret the results in non-technical terms (1 point) For each
correlation, what do the results mean in non-techical terms.
# employees who have been with the company for a longer time are more likely than not to leave.
4. d.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 = left, y = time_spend_company)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(title = "Left vs. Time at company ",
x = "left company",
y = "time at company")
## `geom_smooth()` using formula = 'y ~ x'
