I created a table of index price levels (for example, S & P 500), which I would like to calculate daily income. The structure of the table is as follows:
Date Value 2009-07-02 880.167341 2009-07-03 882.235134 2009-07-06 881.338052 2009-07-07 863.731494 2009-07-08 862.458985
I would like to calculate the daily arithmetic income (i.e. interest income) of the index, defined as:
Daily Return = P(2)/P(1) - 1
Where P represents the index value in this case. Given the above input table, the desired result will look like this:
Date Return 2009-07-03 0.002349318 2009-07-06 -0.001016829 2009-07-07 -0.019977077 2009-07-08 -0.001473269
It occurs to me that self-connection will work, but I'm not sure what the best way to increase the date on the second table is to take account of holidays.
Any thoughts on how best to do this?
Chris source share