The following data is from Dimensional Fund Advisors in the USA. From 1970 to 2013 the USA S&P 500 index compounded 10.40% per annum.
However, if you missed out some of the best days of the stock market, your returns will look drastically different. Missed out the best day is ok, but missed out the best 5 days, 15 days, 25 days and your returns are possibly 60% of what you could have garnered.
The lesson learnt here is that, it is probably very difficult to know when the best days will occur (and some of them are probably in the deepest end of the bear market) and missing out on them can be rather detrimental to your eventual wealth. This adds another plus point to staying in the market.