The current economic expansion is set to enter its tenth year this summer. Assuming we make it to June, this will become the longest U.S. economic expansion in recorded history stretching back to the 19th century. But how is the housing market doing? After a decade of recovery housing market activity still has room for improvement, but trends in 2018 were negative. Home sales, housing construction and house price growth all declined in 2018.
Earlier this month I attended the National Association for Business Economics (NABE) annual policy conference in Washington D.C. LINK. One of the keynote speeches was by Alan Greenspan. During his remarks, Greenspan mentioned that while economic forecasting was hard demographic projections were the surest thing in an uncertain business.
Demographics of course are not easy, but it’s much easier to guess what the population of 30 years olds will be in 5 years than it is the predict the unemployment rate or GDP in 5 years.
The U.S. housing market stalled out a bit in 2018 and we aren’t building enough homes to match demand. See my recent speech for details on what’s going on. Abbreviated version: in 2018 mortgage interest rates slowed housing activity, but demographic forces support housing demand and should provide a lift in years to come. Together with a recent moderation in mortgage rates there’s reason to be optimistic about housing market activity in 2019.
Last week I gave a speech in Cincinnati, Ohio at the UC/PNC Economic Outlook program. My speech was titled “Forecasting in a Vulnerable Economy”. You can find slides and detailed notes over on LinkedIn: https://www.linkedin.com/pulse/forecasting-vulnerable-economy-leonard-kiefer/.
In this post I want to share R code for the first three plots on the Vulnerable Economy.
We’ll get the data via the St Louis Fed’s FRED. We’re going to grab the Fed Funds rate FEDFUNDS, the Unemployment Rate UNRATE the Congressional Budget Office’s estimate of the long-run natural rate of unemployment NROU and the spread between the 10-year and 2-year U.
Here’s some R code for an animated chart of the U.S. prime working age (25-54) labor force participation rate. I tweeted it out last Friday:
Labor force participation rate #dataviz made with #rstats #gganimate pic.twitter.com/uSICoLjbIf
— 📈 Len Kiefer 📊 (@lenkiefer) February 1, 2019 We can go to the U.S. Bureau of Labor Statistics (BLS) webpage (https://www.bls.gov/) and get these data. For more details see my post Charting Jobs Friday with R.
Because reasons I’ve been interested in picking up some Python. But I like the Rstudio IDE, so it sure would be nice if I could just run Python from R. Fortunately, that’s possible using the reticulate package. Let’s give it a try.
Our strategy will be to use R to do the data wrangling and then pass the data to Python to make a plot. Is this a good idea?
I went up to New York and spoke with Barry Ritholtz on his Masters in Business podcast.
Some links:
The podcast
A transcript
Bloomberg View: Every Graph Tells a Story
I am really glad I got the chance to chat with Barry and share some of my story. Have a listen if you want to learn more about my work and background, the mortgage finance industry, and how I use data visualization.
I really like R, but I love the R community. Since I’ve started using R intensively in the past couple of years, I’ve constantly been awed and inspired by all the amazing things that people are doing with R. The spirit of the open source community and people’s willingness to share their thoughts and code is fantastic.
Many times in this space we’ve remixed different data visualizations with R, often relying on awesome new packages that others have developed.
At the start of the year, the R package gganimate hit CRAN. See this announcement blog post with some examples.
In this space, I’ve shared several posts on animation see tags. But I haven’t been using gganimate. Instead, I took a more direct approach building the animations via loops and trying to tween directly if I wanted a smooth animation. This level of control is nice, but frankly the defaults in gganimate work better than many of my attempts to hand craft it.
It’s the time of the year where everybody is dusting off their crystal balls and peering into the future. There’s even still time to send out your “Winter is Coming” newsletter.
Let’s take a step back and look at how forecasts of U.S. macro variables have evolved. Is forecasting still hard?
Last year we looked at historical forecasts of economic conditions in the post forecasting is hard. Let’s update it.