I would like to construct annualized volatility of returns for a panel data set in R. I have monthly returns (%) per month, per firm (entity), for a large dataset.
I would like to construct the five year average of annualized volatility of monthly returns - per year (t+5) and per firm.
Constructing this measure by it self is not difficult, but I would like to do it in R, so that it groups by firm & year. I am thankful for any help.
The data looks like this:
