F. Garavito
2009-Nov-24 20:04 UTC
[R] Monthly Returns where first day is the 14th of the month and last day is the 13th of next month
Dear All, I am trying to do something very simple but I have not been able to figure it out. I am trying to calculate monthly returns (i.e stock returns) from daily prices, where the first price is on the 14th day of the month and the last price is on the 13th day of the next month. The return will then be defined as: Return = [Last Price - First Price ] / First Price My dataset contains daily prices of securities sorted by day (i.e. March/01/1990, March/02/1990, etc.). I have tried to do it with the xts package without success. Many Thanks, Fabian [[alternative HTML version deleted]]