The stock market has been roaring since March. In fact, the S&P 500 (^GSPC 1.02%) is up a whopping 19% from its March low, and higher to the tune of 30% since it hit a cyclical bottom in October.

A funny thing happened while stocks were rallying over the course of the past few months, though: They became surprisingly expensive. Although their collective valuation isn't outrageous, given the scope of the recent run-up paired with the S&P 500's resulting price-to-earnings (P/E) ratio, it wouldn't be a crazy choice for investors to take a step back here and wait for things to cool off.

The S&P 500 is overvalued for a long-forgotten reason

If you're looking for a number, here it is: The S&P 500 is now priced at 22.4 times its earnings for the past four reported quarters (ending with Q2), and is priced at 20.1 times its expected profits for the next four quarters (starting with Q3 of this year). Both are relatively rich valuations, suggesting there's not a whole lot of upside left in store for the near term compared to the growing risk of a correction.

Chart showing the rising price/earnings ratio of S&P 500 versus per-share earnings.

Data sources: Yahoo! Finance and Standard & Poor's. Chart by author. TTM = trailing 12 months. EPS = earnings per share.

The graphic above indicates that price-to-earnings ratios in the ballpark of 20 aren't terribly unusual. We've even seen higher valuations in recent years. We haven't seen much higher valuations last for long, however, and they're usually rooted in unusual circumstances like pandemics and recessions.

That's not even the biggest concern for the market at its current valuation, though.

Benchmark interest rates impact equity valuations. Low interest rates tend to inflate them, while high interest rates often deflate them. When yields on bonds are high, that makes stocks a little less attractive, but when bond interest rates are low, stocks are a more productive bet.

For the past 15 years, interest rates have been unusually low. Even when the Federal Reserve was ratcheting up rates back in 2007 and again in 2018, the federal funds rate was nearer to its historical lows than not.

Things have changed dramatically since early last year though. The Federal Reserve has lifted the federal funds rate to a 20-year high, and market-based interest rates on instruments like corporate bonds and U.S. Treasuries have risen in tandem.

Effective Federal Funds Rate Chart

 Data source: YCharts.

Based on what the members of the Federal Open Market Committee have been telling us, it's unlikely that they will dial interest rates back much anytime soon. Several Federal Reserve Bank governors believe another rate hike is in the cards for this year, in fact.

As for what it means for the market, although the interest rate backdrop hasn't yet prompted investors to rethink their views on what a palatable P/E ratio (trailing or projected) is, a dose of reality in the form of market weakness just might do the trick. Stocks will correct sooner or later. When they do, the recovery that follows may not be as robust as past bounces have been, as at least some investors will opt for asset allocations that feature more bonds and fewer equities. That's a dynamic that could persist for years, working against frothy valuations the whole time.

It's safe enough, but that's not the whole story

OK, but is the market safe to invest in right now?

It largely depends on your time frame and your definition of "safe." If you're strictly a short-term stock trader and want a guarantee that stocks will be higher three months from now, no, the market isn't safe for you right now. If you're a true long-term investor and are more concerned about the next five years than you are about the next five days, sure, it's safe. Last quarter's gross domestic product growth came in better than expected at 2.4% annual rate, for instance. The S&P 500's earnings outlook suggests corporate bottom lines will be up on the order of 9% for the second quarter, en route to a record in 2024. This is good for stocks even if they don't avoid a short-term stumble. 

Even long-term investors, though, would do well to accept that the recent rise in interest rates will change what works and what doesn't. Growth stocks have led the market for the better part of the past 15 years -- but higher interest rates often favor value stocks at the expense of growth stocks. There's no reason to think this particular period of higher rates will produce a different result than similar past periods.

^SPXG Chart

Data source: YCharts.

Bottom line? You might want to brace for at least a small correction. Stocks are just plain overvalued, overbought, and ripe for profit-taking. Don't sweat it too much if (or when) it happens, though, even if it's a sizable correction. The important takeaway is that while you want to stay in the market even in the event of a pullback, you'll also want to start shifting some of your portfolio away from aggressive growth stocks and toward value stocks.