I am using Stata 14 and would like to calculate the sales-based Herfindahl index to control for industry competition. A sample of the data I'm using is below. The variables are "financial year", "sale", SIC 2-digit" and the "industry group"
* Example generated by -dataex-. To install: ssc install dataex
clear
input int fyear double sale byte sic2 str14 ind_group
2013 1577.23 27 "manufacturing"
2016 926.638 80 "services"
2007 2017.114 73 "services"
2014 17473.506 13 "mining"
2010 32816.555 48 "transportation"
2014 1595.395 28 "manufacturing"
2016 . 67 "finance"
2013 1889.83 26 "manufacturing"
2009 . 67 "finance"
2017 42.21 60 "finance"
2013 42.204 28 "manufacturing"
2014 1054.821 73 "services"
2017 206.537 60 "finance"
2011 42.152 60 "finance"
2015 91.182 73 "services"
2012 0 28 "manufacturing"
2016 . 67 "finance"
2016 42.136 60 "finance"
2009 7705 10 "mining"
2013 0 10 "mining"
2007 . 67 "finance"
2010 . 67 "finance"
2008 383.296 80 "services"
2010 243.826 73 "services"
2014 . 67 "finance"
2012 2355.525 35 "manufacturing"
2009 42.106 28 "manufacturing"
2008 5998.843 20 "manufacturing"
2012 351.829 28 "manufacturing"
2016 . 67 "finance"
2010 42.088 67 "finance"
2013 779.325 79 "services"
2017 . 67 "finance"
2011 1059.803 73 "services"
2017 463.768 38 "manufacturing"
2016 . 67 "finance"
2017 16.35 28 "manufacturing"
2017 . 67 "finance"
2007 148.469 60 "finance"
2013 24.693 60 "finance"
2013 275.495 67 "finance"
2011 155.827 36 "manufacturing"
2006 108.434 80 "services"
2007 4722.847 63 "finance"
2013 . 67 "finance"
2008 89.279 60 "finance"
2014 3778.31 35 "manufacturing"
2008 41.934 99 "public"
2009 129.061 73 "services"
2012 42.034 60 "finance"
2011 41.923 80 "services"
2013 . 67 "finance"
2016 1181.236 61 "finance"
2015 4.607 28 "manufacturing"
2009 101.461 99 "public"
2009 . 67 "finance"
2014 2641 87 "services"
2014 .564 28 "manufacturing"
2006 41.875 62 "finance"
2012 1768.631 28 "manufacturing"
2012 32.169 73 "services"
2010 . 67 "finance"
2011 794.585 34 "manufacturing"
2006 . 67 "finance"
2015 11.456 28 "manufacturing"
2006 41.838 60 "finance"
2015 167.623 60 "finance"
2015 62.075 60 "finance"
2017 254.22 48 "transportation"
2017 344.49 35 "manufacturing"
2014 . 67 "finance"
2016 . 67 "finance"
2006 41.795 73 "services"
2006 . 67 "finance"
2013 41.792 67 "finance"
2013 53.506 80 "services"
2015 58.981 62 "finance"
2016 . 67 "finance"
2012 . 67 "finance"
2015 41.757 38 "manufacturing"
2014 . 67 "finance"
2014 752.086 10 "mining"
2017 19643.423 45 "transportation"
2008 . 67 "finance"
2015 1.747 38 "manufacturing"
2006 . 67 "finance"
2010 0 38 "manufacturing"
2007 258.184 67 "finance"
2013 95.537 73 "services"
2007 41.691 13 "mining"
2016 86.202 60 "finance"
2010 241.967 20 "manufacturing"
2006 277.032 61 "finance"
2015 . 67 "finance"
2014 41.643 67 "finance"
2016 1651.731 45 "transportation"
2015 . 67 "finance"
2006 133.18 62 "finance"
2013 68.004 73 "services"
2014 . 67 "finance"
The full dataset has some negative figures for sale.
How do I calculate the Herfindahl index?.
Related Posts with Sales-based Herfindahl index
Dropping all panel observations if any one of them have missing value for any one of the variablesHi there, I have a firm-level data for two years. I want to drop a firm entirely (both years' obser…
Construct matrix counting pairwise agreementsI'm interested in a set of problems in which the data from each individual is a vector of integer-va…
How to create variable of relative change?Dear experts, I have a dataset including monthly observations from June 2017 - June 2019, where I w…
Creating Mills RatiosHi all, This is my first post here so I apologise in advance if I've broken any rules, and I also a…
Rolling standard devI have an unbalanced panel dataset with many (15000+) firms and their daily stock returns from 1960-…
Subscribe to:
Post Comments (Atom)
0 Response to Sales-based Herfindahl index
Post a Comment