I have panel data and I would like to calculate the standard deviation of my scaled sale variable (sales_scaled) at firm-level with the rangestat function. I have now the following code:
rangestat (sd) sigma = sales_scaled, interval (fyear low high) by (Firm_id). However, I don't know what values to take for the interval (for low and for high). My dataset looks like this:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str6 gvkey double(fyear sale) float(scaling_variable Firm_id sales_scaled) "001004" 2002 606.337 698.41 1 .8681678 "001004" 2003 651.958 697.9565 1 .9340955 "001004" 2004 747.848 720.761 1 1.0375811 "001004" 2005 897.284 855.5245 1 1.0488116 "001004" 2006 1061.169 1023.226 1 1.0370817 "001004" 2007 1384.919 1214.8215 1 1.1400185 "001004" 2008 1423.976 1369.7605 1 1.0395802 "001004" 2009 1352.151 1439.2765 1 .9394658 "001004" 2010 1775.782 1602.3845 1 1.1082121 "001004" 2011 2074.498 1949.69 1 1.0640142 "001004" 2012 2167.1 2166.2766 1 1.00038 "001004" 2013 2035 2168.2 1 .9385666 "001004" 2014 1594.3 1857.25 1 .8584197 "001004" 2015 1662.6 1478.55 1 1.12448 "001004" 2016 1767.6 1473.1 1 1.1999185 "001004" 2017 1748.3 1514.4 1 1.1544505 "001045" 2003 17440 29798.5 5 .5852644 "001045" 2004 18645 29051.5 5 .6417913 "001045" 2005 20712 29134 5 .7109219 "001045" 2006 22563 29320 5 .769543 "001045" 2007 22896 28858 5 .7934022 "001045" 2008 23766 26873 5 .8843821 "001045" 2009 19917 25306.5 5 .787031 "001045" 2010 22170 25263 5 .877568 "001045" 2011 24022 24468 5 .9817721 "001045" 2012 24855 23679 5 1.0496643 "001045" 2013 26712 32894 5 .812063 "001045" 2014 42650 43024.5 5 .9912956 "001045" 2015 40990 46093 5 .889289 "001045" 2016 40180 49844.5 5 .806107 "001045" 2017 42207 51335 5 .8221876 "001050" 2003 68.159 43.9155 6 1.5520488 "001050" 2004 69.366 42.2975 6 1.639955 "001050" 2005 81.521 43.1705 6 1.8883497 "001050" 2006 135.359 53.044 6 2.551825 "001050" 2007 235.953 79.8615 6 2.9545274 "001050" 2008 217.89 108.276 6 2.0123572 "001050" 2009 138.985 98.766 6 1.407215 "001050" 2010 140.602 76.153 6 1.8463094 "001050" 2011 139.192 77.068 6 1.8060933 "001050" 2012 135.052 86.7245 6 1.557253 "001050" 2013 197.317 221.32 6 .8915462 "001050" 2014 263.217 381.4505 6 .6900424 "001050" 2015 367.422 506.592 6 .7252819 "001050" 2016 417.011 548.7265 6 .7599615 "001050" 2017 345.051 468.5915 6 .7363578 "001072" 2002 1134.111 1696.056 8 .6686754 "001072" 2003 1136.577 1684.195 8 .6748489 "001072" 2004 1283.202 1678.813 8 .7643508 "001072" 2005 1333.208 1682.4785 8 .7924072 "001072" 2006 1498.495 1787.372 8 .838379 "001072" 2007 1619.275 2004.307 8 .8078977 "001072" 2008 1389.613 1990.8035 8 .6980162 "001072" 2009 1304.966 1962.0105 8 .6651167 "001072" 2010 1653.176 2185.487 8 .7564337 "001072" 2011 1545.254 2393.747 8 .6455377 "001072" 2012 1414.4 2535.0034 8 .557948 "001072" 2013 1442.604 2493.4915 8 .5785478 "001072" 2014 1353.228 2422.0015 8 .55872303 "001072" 2015 1195.529 2434.417 8 .4910946 "001072" 2016 1312.661 2443.616 8 .53717977 "001072" 2017 1562.474 2575.0896 8 .6067649 "001075" 2005 2987.955 10609.696 9 .28162494 "001075" 2006 3401.748 11389.294 9 .2986794 "001075" 2007 3523.62 11349.828 9 .3104558 "001075" 2008 3367.076 11431.902 9 .2945333 "001075" 2009 3297.101 11714.124 9 .2814637 "001075" 2010 3263.645 12085.43 9 .27004793 "001075" 2011 3241.379 12736.86 9 .25448808 "001075" 2012 3301.804 13245.316 9 .24928087 "001075" 2013 3454.628 13444.15 9 .25696144 "001075" 2014 3491.632 13911.108 9 .25099596 "001075" 2015 3495.443 14670.896 9 .23825696 "001075" 2016 3498.682 15516.256 9 .22548494 "001075" 2017 3565.296 16511.668 9 .21592586 "001078" 2003 19680.561 25487.22 11 .7721736 "001078" 2004 19680.016 27741.42 11 .7094092 "001078" 2005 22287.808 28954.35 11 .7697569 "001078" 2006 22476.322 32659.69 11 .6881977 "001078" 2007 25914.238 37946.047 11 .6829233 "001078" 2008 29527.552 41066.57 11 .7190168 "001078" 2009 30764.707 47417.91 11 .6487992 "001078" 2010 35166.721 55939.45 11 .6286569 "001078" 2011 38851.259 59869.58 11 .6489316 "001078" 2012 39873.91 63755.92 11 .625415 "001078" 2013 21848 55093.97 11 .3965588 "001078" 2014 20247 42114 11 .4807665 "001078" 2015 20405 41261 11 .4945348 "001078" 2016 20853 46956.5 11 .4440919 "001078" 2017 27390 64458 11 .4249279 "001104" 2003 34.975 18.8185 14 1.8585434 "001104" 2004 43.381 21.516 14 2.0162203 "001104" 2005 49.946 25.6015 14 1.9509014 "001104" 2006 56.863 31.6075 14 1.799035 "001104" 2007 63.173 38.6215 14 1.6356952 "001104" 2008 68.719 43.823 14 1.5681034 "001104" 2009 59.149 43.8665 14 1.3483865 "001104" 2010 63.149 45.945 14 1.3744477 "001104" 2011 73.302 52.4015 14 1.398853 "001104" 2012 84.37 61.525 14 1.3713125 end
Thanks in advance.
0 Response to Calculate standard deviations of sale (variable) at firm-level with rangestat function
Post a Comment