开始使用免费开始使用

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

本练习是课程的一部分

HR Analytics: Predicting Employee Churn in R

查看课程

练习说明

  • Use compa_ratio to derive compa_level as per the condition mentioned above.
  • Create a bar chart of compa_level for active and inactive employees.

交互式实操练习

通过完成这段示例代码来试试这个练习。

# 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")
编辑并运行代码