Hi all, I am performing the following fixed effect regression on an unbalanced panel model:
I would like to compute the variance of all the residuals and store It into a variable.
do not seem to do what I want...specifically: I constructed a variable consisting of the residuals of the estimation (variable av_it):
What I would like to do is to compute Var(av_it) and then average it over time.
Code:
quietly 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)
Code:
e(sigma_e) // or e(sigma_u)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(idproduct Year av_it) 8 2004 . 8 2015 . 22 2004 . 22 2005 . 22 2006 . 22 2007 0 22 2008 . 22 2009 . 22 2010 . 22 2011 . 41 2004 . 41 2005 . 41 2006 . 41 2007 .303154 41 2008 -.14690971 41 2009 .006593704 41 2010 .2429447 41 2011 -.1774826 41 2012 -.8590889 41 2013 .12342644 41 2014 .50736046 41 2015 . 44 2005 . 44 2006 . 44 2007 . 44 2008 -.9983988 44 2009 .12073898 44 2010 -.5993109 44 2011 . 44 2012 -1.4308786 44 2013 1.45887 44 2014 1.4698343 44 2015 -.02085495 62 2004 . 62 2005 . 62 2006 . 62 2007 . 62 2008 . 62 2009 . 62 2010 . 62 2011 . 62 2012 . 62 2013 . 62 2014 . 62 2015 0 99 2004 . 99 2005 . 99 2006 . 99 2007 . 99 2008 . 99 2009 . 99 2010 . 107 2004 . 107 2005 . 107 2006 . 107 2007 . 107 2008 . 107 2009 2.132491 107 2010 . 107 2011 . 107 2012 . 107 2013 . 107 2014 . 107 2015 -2.132491 108 2004 . 108 2005 . 108 2006 . 108 2007 . 108 2008 . 108 2009 . 108 2010 . 108 2011 . 108 2012 . 108 2013 . 108 2014 . 108 2015 . 114 2004 . 114 2005 . 114 2006 . 114 2007 -.7792645 114 2008 .26324368 114 2009 .1756668 114 2010 .4246168 114 2011 -.0842619 114 2012 . 114 2013 . 114 2014 . 114 2015 . 130 2004 . 130 2005 . 130 2006 . 130 2007 .6940765 130 2008 -.6289883 130 2009 .6858149 130 2010 . 130 2011 -.4151192 130 2012 -.335784 130 2013 . 130 2014 . 130 2015 . end
Comment