Dear STATA experts,
My sample consists of firm-year observations panel with unbalanced data over the period 2008 to 2016. I would like to measure the standard deviation of the industry-ajusted return on assets known as σ(ROA) for each firm in my sample over five-year overlapping periods (2008-2012 , 2009-2013 ,..., 2012-2016).
First, I have computed the industry-adjusted return on assets for each year by using the following codes:
egen average_roa=mean(roa), by(years industry)
gen adjusted_roa=roa-average_roa
However, I am very confused regarding the computation of the standard deviation over the five-year overlapping periods. I would really appreciate any help regarding a specific code.
Many thanks,
Nour
My sample consists of firm-year observations panel with unbalanced data over the period 2008 to 2016. I would like to measure the standard deviation of the industry-ajusted return on assets known as σ(ROA) for each firm in my sample over five-year overlapping periods (2008-2012 , 2009-2013 ,..., 2012-2016).
First, I have computed the industry-adjusted return on assets for each year by using the following codes:
egen average_roa=mean(roa), by(years industry)
gen adjusted_roa=roa-average_roa
However, I am very confused regarding the computation of the standard deviation over the five-year overlapping periods. I would really appreciate any help regarding a specific code.
Many thanks,
Nour
Comment