Dear Statalister,
I have a few questions with respect to the table depicted below. Permno represents only one of the many funds in my dataset (CRSP Ziman).
Objective: calculate the past 11-month log return (one-month lagged) for all months of every fund. So, for dec. 1987 I want to calculate the past 11-month log return of the prior 11 months, and for jan. 1988 also... and so forth.
Does someone know how to do this? I already tried many different things, but unfortunately, I have not succeeded. Help would be highly appreciated!
Best,
Steven John
I have a few questions with respect to the table depicted below. Permno represents only one of the many funds in my dataset (CRSP Ziman).
Objective: calculate the past 11-month log return (one-month lagged) for all months of every fund. So, for dec. 1987 I want to calculate the past 11-month log return of the prior 11 months, and for jan. 1988 also... and so forth.
Does someone know how to do this? I already tried many different things, but unfortunately, I have not succeeded. Help would be highly appreciated!

permno 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 11230 |
date 30apr1987 29may1987 30jun1987 31jul1987 31aug1987 30sep1987 30oct1987 30nov1987 31dec1987 29jan1988 29feb1988 31mar1988 29apr1988 31may1988 30jun1988 29jul1988 31aug1988 30sep1988 31oct1988 30nov1988 30dec1988 31jan1989 28feb1989 31mar1989 28apr1989 31may1989 30jun1989 31jul1989 31aug1989 29sep1989 31oct1989 30nov1989 29dec1989 |
year 1987 1987 1987 1987 1987 1987 1987 1987 1987 1988 1988 1988 1988 1988 1988 1988 1988 1988 1988 1988 1988 1989 1989 1989 1989 1989 1989 1989 1989 1989 1989 1989 1989 |
price 10.625 10.25 10.125 10.5 9.75 9.75 9.5 9.5 9 9.125 9.5 9 8.875 8.75 8.875 9.125 8.5 8.625 8.375 7.875 7.375 8 7.75 8.125 8.25 7.75 7.75 8 7.5 7.25 6.625 4.875 5.5 |
return . -.0353 -.0122 .0667 -.0714 0 .0051 0 -.0211 .0139 .0411 -.0526 .0194 -.0141 .0143 .062 -.0685 .0147 .0058 -.0597 -.0254 .0847 -.0312 .0484 .0523 -.0606 0 .071 -.0625 -.0333 -.0448 -.2642 .2041 |
Best,
Steven John
Comment