Statalist


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

AW: st: Fixed effect dummy variable


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   AW: st: Fixed effect dummy variable
Date   Wed, 5 Aug 2009 09:01:01 +0200

<> 

" I was trying with the following syntax:
egen, group(year)
egen, group(region)"



-egen, group()- does take a -varlist-. So stick both vars in there:

-egen, group(year region)-


HTH
Martin

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Tharshini
Thangavelu
Gesendet: Mittwoch, 5. August 2009 08:58
An: [email protected]
Betreff: Re: st: Fixed effect dummy variable

Hi Clive,

Yes, I meant a way of a combination. But the command that you have given me
doesn't seem to be working. I keep getting the error message : invalid
syntax. 
I have year of work from 1987 - 1996 (=total 10 years)and 9 region. 

.tab yearw

      yearw |      Freq.     Percent        Cum.
------------+-----------------------------------
       1987 |     23,125       10.83       10.83
       1988 |     21,510       10.08       20.91
       1989 |     23,334       10.93       31.84
       1990 |     23,110       10.83       42.67
       1991 |     22,774       10.67       53.34
       1992 |     22,235       10.42       63.75
       1993 |     21,233        9.95       73.70
       1994 |     20,747        9.72       83.42
       1995 |     17,606        8.25       91.66
       1996 |     17,793        8.34      100.00
------------+-----------------------------------
      Total |    213,467      100.00


.tab region

     census |
     region |      Freq.     Percent        Cum.
------------+-----------------------------------
         11 |     17,436        8.17        8.17
         12 |     30,363       14.22       22.39
         21 |     31,048       14.54       36.94
         22 |     18,448        8.64       45.58
         31 |     34,182       16.01       61.59
         32 |      9,581        4.49       66.08
         33 |     19,520        9.14       75.22
         41 |     21,222        9.94       85.17
         42 |     31,667       14.83      100.00
------------+-----------------------------------
      Total |    213,467      100.00


I was trying with the following syntax:
egen, group(year)
egen, group(region)

/Tharshini


On 2009-08-05, at 06:33, Clive Nicholas wrote:
> Tharshini Thangavelu wrote:
>
>> How do I create year and region fixed effect dummy variables?
>
> If you mean by way of a combination, then -egen, group()- will do the
trick.
>
> -- 
> Clive Nicholas
>
> [Please DO NOT mail me personally here, but at
> <[email protected]>. Please respond to contributions I make in
> a list thread here. Thanks!]
>
> "My colleagues in the social sciences talk a great deal about
> methodology. I prefer to call it style." -- Freeman J. Dyson.
> *
> *   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/

-- 
Tharshini THANGAVELU
Forskarbacken 8 / 101
114 16 Stockholm
Sweden
Phone +46 (0)735 53 43 90
E-mail [email protected]
*
*   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