After more than two years of going nearly straight up, the stock market has many investors getting increasingly nervous. As optimism about the future seems only to grow, contrarians are following Warren Buffett's advice and getting fearful while everyone else is busy being greedy.

Whenever the market has had a nice run, it's reasonable to wonder if the bottom could fall out from under stocks in the near future. But given how irrational the market can be, even when stocks seem expensive, there's no guarantee that share prices won't just keep going up and up for a long time.

Is the market overvalued?
This month's brand-new issue of the Fool's Rule Your Retirement newsletter, which hits the digital newsstands today at 4 p.m. ET, addresses the concerns of its subscribers by asking the simple question: Is the market overvalued? With fears of inflation topping the list of worries among many investors, many stocks seem vulnerable to higher costs and tighter margins.

As a way to measure whether the market is overpriced, Foolish retirement expert and financial planner Robert Brokamp takes a look at several popular measures. Among them are Robert Shiller's CAPE measure, Nobel laureate James Tobin's Q ratio, and Warren Buffett's look at what amounts to the U.S. stock market's overall price-to-sales ratio. Brokamp concludes that by every measure, valuations are on the high side -- but they're not the highest they've ever been. Even with profit margins at record levels, which has historically been a bearish indicator for stocks, the exact path that the market will take is far from certain.

Picking cheaper stocks
But I'd like to focus a bit more on Buffett's indicator for a moment because I think it has application not just for the market at large but for individual stocks as well. Buffett prefers to wait until the ratio of the total market capitalization of U.S. stocks to the country's gross national product falls to between 70% and 80%. That's part of what justified his big -- and correct -- bullish call in late 2008. Right now, the measure is closer to 110%, confirming other indicators that show that valuations are extremely high.

On an individual stock basis, looking at the relationship between stock price and sales has value as well. But you shouldn't assume that a low price-to-sales ratio means that a stock is automatically a smart buy, because often, an individual company has good reason to trade at a depressed sales multiple. For instance, capital-intensive businesses including Dell (Nasdaq: DELL), Ford (NYSE: F), and General Motors (NYSE: GM) sport huge sales figures, but because those businesses have relatively narrow margins, even fairly high levels of revenue don't always translate into huge profit. That exposes one of the limitations of using the price-to-sales ratio; if a company loses money on its sales, then revenue growth is actually a bad thing for investors.

Mixing sales with profit
In order to avoid low-margin businesses, I screened for companies with low price-to-sales ratios as well as profit margins of 10% or more. Only four companies in the Russell 1000 passed the test, and the winners may shock you:

Stock

LTM Price-to-Sales Ratio

Net Margin

Tenet Healthcare (NYSE: THC) 0.36 12.0%
Domtar (NYSE: UFS) 0.69 11.7%
Gannett (NYSE: GCI) 0.69 10.4%
AIG (NYSE: AIG) 0.72 10.0%

Source: Capital IQ, a division of Standard & Poor's.

I didn't expect to see such a motley assortment of once-troubled stocks, but that's what the screen produced. What the test produces as good values includes both a scandal-plagued health-care stock that's been beaten down for more than a decade as well as a paper producer that's quadrupled in price in just two years. Many see Gannett as the top of the heap in a dying industry, while AIG is obviously one of the most infamous players among the ragged cast of characters that played key roles in the financial crisis.

Despite their histories, each of these stocks has managed to keep margins up while avoiding excessive run-ups in their stock prices, at least in comparison to their total revenue. That's not a foolproof test, and it's certainly not the only measure Buffett would look at in analyzing an individual stock rather than the market as a whole. But as a guide for starting your research, it's valuable.

Protect yourself
The rest of the latest issue of Rule Your Retirement includes even more tips, ranging from protecting yourself from inflation to learning how to plan for unforeseen events like accidents and injuries. It's easy to get a free look; it's just a click away with a free 30-day trial.

Even as the market pushes ever higher, smart investors always ask whether stocks are too expensive. The best investors, though, recognize that even in an expensive market, certain stocks will keep providing the value you need for your investing dollar.

Get started with your free trial of Rule Your Retirement today.