ggplot(hr_data, aes(x = factor(left), y = satisfaction_level, fill = factor(left))) +
geom_boxplot() +
labs(title = "Box Plot for Employee Satisfaction by Left Status", x = "Left", y = "Satisfaction Level") +
scale_fill_manual(values = c("0" = "blue", "1" = "orange")) +
theme_minimal()

# Box plot for Last Evaluation by Left Status
ggplot(hr_data, aes(x = as.factor(left), y = last_evaluation, fill = as.factor(left))) +
geom_boxplot() +
xlab("Left (0=Stayed, 1=Left)") +
ylab("Last Evaluation") +
ggtitle("Box Plot for Last Evaluation by Left Status") +
scale_fill_manual(values = c("0" = "blue", "1" = "orange")) +
theme_minimal()

# Select continuous variables for the correlogram
HR_continuous <- hr_data %>%
select(satisfaction_level, last_evaluation, number_project, average_montly_hours, time_spend_company)
# Calculate correlation matrix
cor_matrix <- cor(HR_continuous)
## Correlogram of Continuous Variables
ggcorrplot(cor_matrix,
method = 'square',
type = 'lower',
lab = TRUE,
colors = c("blue", "white", "orange")) +
ggtitle("Correlogram of Employee Satisfaction, Evaluation, and Other Continuous Variables")
