This assignment analyzes employee attrition data using correlation
and visualization techniques in R.
We examine relationships between key employee metrics and interpret the
significance of these correlations.
The dataset contains information about employees, including: - Satisfaction levels - Last evaluation scores - Number of projects - Average monthly hours - Time spent at the company - Work accidents - Promotion history - Department and salary levels
```r # Perform correlation test cor.test(hr\(satisfaction_level, as.numeric(factor(hr\)salary)))
ggplot(hr, aes(x = as.numeric(factor(salary)), y = satisfaction_level)) + geom_point() + geom_smooth(method = “lm”, color = “red”) + labs(title = “Does Higher Salary Mean Higher Satisfaction?”, x = “Salary (Low to High)”, y = “Satisfaction Level”)
cor.test(hr\(time_spend_company, hr\)last_evaluation)
ggplot(hr, aes(x = time_spend_company, y = last_evaluation)) + geom_point() + geom_smooth(method = “lm”, color = “blue”) + labs(title = “Longer Time at Company, Higher Evaluation?”, x = “Years at Company”, y = “Last Evaluation Score”) # 3 Perform correlation test cor.test(hr\(average_montly_hours, hr\)number_project)
ggplot(hr, aes(x = average_montly_hours, y = number_project)) + geom_point() + geom_smooth(method = “lm”, color = “green”) + labs(title = “More Hours, More Projects?”, x = “Avg Monthly Hours”, y = “Number of Projects”)
cor.test(hr\(satisfaction_level, hr\)number_project)
ggplot(hr, aes(x = number_project, y = satisfaction_level)) + geom_point() + geom_smooth(method = “lm”, color = “purple”) + labs(title = “More Projects, Lower Satisfaction?”, x = “Number of Projects”, y = “Satisfaction Level”)
The correlation analysis of employee attrition data provided key insights into various work-related factors:
Understanding these correlations can help businesses make data-driven decisions to improve employee satisfaction, optimize workloads, and enhance job performance.
Future research could explore additional factors, such as work-life balance and promotion history, to gain deeper insights into employee well-being.