Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Panel data construction


From   Marcello Pagano <[email protected]>
To   <[email protected]>
Subject   st: Panel data construction
Date   Wed, 31 Jul 2013 07:28:49 -0400

Posting this for Sotiris:


-------- Original Message --------

I have the following dataset :
Firm Year Country Ownership
A 1997 USA 0
A 1998 USA 1
A 1999 USA 1
B 1997 USA 0
B 1998 USA 0
B 1999 USA 1
C 1998 CAN 0
C 1999 CAN 0
......
this is a panel data that consits from many countries and 12,000 different
firms. The ownership variable is dummy with 1=foreign owned and 0=domestic
owned. The firm variable is string.

I want to create the ratio=(number of banks that are foreign owned by year
and country)/(total number of banks by year and country). In my previous
example the ratio sould look like this:
Firm Year Country Ownership ratio
A 1997 USA 0 (0/2)=0
A 1998 USA 1 (1/2)=0.5
A 1999 USA 1 (2/2)=1
B 1997 USA 0 (0/2)=0
B 1998 USA 0 (1/2)=0.5
B 1999 USA 1 (2/2)=1
C 1998 CAN 0
C 1999 CAN 0

Thank you in advance.



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index