Introduction

How Business Cycles impact the search “hits” for Unemployment?

Overview

Here, I am interested to explore whether the search for topics such as Unemployment, Medicaid, Health Insurance and Food Stamps is influenced by business cycles (defined as periods of economic expansion and contraction) in the United States. I examine period of 2004 to present day as that allows us to see 4 years before the Recession onset in 2008 and also that Google Trends began in 2004.

Application in R: Note that we are using Philippe Massicotte’s gtrendsR the go-to package for running Google Trends queries in R. Not reuqired any setting up API keys or anything.

Base Plot

plot(trends.dcast$date, trends.dcast$Unemployment_US,
     type="n", ylim=c(0,100),
     ylab="Google Search Hits (Normalized)",
     xlab = "Date (Year/Month/Date)",
     xaxs="i", yaxs="i",
     las = 2, tck=-0.0, tcl = -0.0,
     main = "Google Search Hits for :\nUnemployment, Medicaid, Health Insurance and Food Stamps", cex.main=1)
lines(trends.dcast$date, trends.dcast$Unemployment_US,
      type="l", lwd=2.5, col="red2")
lines(trends.dcast$date, trends.dcast$Medicaid_US,
      type="l", lwd=2.5, col="black")
lines(trends.dcast$date, trends.dcast$`Health Insurance_US`,
      type="l", lwd=2.5, col="darkgreen")
lines(trends.dcast$date, trends.dcast$`Food Stamps_US`,
      type="l", lwd=2.5, col="purple")
legend("topright", legend=c("Unemployment", 
                           "Medicaid",
                           "Health Insurance",
                           "Food Stamps"),
       col=c("red2", "black", "darkgreen","purple"), lty=1, cex=0.8)

A GGPLOT With A Fancy Theme [Eh!]

trends %>%
  .$interest_over_time %>%
  mutate_at("hits", ~ifelse(. == "<1", 0.5, .)) %>% # replace with 0.5
  mutate_at("hits", ~as.numeric(.)) %>%
  ggplot(aes(x = date, y = hits)) +
  geom_line(colour = "red", size = 1.5) +
  facet_wrap(~keyword) +
  ggthemes::theme_fivethirtyeight() -> plot2

plot2

Findings

  • Business Cycle impacts the search hits for “unemployment”.
  • Unemployment search spiked in 2008 and was high till 2012 and started to see a downward trend since then as the economy recovered.
  • There is a relatively upward trend in search hits for “Medicaid” as compared to “food stamps” and “health insurance”.
  • This rise in Medicaid search hits since 2008 could signal struggling low income families with high insurance cost and prescription drugs.