I have an unbalanced panel dataset. Panel variable is firm_id and time variable is year. The time period is between 2010 and 2015. I have been trying to compute the exponentially weighted average of past performance. Thus, I picked tssmooth exponential. However, when I applied the tssmooth exponential, all the firms without all six years generate missing values for the exponential smoothed performance. For example, if Firm 2 has only 2010, 2011, and 2012, the exponentially weighted average of past performance for Firm 2 will be missing. I get stuck on how to avoid these missing values. Are there any other ways to compute the exponentially weighted average of past performance? Really looking forward to suggestions. Thank you in advance.
Best,
David
Herere athe sample data and my codes:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int year int firm_id float performance 2010 1 0.053 2011 1 0.075 2012 1 0.088 2013 1 0.036 2014 1 0.049 2015 1 -0.109 2010 2 0.464 2011 2 -0.014 2012 2 -0.002 2010 3 0.120 2012 3 0.018 2010 4 0.038 2011 4 0.045 2012 4 0.051 2013 4 0.127 2014 4 0.057 2015 4 0.059 2010 5 0.134 2011 5 0.117 end tssmooth e double p1=performance, parms(0.1) tssmooth e double p2=performance, parms(0.2) tssmooth e double p3= performance, parms(0.3) tssmooth e double p4= performance, parms(0.4) tssmooth e double p5= performance, parms(0.5) tssmooth e double p6= performance, parms(0.6) tssmooth e double p7= performance, parms(0.7) tssmooth e double p8= performance, parms(0.8) tssmooth e double p9= performance, parms(0.9)
David
0 Response to How to handle the missing values generated by tssmooth exponential in unbalanced panel data
Post a Comment