Dear Statalist,
I'm struggling with computing a compounded monthly return. Later on, I also need to lag it for one week as to before running my regressions.
My data structure in panel data:
stock number day daily return
1 25jan2010 0.02
1 26jan2010 0
1 27jan2010 -0.01
2 25jan2010 -0.03
2 26jan2010 0.8
2 27jan2010 -0.001
. .
. .
. .
At the end, I want to have a new variable; comulative_return, that computes for each stock its monthly return.
I've looked into https://www.stata.com/statalist/arch...msg00563.html#
But unfortunately, this example is for the entire data sample and does not start counting from zero at the beginning of next month. After all that, I want to create a 'week_lag_comulative_return' that does the same, only waits for a week before starting. I think that is simple, though so as long as anyone can help with the first should be fine.
Thank you!
I'm struggling with computing a compounded monthly return. Later on, I also need to lag it for one week as to before running my regressions.
My data structure in panel data:
stock number day daily return
1 25jan2010 0.02
1 26jan2010 0
1 27jan2010 -0.01
2 25jan2010 -0.03
2 26jan2010 0.8
2 27jan2010 -0.001
. .
. .
. .
At the end, I want to have a new variable; comulative_return, that computes for each stock its monthly return.
I've looked into https://www.stata.com/statalist/arch...msg00563.html#
But unfortunately, this example is for the entire data sample and does not start counting from zero at the beginning of next month. After all that, I want to create a 'week_lag_comulative_return' that does the same, only waits for a week before starting. I think that is simple, though so as long as anyone can help with the first should be fine.
Thank you!
Comment