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]

Re: st: Creating a dummy for each large firm in each fiscal year (foreach command)


From   daniel klein <[email protected]>
To   [email protected]
Subject   Re: st: Creating a dummy for each large firm in each fiscal year (foreach command)
Date   Sun, 12 Jun 2011 22:21:35 +0200

I do not think the first dummy (gvkeylarge) is needed here. One way to
create the disired dummy (largefirmdummy) might be

levelsof gvkey if (fyear==2008) & (at > 100) ,loc(keys) s(,)
g byte largefirmdummy = inlist(gvkey, `keys')

The -inlist()- function will not work if there are more than about 240
large firms, though. If this is the case, you may have to create a
loop over the elements of the local. Alternatively, you may also think
about using -reshape- your data wide.

Best
Daniel
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index