Hi
I have a simple question that might be basic for most users here:
I have monthly stock returns and want to calculate annual returns that start 4 months after the end of the year.
I used this code to calculate annual returns:
gen compounded_annual_ret= (1+f1.ret)* (1+f2.ret)*(1+f3.ret)*(1+f4.ret)*(1+f5.ret)*(1+f6. ret)*(1+f7.ret)*(1+f8.ret)*(1+f9.ret)*(1+f10.ret)* (1+f11.ret)*(1+f12.ret)-1
or simply
gen annual_ret= f1.ret+f2.ret+f3.ret+f4.ret+f5.ret+f6.ret+f7.ret+f 8.ret+f9.ret+f10.ret+f11.ret+f12.ret
If I want returns that start 4 months after end of fiscal year for my monthly data, does the following code make any sense?
gen 4month_compoundedannualret=f4.compounded_annual_re t
or
gen 4month_annualret=f4.annual_ret
My questions are:
Are the codes used above correct?
If the identifier is "permno", do I need to add "bysort permno" to the beginning of the annual returns codes above ?
Thanks in advance
I have a simple question that might be basic for most users here:
I have monthly stock returns and want to calculate annual returns that start 4 months after the end of the year.
I used this code to calculate annual returns:
gen compounded_annual_ret= (1+f1.ret)* (1+f2.ret)*(1+f3.ret)*(1+f4.ret)*(1+f5.ret)*(1+f6. ret)*(1+f7.ret)*(1+f8.ret)*(1+f9.ret)*(1+f10.ret)* (1+f11.ret)*(1+f12.ret)-1
or simply
gen annual_ret= f1.ret+f2.ret+f3.ret+f4.ret+f5.ret+f6.ret+f7.ret+f 8.ret+f9.ret+f10.ret+f11.ret+f12.ret
If I want returns that start 4 months after end of fiscal year for my monthly data, does the following code make any sense?
gen 4month_compoundedannualret=f4.compounded_annual_re t
or
gen 4month_annualret=f4.annual_ret
My questions are:
Are the codes used above correct?
If the identifier is "permno", do I need to add "bysort permno" to the beginning of the annual returns codes above ?
Thanks in advance
Comment