Labor Market Analysis with R: Will Obama Ever be Beat?

No matter how many jobs are promised, Barak Obama’s administration will be nearly impossible to beat when it comes to employment growth. The following code uses the blcrapeR package, which is available on CRAN.

Politicians talk a lot about jobs and unemployment, even though the actual power they have over the labor market is up for debate. Before you comment, please know I have no interest in politics, but ggplot2 is my friend!


df <- bls_api(c("LNS12000000", "LNS13000000", "LNS14000000"),
              startyear = 2008, endyear = 2017) %>%
    # Add time-series dates
# Plot employment level
gg1200 <- subset(df, seriesID=="LNS12000000")
ggplot(gg1200, aes(x=date, y=value)) +
    geom_line() +
    labs(title = "Employment Level - Civ. Labor Force")

# Plot unemployment level
gg1300 <- subset(df, seriesID=="LNS13000000")
ggplot(gg1300, aes(x=date, y=value)) +
    geom_line() +
    labs(title = "Unemployment Level - Civ. Labor Force")

gg1400 <- subset(df, seriesID=="LNS14000000")
ggplot(gg1400, aes(x=date, y=value)) +
    geom_line() +
    labs(title = "Unemployment Rate - Civ. Labor Force")

4 thoughts on “Labor Market Analysis with R: Will Obama Ever be Beat?

  1. If you extend the time series to previous years, you will see that employment is only back at the levels first reached in 1977. Also, you need to plot the number of people ‘out’ of the labor force. That will put the recovery into proper perspective. The unemployment figure does not count for people who stopped looking for work. Finally, one can look into the ‘type’ of jobs created, which would show highly paid lawyer jobs replaced by serving tables ones.

    When you look for these variables, the Obama recovery looks less stellar.

  2. will obama ever be beat for having the lowest percent of able bodied actually working? the last I saw, after his 8 yrs, there were roughly 2 million less employed than when he took office(could be mistaken on actual number). Use of the proper stats and/or data included in sample is imperative. Pollsters last year were greatly embarrassed due to choosing to sample the appropriate population. Beautiful models built on fiction predict fiction. Due to having contacts in rural areas giving me some impressions, I won a few wagers on Trump.

Leave a Reply