Get startedGet started for free

Deriving Compa-ratio

Employees always expect that they are paid fairly compared to their co-workers, and hence, maintaining internal pay parity is important.

Competitiveness of each employee's pay can be assessed by Compa-ratio. In this exercise, you'll derive compa-ratio as:

$$\text{Compa-ratio} = \frac{\text{Actual compensation}}{\text{Median compensation}}$$

Median compensation is used by organizations to estimate the typical pay for any role/level. This metric helps the organization to correct the compensation of employees who are way below the median compensation.

Note: Remember, median is also known as the 50th percentile. Exactly 50 percent of people make less than the median and 50 percent make more.

This exercise is part of the course

HR Analytics: Predicting Employee Churn in R

View Course

Exercise instructions

  • For each level, calculate the median compensation (median_compensation) and compa-ratio (compa_ratio).
  • Print the median compensation for each level.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Add median_compensation and compa_ratio
emp_compa_ratio <- emp_tenure %>%  
  group_by(___) %>%   
  mutate(median_compensation = ___, 
         compa_ratio = ___)

# Look at the median compensation for each level           
emp_compa_ratio %>% 
  ___(level, median_compensation)
Edit and Run Code