Statalist


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

st: AW: counting members of groups in unbalanced panel data


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: counting members of groups in unbalanced panel data
Date   Fri, 2 Oct 2009 17:01:03 +0200

<> 

And Nick`s http://www.stata.com/support/faqs/data/distinct.html




HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Oliver
Weidenmueller
Gesendet: Freitag, 2. Oktober 2009 16:49
An: [email protected]
Betreff: st: counting members of groups in unbalanced panel data

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/


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index