Hi Statlist,

I am struggling into constructing the residuals' specific variance for the following model:

Code:
xtreg tasso_crescita_sales_prod L.log_sales L.dummy_2 L2.dummy_2 L3.dummy_2 mean_gr_rate_atc2 recalls_sales ageprodcat1 ageprodcat2 ageprodcat3 ageprodcat4 newmolfirm newmolmarket i.Year, fe vce(cluster idpr)
What I would like to do is to generate a variable consisting of the variance of regression residuals so that each residual has its own variance (not gen var = e(sigma_e) which generates a unique value).d
\overline{AV_{t}}=\sum_{i=1}^{N_{t}} \widehat{AV}_{it},