Hi All,
I have monthly return data for companies. Based on these monthly returns, I need calculate annual returns of year t for 12-month period starting from 3-months after year t-1 fiscal year. That is, if company's fiscal year end on June, year t annual returns will be from October, this year to next year September.
My data is:
ID date ret
02 29feb1988 -.036144577
02 31mar1988 .025
02 29apr1988 -.048780486
02 31may1988 -.012820513
02 30jun1988 .025974026
02 29jul1988 -.012658228
02 31aug1988 -.025641026
02 30sep1988 -.013157895
02 31oct1988 0
02 30nov1988 -.06666667
02 30dec1988 -.042857144
02 31jan1989 .059701491
02 28feb1989 -.014084507
02 31mar1989 -.028571429
I know when the fiscal year end on December, the code is as follows.
gen int fy = year(date)
replace fy = fy-1 if month(date) < 4
gen log_one_plus_return = log(1+ret)
egen annual_return = total(log_one_plus_return), by(permno fy)
replace annual_return = exp(annual_return) - 1
But when some companies' fiscal year is not on December, then how can we create "fiscal year" to calculate the year t's annual returns starting from 3-months after year t-1 fiscal year?
Thanks!!!
I have monthly return data for companies. Based on these monthly returns, I need calculate annual returns of year t for 12-month period starting from 3-months after year t-1 fiscal year. That is, if company's fiscal year end on June, year t annual returns will be from October, this year to next year September.
My data is:
ID date ret
02 29feb1988 -.036144577
02 31mar1988 .025
02 29apr1988 -.048780486
02 31may1988 -.012820513
02 30jun1988 .025974026
02 29jul1988 -.012658228
02 31aug1988 -.025641026
02 30sep1988 -.013157895
02 31oct1988 0
02 30nov1988 -.06666667
02 30dec1988 -.042857144
02 31jan1989 .059701491
02 28feb1989 -.014084507
02 31mar1989 -.028571429
I know when the fiscal year end on December, the code is as follows.
gen int fy = year(date)
replace fy = fy-1 if month(date) < 4
gen log_one_plus_return = log(1+ret)
egen annual_return = total(log_one_plus_return), by(permno fy)
replace annual_return = exp(annual_return) - 1
But when some companies' fiscal year is not on December, then how can we create "fiscal year" to calculate the year t's annual returns starting from 3-months after year t-1 fiscal year?
Thanks!!!
Comment