Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Re: Creating a dummy for each large firm in each fiscal year


From   Christopher Baum <kit.baum@bc.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Creating a dummy for each large firm in each fiscal year
Date   Mon, 13 Jun 2011 03:16:33 -0400

<>
No loops needed:

g largefirm = (fyear==2008 & at>100 & !mi(at))
bysort gvkey: egen large = total(largefirm)

On Jun 13, 2011, at 8:33 AM, Martin wrote:

> Subject: st: Creating a dummy for each large firm in each fiscal year (foreach command)
> 
> Hello,
> 
> This is my problem. I have a sample which uniquely identifies firms by
> the variable gvkey. Now I want to run a regression over firms that are
> defined as large and therefore I want to create a dummy.  I define
> firms as large on basis of their 2008 total assets. As a result I
> created a dummy variable called largefirmdummywith the command:
> generate largefirmdummy=1 if fyear==2008 & at > 100. Next I entered
> the following command: generate gvkeylarge = gvkey if
> largefirmdummy==1. So I now have the variable gvkeylarge which
> contains the gvkey of each large firm.
> 


Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                              An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html




*
*   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   |   Site index