NYC Job posting and Salary Trends

Wansang Lim
Posted on Feb 16, 2016

Contributed by Wansang Lim. He is currently in the NYC Data Science Academy 12 week full time Data Science Bootcamp program taking place between January 11th to April 1st, 2016. This post is based on his second class project - R Shiny (due on the 4th week of the program).

This shiny web is designed to search government job and compare New York City job posting to understand NYC job trends.
Government Job Search
U.S Government has job search API ( https://search.digitalgov.gov/developer/jobs.html ). Federal, state, and local government agencies are hiring and have thousands of job openings across the country, posted on USAJobs.gov and local government jobs sites. This Jobs API allows you to tap into a list of current jobs openings with the government. Jobs are searchable by keyword, location, agency, schedule, or any combination of these. It is great for job websites or applications, job banks, and career counseling and placement application.
USjob

If we search job title, the main map shows opening job location. the red circle is proportional with the proposed salary. And the small map shows actual salary. One of technical achievement is that real time data conversion with API. The job serach API does not give us location ordinate. Google Maps Geocoding API converts address to longitude and latitude. UStable
After searching job, the detailed information is in job table.

What and where is this data?
New York city posts job posting in web site(https://www1.nyc.gov/jobs/index.page). The all data can be downloaded from https://data.cityofnewyork.us/City-Government/NYC-Jobs/kpav-sd4t .
- The csv file has 3826 rows and 26 columns.
-The duration of job posting is form 2011 to 2016/01

The object of NYC job
This app is made to help users to understand to trend of NYC job posting and salary by various categories.

App Structure
- Build 5 for 5 different analysis and make into on big App with radio buttons
- Because Different analysis has different data structure
- And finally, it shows NYC job location graphically in map by Agency.

Analysis Procedure
- histogram with all data with 3 different salary(minimun, maximum, average
1

Salary change of NYC jobs by time
time

At the time beginning, all salaries fluctuate a lot. However when time goes by, it became stable. One of the reason is that in the beginning there is not much NYC posting in web site.

NYC job posting analysis

  • histogram with position level
    2
  • There are some outliers in histogram by level.
    The outliers were grouped by job title for salary to see what and who they are.
    3
  • Salary change with time
    4

Conclusion

  • The frequent average salary is $50,000 ~ 70,000
  • Level is realted with salary
  • Medical job has higher salary even if it is in lower level
  • Job opening increased exponentially after December 2014(very curious!!!)
  • Average salary show less variation after December 2014

NYC job posting Information
nycMap
This map shows the NYC job locations. The circle represents the number of jobs in the locations. Sometimes, an agency post multiple jobs in one location. And the box plot shows the distribution of age. At the bottom, there is table for detailed information.

Code
- ui.R

library(shiny)

shinyUI(fluidPage(

Application title

titlePanel("NYC Job Posting Data"),

Sidebar with a slider input for number of bins

sidebarLayout(
sidebarPanel(
radioButtons("radio", label = h3("Whole or Part"),
choices = list("Whole Histogram" = 1, "Histogram by Level" = 2,
"Outlier or Not" = 3, "Salary by Time" = 4),
selected = 1),

conditionalPanel(condition = "input.radio == 1",
sliderInput("bins",
"Number of bars:",
min = 1,
max = 50,
value = 30),
selectInput("salary", "Choose a salary",
choices = c("minimum", "maximum", "average"))
),
conditionalPanel(condition = "input.radio == 2",
selectInput("salaryByLevel", "Choose a salary",
choices = c("minimum", "maximum", "average"))
),
conditionalPanel(condition = "input.radio == 3",
selectInput("OutNot", "Choose outlier or not",
choices = c("Outlier", "No Outlier"))
),
conditionalPanel(condition = "input.radio == 4",
radioButtons("radioTime", label = h3("Whole or Part"),
choices = list("Whole Data" = 1, "Part Data" = 2 ),
selected = 1),
#selectInput("wholePart", "Choose whole data or part data",choices = c("whole", "part")),

conditionalPanel(condition = "input.radioTime == 2",
sliderInput("rowNum",
"Start Year/Month:",
min = 1,
max = 29,
value = 1)
),

selectInput("salaryTime", "Choose a number or salary",
choices = c("total number", "minimum", "maximum", "average"))
)

),

Show a plot of the generated distribution

mainPanel(
plotOutput("distPlot"),
h4("Downloaded from "),
h5("- https://data.cityofnewyork.us/City-Government/NYC-Jobs/kpav-sd4t"),

)
)
))

  • server.R

    library(shiny)
    library(ggplot2)

shinyServer(function(input, output) {
#data input
dataSalHis <- read.csv("../dataSalHis.csv", stringsAsFactors=FALSE) #1 Graph
dataLevel <- read.csv("../levelPlotDa.csv", stringsAsFactors=TRUE) # 2 Graph
compareOut <- read.csv("../compareOut.csv") # 3 Graph
salaryByYYMM <- read.csv("../salaryByYYMM.csv")

output$distPlot <- renderPlot({
startYYMM <-input$rowNum
endYYMM <- startYYMM + 9
partData <- salaryByYYMM[startYYMM:endYYMM,]

salaryInput <- reactive( {
switch(
input$salary,
"minimum" = 2,
"maximum" = 3,
"average" = 4)
})

salaryLevelInput <- reactive( {
switch(
input$salaryByLevel,
"minimum" = 4,
"maximum" = 5,
"average" = 6)
})

outOrNot <- reactive({
switch(
input$OutNot,
"Outlier" = 1,
"No Outlier" = 2
)
})

salaryTimeInput <- reactive( {
switch(
input$salaryTime,
"total number" = "total",
"minimum" = "SalaryFromAve" ,
"maximum" = "SalaryToAve" ,
"average" = "SalaryAveAve" )
})

aa <- salaryInput()
x <- dataSalHis[, aa]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
columnSel <- salaryLevelInput()
choice <- outOrNot()
colName <- salaryTimeInput()

#Graph output
if (input$radio == 1) {
hist(x, breaks = bins, col = 'darkgray', border = 'white') #whole hist 1
} else if (input$radio == 2) {
plot(dataLevel[, 3], dataLevel[, columnSel]) # hist by Level
} else if (input$radio == 3) {
if (choice == 1) {
barGraph <- ggplot(compareOut, aes(x=OTitle, y=OAver)) + geom_bar(stat="identity")
barGraph + theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 12), panel.background = element_blank())
} else if (choice == 2) {
barGraph <- ggplot(compareOut, aes(x=NTitle, y=NAver)) + geom_bar(stat="identity")
barGraph + theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 12), panel.background = element_blank())
}
} else if (input$radio == 4) {
if (input$radioTime == 1) {
if (colName == "total") {
graphYYMM <- qplot(Posting.YYMM, total, data = salaryByYYMM)
graphYYMM + theme(axis.text.x = element_text(angle = 45, hjust = 1),
panel.background = element_blank())
} else if (colName == "SalaryFromAve") {
graphYYMM <- qplot(Posting.YYMM, SalaryFromAve, data = salaryByYYMM)
graphYYMM + theme(axis.text.x = element_text(angle = 45, hjust = 1),
panel.background = element_blank())
} else if (colName == "SalaryToAve") {
graphYYMM <- qplot(Posting.YYMM, SalaryToAve, data = salaryByYYMM)
graphYYMM + theme(axis.text.x = element_text(angle = 45, hjust = 1),
panel.background = element_blank())
} else if (colName == "SalaryAveAve") {
graphYYMM <- qplot(Posting.YYMM, SalaryAveAve, data = salaryByYYMM)
graphYYMM + theme(axis.text.x = element_text(angle = 45, hjust = 1),
panel.background = element_blank())
}

} else if (input$radioTime == 2) {

if (colName == "total") {
graphYYMM <- qplot(Posting.YYMM, total, data = partData)
graphYYMM + theme(axis.text.x = element_text(angle = 45, hjust = 1),
panel.background = element_blank())
} else if (colName == "SalaryFromAve") {
graphYYMM <- qplot(Posting.YYMM, SalaryFromAve, data = partData)
graphYYMM + theme(axis.text.x = element_text(angle = 45, hjust = 1),
panel.background = element_blank())
} else if (colName == "SalaryToAve") {
graphYYMM <- qplot(Posting.YYMM, SalaryToAve, data = partData)
graphYYMM + theme(axis.text.x = element_text(angle = 45, hjust = 1),
panel.background = element_blank())
} else if (colName == "SalaryAveAve") {
graphYYMM <- qplot(Posting.YYMM, SalaryAveAve, data = partData)
graphYYMM + theme(axis.text.x = element_text(angle = 45, hjust = 1),
panel.background = element_blank())
}
}
}

}) #output$distPlot

})

 

About Author

Wansang Lim

Wansang Lim

I am Ph.D of Agriculture with a lot of data experience during my research period. I got B.S from Seoul National University and both M.S and Ph.D from Cornell University in U.S.A. After Ph.D degree, I worked as...
View all posts by Wansang Lim >

Leave a Comment

No comments found.

View Posts by Categories


Our Recent Popular Posts


View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp