I recently encountered the problem in a stock even study. The pseudo data looks like
DATE Index Volume StockReturn ReturnInterval
19990101 0.1 200 0.02 .
19990102 0.32 300 0.03 1
19990103 0.2 0 0 .
19990104 0.1 200 0.04 2
19990105 0.22 0 0 .
19990108 0.03 0 0 .
19990109 0.2 100 0.01 3
Here the volume 0 means on that day, the stock is not traded, but we still have the index return for the overall market. The return interval gives the number of returns between two traded dates. What I want to do is to sum of the index return over each return interval. ie: on day 19990102, the new index is itself 0.32, on day 19990104, the new index return should be 0.2+0.1, and on day 19990109, the new index return should be 0.22+0.03+0.2.
I hope any ppl can help me with this.. Heaps Thanks here first.