Hi everyone,
I have 15 years (2005-2019) of 548 municipalities general revenue data. I'm trying to generate the revenue volatility which is defined as the extent to which actual revenue differs from expected revenue. To measure deviations in actual revenue from expected revenue, a revenue growth trend regression model was first estimated as Rit = exp( α + β1 t + β2 i)

In this equation, the natural log of total general revenue for municipality i in year t (Rit) is modeled as a function of a time variable indicating the year (t) and a series of n-1 dichotomous variables identifying each municipality in the data set (i). From this regression equation, absolute deviations of the residuals serve as the dependent variable of revenue volatility.
How can I generate this revenue volitality using stata?

Thanks in advance