Deriving Compa-level
Compa-ratio of greater than 1 implies the employee is paid above the median compensation, thus ensuring competitive pay.
Based on compa-ratio, you will calculate compa_level as:
- "Above", if compa-ratio is greater than 1
- "Below", otherwise
Cet exercice fait partie du cours
HR Analytics: Predicting Employee Churn in R
Instructions
- Use
compa_ratioto derivecompa_levelas per the condition mentioned above. - Create a bar chart of
compa_levelfor active and inactive employees.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Add compa_level
emp_final <- emp_compa_ratio %>%
mutate(compa_level = ___)
# Compare compa_level for Active & Inactive employees
ggplot(emp_final, aes(x = status, fill = ___)) +
geom_bar(position = "fill")