Exercise

What other differences exist?

One variable you didn't consider in your earlier statistical test is job level. Different job levels tend to have different pay levels, so if the mix of job levels for new hires is different than the mix of job levels for current employees, you could be dealing with omitted variable bias.

Check whether the job level composition is the same for new hires as it is for current employees.

Instructions 1/2

undefined XP
    1
    2
  • Load the ggplot2 package.
  • With the pay dataset, use geom_bar() to create a stacked bar chart. Put new_hire on the x-axis, and use the fill argument to color the bars by job_level.