Home Depot's (HD 1.03%) business has performed well year to date. It's on pace to grow comparable sales and profits for the current year, but that hasn't kept the stock from falling sharply along with the rest of the stock market.

Home Depot's stock price is down 35% year to date. That has brought the stock's valuation down to a price-to-earnings ratio of 16.3 based on this year's consensus earnings estimate. The inverse of the P/E gives an earnings yield of 6.1%, which is higher than the long-term U.S. treasury bond yield of 3.7%. A higher earnings yield can signal that a stock is undervalued.

While the stock looks like a good deal, investors should be careful about buying into a value trap. The economy just experienced two consecutive quarters of declining gross domestic product. Rising interest rates are a threat to a strong housing market that has propped up Home Depot's sales through the pandemic. With headwinds mounting, the stock may not be as cheap as it appears.

A weak housing market could halt Home Depot's growth

The median home sales prices accelerated from $329,000 in the first quarter of 2020 to $440,300 in the second quarter of 2022, according to the U.S. Department of Housing and Urban Development. That's a 34% increase in just over two years, which is much faster than the historical rate of increase. Since 1963, the median home sales price has climbed about 5% per year.

A line chart showing the appreciation in home values from 1963 through the first half of 2022.

Data source: U.S. Department of Housing and Urban Development. Chart by author. 

More time spent at home during the pandemic along with the positive wealth effect of rising home values contributed to strong sales growth for Home Depot.

The company's sales parallel the increase in median home sales prices since the start of 2020. Home Depot reported a 20% increase in sales in fiscal 2020 ending in January, followed by a 14% increase in fiscal 2021. This is much higher than the single-digit average annual increase over the last 10 years.  

HD Revenue (TTM) Chart

HD Revenue (TTM) data by YCharts

But just as Home Depot's sales can rise with the broader housing market, sales can also fall, as during the recession in 2008. The market is rerating the stock at a lower valuation in anticipation of a weaker backdrop for home improvement demand.

Indeed, the clouds are starting to darken over the housing market. As interest rates rise, it makes buying new homes and financing home improvement projects more expensive.

Effective Federal Funds Rate Chart

Effective Federal Funds Rate data by YCharts

Data intelligence firm Precisely used mobile tracking data and credit card purchases to learn more about how people are shopping at home improvement stores this year compared to 2021. The study found that store traffic fell 12% in April, with total spending down 25% year over year.  

Home Depot grew comparable sales in the first half of the year. Management expects full-year comp sales to be up approximately 3% over fiscal 2021. But these are much lower growth rates than the double-digit increases Home Depot reported last year.

The last time median home prices rose as sharply as they have in the last two years was the five-year period leading up to 2006. Over the next three years, Home Depot's revenue fell 18%, as the housing boom came to an end. Home Depot's stock fell to a P/E of 10 before rebounding with the broader market in 2009.

Wait for these signals

While history doesn't always repeat itself, investors should heed caution before buying Home Depot stock right now. The sector is coming off a rapid appreciation in home prices, and that rate of increase is not going to last. The spike in interest rates could cause homeowners to tighten their spending, which could hurt Home Depot's sales and send the stock lower.

I would wait for the stock to reach a lower valuation or watch for signs that interest rates are stabilizing before investing in Home Depot.