How your salary varies depending on your department?

The data that I am using is a information on Chicago’s various departments and their employee’s salaries, chicago_salaries. There are in total 4 variables:Name, Position, Department, and Salary. In the unfiltered data set, there are 35 different departments and a total of 32,432 observations. But I wanted to focus on the wide range of salaries in the 6 largest departments (Aviation, Fire, Police, Streets & Sanitation, Transportation, and Water Management), which narrowed our total number of observations to 24,944.

I want to present the phenomenon of how salaries vary across different departments, such as how some departments are overall paid higher than others. This visualization supports that in multiple ways. First, it shows the overall range of each department, all the way from its maximum to its minimum. The color gradient helps indicate how much the salary is a little better than when they are all the same color. And finally, the box plot indicates where the middle 50% (interquartile range) and median of the department’s salaries occurs. The median helps by creating a curve that shows overall difference between salaries in each department. The box plot also helps indicate where the majority of salaries fall for each department and that range. For example, the Water Management department has the biggest range in its interquartile, where as Streets & Sanitation have the smallest.

library(tidyverse)
library(readxl)

chicago_salary <- read_excel('ChicagoSalary.xls')

filtered_chicago_salary <- filter(chicago_salary, chicago_salary$Department %in% c("POLICE","FIRE","STREETS & SAN", "WATER MGMNT","AVIATION","TRANSPORTN"))

ggplot(filtered_chicago_salary, aes(Department, Salary, color = Salary))+
  geom_boxplot()+
  geom_point()+
  scale_y_continuous(labels = scales::dollar)+
  ggtitle("Chicago Department Salaries", subtitle = "Every salary with in each observed department in Chicago, IL")