Objective

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.

Data

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


Correlation Analysis

1 Correlation: Satisfaction Level vs. Salary

```r # Perform correlation test cor.test(hr\(satisfaction_level, as.numeric(factor(hr\)salary)))

Technical Interpretation:

- Correlation coefficient: 0.0117 (very weak positive correlation).

- P-value: 0.15 (not statistically significant, p > 0.05).

Non-Technical Interpretation:

- Employees with higher salaries do not necessarily have higher satisfaction.

- Salary does not have a strong impact on job satisfaction.

Visualization

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”)

2 Perform correlation test

cor.test(hr\(time_spend_company, hr\)last_evaluation)

Technical Interpretation:

- Correlation coefficient: 0.1316 (weak positive correlation).

- P-value: < 2.2e-16 (highly significant).

Non-Technical Interpretation:

- Employees who stay longer at the company tend to have slightly higher evaluation scores.

Visualization

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)

Technical Interpretation:

- Correlation coefficient: 0.4172 (moderate positive correlation).

- P-value: < 2.2e-16 (highly significant).

Non-Technical Interpretation:

- Employees who work more hours tend to have more projects.

Visualization

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”)

4 Perform correlation test

cor.test(hr\(satisfaction_level, hr\)number_project)

Technical Interpretation:

- Correlation coefficient: -0.1429 (weak negative correlation).

- P-value: < 2.2e-16 (highly significant).

Non-Technical Interpretation:

- Employees who handle more projects tend to have slightly lower satisfaction levels.

Visualization

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”)

Conclusion

The correlation analysis of employee attrition data provided key insights into various work-related factors:

  • Salary does not significantly affect job satisfaction.
    • The correlation between satisfaction level and salary was very weak and not statistically significant, meaning that earning a higher salary does not necessarily lead to increased job satisfaction.
  • More projects are linked to lower job satisfaction.
    • Employees who handled more projects showed a weak but statistically significant negative correlation with satisfaction levels, suggesting that a heavier workload might reduce employee happiness.
  • Employees working more hours tend to handle more projects.
    • There was a moderate positive correlation between average monthly hours and the number of projects, meaning that employees who work longer hours tend to be responsible for more projects.
  • Longer tenure is associated with slightly higher evaluation scores.
    • A weak positive correlation showed that employees who stayed at the company longer received slightly better performance evaluations.

Final Insights

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.