IniziaInizia gratis

Derive age difference

Different generations of the workforce have different views and opinions towards managing and delivering work and handling pressure.

New generation managers need to learn to motivate and manage the pool of older workers. Employees reporting to younger managers generally report overconfidence, lack of respect and inexperience of manager as a reason of turnover while as per younger managers, older employees wallow in their past achievements and do not accept the pace of change in work environment.

In this exercise, you'll calculate the age difference between employees and their respective managers and explore this distribution of age difference between Active and Inactive employees.

Manager age (mgr_age) and employee age (emp_age) are available in org_final.

Questo esercizio fa parte del corso

HR Analytics: Predicting Employee Churn in R

Visualizza il corso

Istruzioni dell'esercizio

  • Subtract emp_age from mgr_age to create a new variable, age_diff.
  • Generate a box plot to visualize this age difference for Active and Inactive employees.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Add age_diff
emp_age_diff <- org_final %>%
  ___(age_diff = ___ - emp_age)

# Plot the distribution of age difference
ggplot(___, aes(x = ___, y = ___)) + 
  geom_boxplot()
Modifica ed esegui il codice