I had unpredictable and sporadic raw image capture with my sd800 until I noticed the following completely predictable behavior:
1. A raw image is always captured if flash is used. The raw image capture does not depend on any temporal relation to other flash or non-flash shots. Also, it has no effect on subsequent non-flash shots in any temporal sequence.
2. A raw image is always captured if the shutter button is depressed half way and the camera is allowed to focus before the shutter button is fully depressed to complete the shot. This is true whether previous captured images have been completely written to the card or not before the shutter button is partially depressed and the camera focuses.
3. A raw image is only sporadically captured if the shutter button is fully depressed in one go. The raw image capture seems to bear some relation to the speed with which the shutter button is depressed (assumedly sometimes a raw image is captured because depression of the shutter button occurs in just the right rhythm to allow the camera to focus as in #2), but whether true or not such information is not practically useful, i.e., one cannot predictably capture a raw image by purposeful slower or faster full depression of the shutter button.