Re: st: calculate concentration ratio of four firms

I use sas for data management, it is easier! In stata search for the
egen function
--
Charles Koss
http://charlesonnet.blogspot.com/
2009/12/27 Alper [iso-8859-9] Sönmez <salper@metu.edu.tr>:
> Hi, I want to calculate the first four firms share in each industry at
> time t (HHI4 or CH4). I calculated the shares but i cannot sum first four
> firms shares in each industry at time t.
> I tried egen and gen commands with several functions but they were not
> worked
> Also i did not find any solution or material from stata books and online
> resources
> I have an Unbalanced firm level panel data with variables id, years(t)
> 2003-2006, and 2digitsectors(Sector)and it is in long form
>
> The problem:
> I calculated
> 1stly, total sales of industry j at time t (Yjt)
> 2ndly, share of a firm i in industry j (sales of firm i/Yjt)*100=a
> 3rd a^2 for each firm at time t
>
> 4 step is problematic: I can not calculate shares of first four firms in
> sector j at time t
> like this max(a+a+a+a) by (sector year) and write this value for firms in
> these sector and year
>
> Please help me,
>
> in advance thanks,
>
>
>
>
>
> --
> Alper Sönmez
>
> ODTÜ/METU
> ÝÝBF Ýktisat Bölümü/FEAS Department of Economics
> Ankara Türkiye
> Tel/Phone:0312 210 30 77
> Fax: 0312 210 79 64
>
>
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/