每个公司(kpermno),每月股票收益率(mret)已知,但fiscal year end(fyrc)不同,想要求年度收益率。
问题:如何按照fiscal year end(fyrc)调整年份?想要计算annual stock return的年份end为:fiscal year end结束后推4个月。
如,1982年fiscal year end是12月,1982年5月到1983年4月都算作1982;而1982年4月及其以前为1981年、1983年5月及其以后为1983年。
若可以得到annual stock return的年份(year),则annual return(R)可以如下计算:
genx= mret+1
egenprodx = prod( x ), by( kypermno year )
genR=prodx-1
数据如图
Thanks♪(・ω・)ノ