Great news: After a blistering few weeks, the S&P 500 (INDEX: ^GSPC) is up 8.5% year to date. The index now is just 14% away from its all-time high set in late 2007.

But is that the best way to view the market's progress? Using the nominal price of a stock or index to gauge performance over time ignores two important factors: inflation and dividends.

Using Yale economist Robert Shiller's collection of historic market data, I calculated what the S&P 500 would look like if you adjust for inflation and assume all dividends are reinvested. This is the most complete way to judge the performance of stocks over time. Here's what it shows:

Editorial

Sources: Robert Shiller and author's calculations.

Adjusted for inflation and accounting for dividends, the "true" S&P is about 12% off its 2007 high. That's not significantly different from the gap in the nominal share price because inflation has roughly been equal to dividends over the last five years -- it's been a wash. That's been true for the past 30 years as well: Dividends and inflation have been about the same, so the nominal return has more or less equaled the "true" return.

Over the long, long run, however, the difference is huge. Since 1871, the S&P has gone from 4.44 to 1,324, or an average annual increase of 4.12% per year. But when you adjust for inflation and account for dividends, the true return jumps to 6.65% per year. Over the course of a lifetime, that makes a big difference to returns.

If you're interested in a few high-quality dividend companies our analysts think will outperform over time, check out The Motley Fool's free report: "Secure Your Future With 11 Rock-Solid Dividend Stocks." It's free. Just click here.