R Markdown

Question 1

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.
correlation <- cor(hr$satisfaction_level, hr$last_evaluation)
print(correlation)
## [1] 0.1050212

Question 2

the p value of shows a weak correlation as it is .105 which is greater than .05

Question 3

The weak correlation suggests that there is no meaningful relationship between satisfaction levels and last evaluation scores from a non-technical perspective

###Quesion 4

ggplot(hr, aes(x = satisfaction_level, y = last_evaluation)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE, color = "red") +
  labs(title = "Relationship Between Satisfaction Level and Last Evaluation",
       x = "Satisfaction level",
       y = "Last evaluation")
## `geom_smooth()` using formula = 'y ~ x'