Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: counting members of groups in unbalanced panel data


From   "Oliver Weidenmueller" <o.weidenmueller@gmx.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: counting members of groups in unbalanced panel data
Date   Fri, 2 Oct 2009 16:49:24 +0200

Hello everyone

I am having troubles figuring out how to in a panel data structure to derive
some descriptives.

In my data

- there are mutliple companies, each having 1 to many funds
- each fund being of one of 11 strategies
- each fund only showing observations for part of the total sample period.

I require

- the total number of companies per month
- the average (median, max) number of funds per company per month
- the average (median, min, max) number of strategies per company per month 

The data format is for example like this:

CompanyID      FundID             Strategy           Date             Return
3021                 205                  2          Jan 94             X
3021                 205                  2          Feb 94             X
3021                 405                  3          Jan 94             X
4671                 904                  9          Feb 94             X
4671                 904                  5          Mar 94             X
4671                 154                  1          Mar 94             X
...

Number of funds per family per month was easy:
by companyid mydate ,sort: egen perfamnrofunds = count(R)

But now I ran into troubles. I would greatly appreciate if anyone could
help.

Thanks in advance,

Best regards,

Oliver 



*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index