Mapping US State Unemployment Data

Data

This package contains a data.frame called ?df_state_unemployment which contains unemployment data on US States from 2000-2014. The data is annualized, which means that there is one data point per State per year:

library(rUnemploymentData)

data(df_state_unemployment)
?df_state_unemployment

head(df_state_unemployment)
      region 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013
1    alabama  4.1  4.7  5.4  5.4  5.0  3.8  3.5  3.4  5.0  9.7  9.2  8.5  7.1  6.5
2     alaska  6.2  6.2  7.1  7.7  7.4  6.9  6.5  6.1  6.4  7.7  8.0  7.6  6.9  6.5
3    arizona  4.0  4.7  6.0  5.7  5.0  4.7  4.1  3.7  6.0  9.8 10.4  9.4  8.3  8.0
4   arkansas  4.2  4.7  5.3  5.8  5.6  5.1  5.3  5.3  5.4  7.5  7.9  8.0  7.5  7.5
5 california  4.9  5.4  6.7  6.8  6.2  5.4  4.9  5.4  7.2 11.3 12.4 11.8 10.4  8.9
6   colorado  2.7  3.8  5.7  6.1  5.6  5.1  4.3  3.8  4.8  8.1  9.0  8.5  7.8  6.8

The data was scraped from the US Bureau of Labor Statistics (BLS) Local Area Unemployment Statistics (LAUS) webpage on January 4, 2014 (http://www.bls.gov/lau/) with the function ?build_state_df.

Visualization – Boxplot

The easiest way to visualize the entire dataset is with a boxplot.

?boxplot
boxplot(df_state_unemployment[, -1],
        main = "USA State Unemployment Data",
        xlab = "Year",
        ylab = "Percent Unemployment")

This visualization shows you, by year, the distribution of the unemployment rate in each state. For example, the recession that began in 2009 is very clear in this graph.

Visualization – Choropleth Map

This package also comes with a function to create choropleth maps of the data:

?state_unemployment_choropleth
state_unemployment_choropleth(year=2013)

Choropleth maps are useful for understanding the geographic distribution of values. For example, in this map it is clear that the lowest unemployment rates were in the northern central states.

Visualization – Animated Choropleths

A third option for visualizing the data is with an animated choropleth map:

?animated_state_unemployment_choropleth
# animated_state_unemployment_choropleth()

This function is commented out in the above example because the resulting image cannot render inside a vignette. If you are interested in this visualization, then please type the command locally. Note that it will write files to your local file system – see ?choroplethr_animate in the choroplethr package for details.