= (
house_pr 'USSTHPI',
pdr.get_data_fred(='1975-01-01')
start
.reset_index()={'DATE': 'Date',
.rename(columns'USSTHPI': 'Price_Index'})
)
Housing
Introduction
In this chapter we will briefly touch on a subject that has garnered many news headlines lately: home prices. This is an important macroeconomic area that for many years did not enjoy such widespread attention. Home prices had a “steady-as-she-goes” quality during the 1980s and 1990s, but all that changed in the run-up to the financial crisis of 2008 and then we the housing sector had another jolt after Covid-19.
When we want to analyze home prices, the first challenge is how to measure them. Every home in the U.S. has a theoretical price, but for most it is unobservable because homes trade infrequently. The Federal Housing Finance Agency (FHFA) provides one of the most comprehensive house price indexes for the U.S. constructed from repeated transactions of the same property (that is, a home that is resold or a mortgage that is refinanced). Importantly, the FHFA only considers single family homes and its information is sourced from Fannie Mae and Freddie Mac, thus it reflects mortgages under the conformable limit.1 The FHFA house price index is available at the national level plus all 50 states since 1975 at the quarterly frequency. We will use the state level data to construct a new type of chart called a choropleth map.
We should note there are other home price indexes available; in particular, the S&P CoreLogic Case-Shiller index is a very popular one. However, this index does not have such a long time series (it starts in 1987) and is available only for the largest 20 metro areas in the country. For this reason, we will stick to the FHFA index for this chapter.
Home Prices Over the Years
As an initial step let’s pull the FHFA home price index for the whole country and visualize how prices have behaved over time. We pull this index from FRED and get its whole history starting in 1975.
Let’s plot the index itself to see if we can note any trends in home prices.
(
alt.Chart(house_pr,= alt.Title(
title 'FHFA U.S. Home Price Index',
= 'source: FRED',
subtitle
))
.mark_line()
.encode('Date:T').title(None),
alt.X('Price_Index:Q').title(None)
alt.Y(
) )
We can see the low and steady increase in the index since its beginning in 1975 until the early 2000s when it starts to increase faster until 2007 when we then observe a severe downturn in home prices; this was the run-up to the financial crisis and its aftermath. It takes about a decade for home prices to get back to their level just before the crisis, and during the 2020s, after the Covid-19 shock, the increase in prices is quite steep.
Let’s now take a look at the rate of change in prices, what we normally call inflation. Recall that this data is quarterly, so annual inflation is the four quarter change. We compute this quickly with the pct_change
method from pandas
—note that despite its name, this method computes the decimal (not percentage) change.
'annual_inflation'] = house_pr['Price_Index'].pct_change(4) house_pr[
Let’s visualize annual home price inflation and use a similar template to one we used for GDP. We will make a bar chart with different colors for positive and negative inflation. In addition, we will add a dashed line at the average annual inflation over the whole period; this is an easy trick to include more information in a chart with minimal work.
(
alt.Chart(house_pr,= alt.Title(
title 'FHFA U.S. Home Price Index',
= 'source: FRED'))
subtitle
.mark_bar()
.encode('Date:T').title(None),
alt.X('annual_inflation:Q').title('Annual Inflation')
alt.Y(format='%'),
.axis(= alt.condition(
color > 0,
alt.datum.annual_inflation 'royalblue'),
alt.value('maroon') )
alt.value(
)
+
# add line at mean inflation rate
alt.Chart(house_pr)='green', strokeDash=[5,3])
.mark_rule(color= 'mean(annual_inflation):Q')
.encode(y )
This chart make clear the two big shocks of our sample: the financial crisis, where we see annual home price deflation for four years, and the Covid-19 period, where annual inflation reaches a staggering 20%.
Mortgage Interest Rates
Home Prices and Population
Conclusion
Footnotes
More information on this index can be found at https://www.fhfa.gov/Media/PublicAffairs/Pages/House-Price-Index-Frequently-Asked-Questions.aspx↩︎