Dear All,
I am currently facing the following problem and was wondering whether anyone could help. Suppose you have data in the following format:
So essentially the problem is, that there can be missing months, are a series end for example in jun. I would like to "ignore" this problem. So if the series end in june, just use the frist six months to compute the yearly returns. I guess the following approach needs to be taken:
Thanks in advance!
I am currently facing the following problem and was wondering whether anyone could help. Suppose you have data in the following format:
Code:
id time ret 1 01jan2000 -5.3 1 01feb2000 4.5 ... 1 01dec2000 5.6 1 01jan2001 -5.3 ... 1 01dec2001 5.6 2 01jan2000 -5.3 2 01feb2000 4.5 ... 2 01dec2000 5.6 2 01jan2001 -5.3 2 01feb2001 -5.3 2 01jun2001 -5.3 2 01jul2001 -5.3 2 01dec2002 5.6 2 01jan2002 -5.3 2 01feb2002 -5.3 .... 2 01dec2002 -5.3 ....
- create a new time variable that is easier to work with (convert it on monthly first I guess?)
- and then, "by id year" compute yearly returns
Thanks in advance!
Comment