Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: Generating dummies


From   "ALICE DOBSON" <[email protected]>
To   [email protected]
Subject   RE: st: RE: Generating dummies
Date   Tue, 21 Jun 2005 15:17:17 -0400

Thanks a lot. The idea is to create 55 dummies [for 56 states] so that I can code 1 for a firm located in any state (say) Michigan for all years. This is to control for performance differences across firms attributed to their differences in locations.


From: <[email protected]>
Reply-To: [email protected]
To: <[email protected]>
Subject: st: RE: Generating dummies
Date: Tue, 21 Jun 2005 17:35:54 +0200

I think this is a way, but certainly there are others much better
encode state, ge(id)
tab id, ge(st)
with your dataset this will give

. tab id, ge(st)

         id |      Freq.     Percent        Cum.
------------+-----------------------------------
         MA |          4       50.00       50.00
         ME |          4       50.00      100.00
------------+-----------------------------------
      Total |          8      100.00

anna
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of ALICE DOBSON
Sent: 21 June 2005 17:09
To: [email protected]
Subject: st: Generating dummies


Dear Statalist members,
I have a panel data with each firm (representing a panel) located in a
particular state in the US.

firmid year state var1 var2 var3..........
0001  1992  ME
0001  1993  ME
0001  1994  ME
0001  1995  ME
0002  1992  MA
0003  1993  MA
0004  1994  MA
0005  1995  MA

How can I generate a state dummy for each observation?
Best,
Alice

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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